Skip to content

Commit

Permalink
Enhancement: Add support for PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Apr 7, 2024
1 parent 32e5975 commit 0ebab78
Show file tree
Hide file tree
Showing 46 changed files with 670 additions and 193 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Remove incompatible dependencies with composer"
run: "composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Require phpunit/phpunit:^${{ matrix.phpunit-version }}"
run: "composer require phpunit/phpunit:^${{ matrix.phpunit-version }} --ansi --no-interaction --no-progress --update-with-all-dependencies"
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Remove incompatible dependencies with composer"
run: "composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Remove phpunit/phpunit with composer"
run: "composer remove phpunit/phpunit --ansi --no-interaction --ignore-platform-reqs --no-progress"
Expand Down Expand Up @@ -461,6 +461,7 @@ jobs:
- "9.0.0"

php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
Expand All @@ -472,6 +473,14 @@ jobs:
- "highest"

include:
- phpunit-version: "7.5.0"
php-version: "7.3"
dependencies: "lowest"

- phpunit-version: "7.5.0"
php-version: "7.3"
dependencies: "highest"

- phpunit-version: "7.5.0"
php-version: "7.4"
dependencies: "lowest"
Expand Down Expand Up @@ -555,7 +564,7 @@ jobs:

- name: "Remove incompatible dependencies with composer"
if: "matrix.dependencies != 'locked'"
run: "composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Remove platform configuration with composer"
if: "matrix.dependencies != 'locked'"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Remove incompatible dependencies with composer"
run: "composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Remove phpunit/phpunit with composer"
run: "composer remove phpunit/phpunit --ansi --no-interaction --ignore-platform-reqs --no-progress"
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\Php74::create()
$ruleSet = PhpCsFixer\Config\RuleSet\Php73::create()
->withHeader($license->header())
->withRules(PhpCsFixer\Config\Rules::fromArray([
'mb_str_functions' => false,
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`2.10.0...main`][2.10.0...main].

### Changed

- Added support for PHP 7.3 ([#476]), by [@localheinz]

## [`2.10.0`][2.10.0]

For a full diff see [`2.9.0...2.10.0`][2.9.0...2.10.0].
Expand Down Expand Up @@ -276,6 +280,7 @@ For a full diff see [`7afa59c...1.0.0`][7afa59c...1.0.0].
[#396]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/396
[#447]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/447
[#448]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/448
[#476]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/476
[#485]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/485
[#491]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/491
[#494]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/494
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"security": "https://github.com/ergebnis/phpunit-slow-test-detector/blob/main/.github/SECURITY.md"
},
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"phpunit/phpunit": "^7.5.0 || ^8.5.19 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42.0",
"ergebnis/data-provider": "^3.2.0",
"ergebnis/license": "^2.4.0",
"ergebnis/php-cs-fixer-config": "^6.25.1",
"fakerphp/faker": "^1.23.1",
"fakerphp/faker": "^1.20.0",
"psalm/plugin-phpunit": "~0.19.0",
"psr/container": "~1.0.0",
"rector/rector": "^1.0.4",
"vimeo/psalm": "^5.23.1"
},
Expand Down
85 changes: 11 additions & 74 deletions composer.lock

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

54 changes: 47 additions & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
</file>
<file src="src/Formatter/DefaultDurationFormatter.php">
<InvalidOperand>
<code><![CDATA[$duration->seconds() * 1_000 + $duration->nanoseconds() / 1_000_000]]></code>
<code><![CDATA[$duration->seconds() * 1000 + $duration->nanoseconds() / 1000000]]></code>
<code><![CDATA[$durationInMilliseconds - $hoursInMilliseconds]]></code>
<code><![CDATA[$durationInMilliseconds - $hoursInMilliseconds]]></code>
<code><![CDATA[$durationInMilliseconds / 60]]></code>
<code><![CDATA[$durationInMilliseconds / 60]]></code>
<code><![CDATA[($durationInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1_000]]></code>
<code><![CDATA[($durationInMilliseconds - $hoursInMilliseconds - $minutesInMilliseconds) / 1000]]></code>
</InvalidOperand>
</file>
<file src="src/Subscriber/Test/FinishedSubscriber.php">
Expand Down Expand Up @@ -60,6 +60,51 @@
<code><![CDATA[$reporter]]></code>
</UnusedParam>
</file>
<file src="test/DataProvider/AbstractProvider.php">
<MixedAssignment>
<code><![CDATA[$value]]></code>
</MixedAssignment>
<UndefinedClass>
<code><![CDATA[Exception\EmptyValues]]></code>
<code><![CDATA[Exception\EmptyValues]]></code>
<code><![CDATA[Exception\EmptyValues]]></code>
</UndefinedClass>
<UndefinedDocblockClass>
<code><![CDATA[Exception\EmptyValues]]></code>
<code><![CDATA[Exception\EmptyValues]]></code>
</UndefinedDocblockClass>
</file>
<file src="test/DataProvider/IntProvider.php">
<MixedReturnTypeCoercion>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
<code><![CDATA[\Generator<string, array{0: int}>]]></code>
</MixedReturnTypeCoercion>
<PossiblyUnusedMethod>
<code><![CDATA[arbitrary]]></code>
<code><![CDATA[lessThanOne]]></code>
<code><![CDATA[one]]></code>
</PossiblyUnusedMethod>
</file>
<file src="test/DataProvider/StringProvider.php">
<MixedReturnTypeCoercion>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
<code><![CDATA[\Generator<string, array{0: string}>]]></code>
</MixedReturnTypeCoercion>
<PossiblyUnusedMethod>
<code><![CDATA[trimmed]]></code>
<code><![CDATA[untrimmed]]></code>
<code><![CDATA[withWhitespace]]></code>
</PossiblyUnusedMethod>
</file>
<file src="test/EndToEnd/Version07/TestCase/Combination/SleeperTest.php">
<PossiblyUnusedMethod>
<code><![CDATA[sleepWithAfterAnnotation]]></code>
Expand Down Expand Up @@ -409,9 +454,4 @@
<code><![CDATA[$this->milliseconds * 1000]]></code>
</ArgumentTypeCoercion>
</file>
<file src="test/Unit/Reporter/DefaultReporterTest.php">
<MixedReturnStatement>
<code><![CDATA[iterable]]></code>
</MixedReturnStatement>
</file>
</files>
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
__DIR__ . '/test/',
]);

$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_74);
$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_73);
};
5 changes: 4 additions & 1 deletion src/Attribute/MaximumDuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
#[\Attribute(\Attribute::TARGET_METHOD)]
final class MaximumDuration
{
private int $milliseconds;
/**
* @var int
*/
private $milliseconds;

/**
* @throws Exception\InvalidMilliseconds
Expand Down
2 changes: 1 addition & 1 deletion src/Collector/DefaultCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class DefaultCollector implements Collector
/**
* @var array<string, SlowTest>
*/
private array $slowTests = [];
private $slowTests = [];

public function collect(SlowTest $slowTest): void
{
Expand Down
5 changes: 4 additions & 1 deletion src/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
*/
final class Count
{
private int $value;
/**
* @var int
*/
private $value;

private function __construct(int $value)
{
Expand Down

0 comments on commit 0ebab78

Please sign in to comment.