Skip to content

Commit

Permalink
Enhancement: Add support for PHP 8.0
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Möller <am@localheinz.com>
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
  • Loading branch information
localheinz and mvorisek committed Dec 1, 2023
1 parent f475e8b commit 4e08471
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 73 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

phpunit-version:
- "9.6.0"
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -286,7 +286,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -348,7 +348,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down Expand Up @@ -451,6 +451,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.0"

dependencies:
- "locked"
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$license->save();

$ruleSet = PhpCsFixer\Config\RuleSet\Php81::create()
$ruleSet = PhpCsFixer\Config\RuleSet\Php80::create()
->withHeader($license->header())
->withRules(PhpCsFixer\Config\Rules::fromArray([
'mb_str_functions' => false,
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"security": "https://github.com/ergebnis/phpunit-slow-test-detector/blob/main/.github/SECURITY.md"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"phpunit/phpunit": "^9.6.0 || ^10.4.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.39.0",
"ergebnis/composer-normalize": "^2.31.0",
"ergebnis/data-provider": "^3.2.0",
"ergebnis/license": "^2.4.0",
"ergebnis/php-cs-fixer-config": "^6.13.0",
Expand Down
64 changes: 32 additions & 32 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Rector\Config;
use Rector\Core;
use Rector\Php81;
use Rector\PHPUnit;

return static function (Config\RectorConfig $rectorConfig): void {
Expand All @@ -26,9 +25,5 @@
__DIR__ . '/test/',
]);

$rectorConfig->phpVersion(Core\ValueObject\PhpVersion::PHP_81);

$rectorConfig->rules([
Php81\Rector\Property\ReadOnlyPropertyRector::class,
]);
$rectorConfig->phpVersion(Core\ValueObject\PhpVersion::PHP_80);
};
2 changes: 1 addition & 1 deletion src/Attribute/MaximumDuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class MaximumDuration
/**
* @throws Exception\InvalidMilliseconds
*/
public function __construct(private readonly int $milliseconds)
public function __construct(private int $milliseconds)
{
if (0 >= $milliseconds) {
throw Exception\InvalidMilliseconds::notGreaterThanZero($milliseconds);
Expand Down
2 changes: 1 addition & 1 deletion src/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
final class Count
{
private function __construct(private readonly int $value)
private function __construct(private int $value)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Duration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
final class Duration
{
private function __construct(
private readonly int $seconds,
private readonly int $nanoseconds,
private int $seconds,
private int $nanoseconds,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ final class Extension implements
Runner\BeforeFirstTestHook
{
private int $suites = 0;
private readonly Duration $maximumDuration;
private readonly Collector\Collector $collector;
private readonly Reporter\Reporter $reporter;
private Duration $maximumDuration;
private Collector\Collector $collector;
private Reporter\Reporter $reporter;

public function __construct(array $options = [])
{
Expand Down
6 changes: 3 additions & 3 deletions src/Reporter/DefaultReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ final class DefaultReporter implements Reporter
private Comparator\DurationComparator $durationComparator;

public function __construct(
private readonly Formatter\DurationFormatter $durationFormatter,
private readonly Duration $maximumDuration,
private readonly Count $maximumCount,
private Formatter\DurationFormatter $durationFormatter,
private Duration $maximumDuration,
private Count $maximumCount,
) {
$this->durationComparator = new Comparator\DurationComparator();
}
Expand Down
Loading

0 comments on commit 4e08471

Please sign in to comment.