Skip to content

Commit a39249c

Browse files
committed
updated version for php8
1 parent 945b3d2 commit a39249c

26 files changed

+4447
-1988
lines changed

.gitattributes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.scrutinizer.yml export-ignore
2-
.travis.yml export-ignore
3-
phpunit.xml.dist export-ignore
4-
src/Tests export-ignore
1+
.scrutinizer.yml export-ignore
2+
.travis.yml export-ignore
3+
phpunit.xml.dist export-ignore
4+
src/Tests export-ignore

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vendor/
1+
vendor/

.php-cs-fixer.dist.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
$header = <<<EOF
4+
This file is part of the Runalyze Age Grade.
5+
6+
(c) RUNALYZE <[email protected]>
7+
8+
This source file is subject to the MIT license that is bundled
9+
with this source code in the file LICENSE.
10+
EOF;
11+
12+
13+
return (new PhpCsFixer\Config())
14+
->setRiskyAllowed(true)
15+
->setRules([
16+
'header_comment' => [
17+
'header' => $header
18+
],
19+
'ordered_imports' => true,
20+
'php_unit_construct' => true,
21+
'strict_comparison' => true,
22+
'strict_param' => true,
23+
'phpdoc_separation' => false,
24+
])
25+
->setFinder(
26+
PhpCsFixer\Finder::create()
27+
->in(__DIR__.DIRECTORY_SEPARATOR.'src')
28+
)
29+
;

.php_cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

.scrutinizer.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
filter:
2-
paths: [src/*]
3-
excluded_paths:
4-
- src/Tests/*
5-
tools:
6-
php_analyzer: true
7-
php_mess_detector: true
8-
php_pdepend: true
9-
external_code_coverage:
10-
timeout: '600'
1+
filter:
2+
paths: [src/*]
3+
excluded_paths:
4+
- src/Tests/*
5+
tools:
6+
php_analyzer: true
7+
php_mess_detector: true
8+
php_pdepend: true
9+
external_code_coverage:
10+
timeout: '600'

.travis.yml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
language: php
2-
3-
php:
4-
- 5.5
5-
- 5.6
6-
- 7.0
7-
8-
sudo: false
9-
10-
cache:
11-
directories:
12-
- vendor
13-
- $HOME/.composer/cache
14-
15-
before_install:
16-
- mkdir -p build/logs
17-
18-
install:
19-
- composer install --prefer-dist --no-interaction
20-
21-
script:
22-
- phpunit --coverage-clover build/logs/clover.xml
23-
- vendor/bin/php-cs-fixer fix -v --diff --dry-run
24-
25-
after_script:
26-
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
1+
language: php
2+
3+
php:
4+
- 8.0
5+
6+
sudo: false
7+
8+
cache:
9+
directories:
10+
- vendor
11+
- $HOME/.composer/cache
12+
13+
before_install:
14+
- mkdir -p build/logs
15+
16+
install:
17+
- composer install --prefer-dist --no-interaction
18+
19+
script:
20+
- phpunit --coverage-clover build/logs/clover.xml
21+
- vendor/bin/php-cs-fixer fix -v --diff --dry-run
22+
23+
after_script:
24+
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml

CONTRIBUTING.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
## Running Unit Tests
2-
3-
This library uses [phpunit](https://phpunit.de/) for automated tests.
4-
`phpunit` is installed by default via Composer.
5-
6-
To run checks:
7-
8-
```console
9-
$ ./vendor/bin/phpunit
10-
```
11-
12-
## Running Coding Standards Checks
13-
14-
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
15-
standards checks, and provides configuration for our selected checks.
16-
`php-cs-fixer` is installed by default via Composer.
17-
18-
To run checks only:
19-
20-
```console
21-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs
22-
```
23-
24-
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
25-
flag:
26-
27-
```console
28-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs
29-
```
30-
31-
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
32-
they pass, and make sure you add and commit the changes after verification.
1+
## Running Unit Tests
2+
3+
This library uses [phpunit](https://phpunit.de/) for automated tests.
4+
`phpunit` is installed by default via Composer.
5+
6+
To run checks:
7+
8+
```console
9+
$ ./vendor/bin/phpunit
10+
```
11+
12+
## Running Coding Standards Checks
13+
14+
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
15+
standards checks, and provides configuration for our selected checks.
16+
`php-cs-fixer` is installed by default via Composer.
17+
18+
To run checks only:
19+
20+
```console
21+
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run
22+
```
23+
24+
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
25+
flag:
26+
27+
```console
28+
$ ./vendor/bin/php-cs-fixer fix . -v --diff
29+
```
30+
31+
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
32+
they pass, and make sure you add and commit the changes after verification.

LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2016 Runalyze
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2016 Runalyze
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
# Age Grade
2-
3-
[![Latest Stable Version](https://img.shields.io/packagist/v/runalyze/age-grade.svg)](https://packagist.org/packages/runalyze/age-grade)
4-
[![Build Status](https://travis-ci.org/Runalyze/age-grade.svg?branch=master)](https://travis-ci.org/Runalyze/age-grade)
5-
[![Code Coverage](https://scrutinizer-ci.com/g/Runalyze/age-grade/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
6-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Runalyze/age-grade/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
7-
[![MIT License](https://img.shields.io/github/license/twbs/bootlint.svg)](https://github.com/Runalyze/age-grade/blob/master/LICENSE)
8-
9-
Library to provide age grading for race results (running) based on tables provided by
10-
[Alan Jones](http://www.runscore.com/Alan/AgeGrade.html) using standards by
11-
WMA ([World Masters Athletics](http://www.world-masters-athletics.org/)) and
12-
USATF ([USA Track and Field](http://www.usatf.org/)).
13-
14-
## Usage
15-
16-
```php
17-
use Runalyze\AgeGrade\Lookup;
18-
use Runalyze\AgeGrade\Table\MaleTable;
19-
20-
$Lookup = new Lookup(new MaleTable(), 54);
21-
echo $Lookup->getAgeGrade(10.0, 42 * 60 + 25); // output: 0.7329
22-
```
23-
24-
Internally, `getAgeGrade()` returns an `AgeGrade` object that will return the rounded age grade value when transformed to a string.
25-
You can fetch more details by respective methods:
26-
27-
```php
28-
$Lookup = new Lookup(new MaleTable(), 54);
29-
$AgeGrade = $Lookup->getAgeGrade(10.0, 42 * 60 + 25);
30-
$AgeGrade->getPerformance(); // returns 0.7329
31-
$AgeGrade->getAgeStandard(); // returns 1865
32-
$AgeGrade->getOpenStandard(); // returns 1603
33-
$AgeGrade->getAgeFactor(); // returns 0.8594
34-
```
35-
36-
## License
37-
38-
* Code released under [the MIT license](LICENSE).
39-
* Tables are licensed under [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
40-
* All Masters standards/factors are as approved by the WMA Vice President - Non Stadia, WMA President, and USATF MLDR Committee.
1+
# Age Grade
2+
3+
[![Latest Stable Version](https://img.shields.io/packagist/v/runalyze/age-grade.svg)](https://packagist.org/packages/runalyze/age-grade)
4+
[![Build Status](https://travis-ci.org/Runalyze/age-grade.svg?branch=master)](https://travis-ci.org/Runalyze/age-grade)
5+
[![Code Coverage](https://scrutinizer-ci.com/g/Runalyze/age-grade/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
6+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Runalyze/age-grade/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/age-grade/?branch=master)
7+
[![MIT License](https://img.shields.io/github/license/twbs/bootlint.svg)](https://github.com/Runalyze/age-grade/blob/master/LICENSE)
8+
9+
Library to provide age grading for race results (running) based on tables provided by
10+
[Alan Jones](http://www.runscore.com/Alan/AgeGrade.html) using standards by
11+
WMA ([World Masters Athletics](http://www.world-masters-athletics.org/)) and
12+
USATF ([USA Track and Field](http://www.usatf.org/)).
13+
14+
## Usage
15+
16+
```php
17+
use Runalyze\AgeGrade\Lookup;
18+
use Runalyze\AgeGrade\Table\MaleTable;
19+
20+
$Lookup = new Lookup(new MaleTable(), 54);
21+
echo $Lookup->getAgeGrade(10.0, 42 * 60 + 25); // output: 0.7329
22+
```
23+
24+
Internally, `getAgeGrade()` returns an `AgeGrade` object that will return the rounded age grade value when transformed to a string.
25+
You can fetch more details by respective methods:
26+
27+
```php
28+
$Lookup = new Lookup(new MaleTable(), 54);
29+
$AgeGrade = $Lookup->getAgeGrade(10.0, 42 * 60 + 25);
30+
$AgeGrade->getPerformance(); // returns 0.7329
31+
$AgeGrade->getAgeStandard(); // returns 1865
32+
$AgeGrade->getOpenStandard(); // returns 1603
33+
$AgeGrade->getAgeFactor(); // returns 0.8594
34+
```
35+
36+
## License
37+
38+
* Code released under [the MIT license](LICENSE).
39+
* Tables are licensed under [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
40+
* All Masters standards/factors are as approved by the WMA Vice President - Non Stadia, WMA President, and USATF MLDR Committee.

composer.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
{
2-
"name": "runalyze/age-grade",
3-
"description": "Age grading for race results (running) based on tables provided by WMA",
4-
"version": "1.2.0",
5-
"license": "MIT",
6-
"require": {
7-
"php": ">=5.5.9"
8-
},
9-
"require-dev": {
10-
"phpunit/phpunit": "4.8.*",
11-
"friendsofphp/php-cs-fixer": "^1.11"
12-
},
13-
"autoload": {
14-
"psr-4": {
15-
"Runalyze\\AgeGrade\\": "src/"
16-
}
17-
}
18-
}
1+
{
2+
"name": "runalyze/age-grade",
3+
"description": "Age grading for race results (running) based on tables provided by WMA",
4+
"version": "2.0.0",
5+
"license": "MIT",
6+
"require": {
7+
"php": ">=8.0"
8+
},
9+
"require-dev": {
10+
"phpunit/phpunit": "^9.0",
11+
"friendsofphp/php-cs-fixer": "^3.2"
12+
},
13+
"autoload": {
14+
"psr-4": {
15+
"Runalyze\\AgeGrade\\": "src/"
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)