Skip to content

Commit

Permalink
Enhancement: Add support for PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 1, 2024
1 parent 3c69cb8 commit 47fcd1e
Show file tree
Hide file tree
Showing 31 changed files with 415 additions and 257 deletions.
13 changes: 8 additions & 5 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ branches:
required_approving_review_count: 1
required_status_checks:
checks:
- context: "Code Coverage (8.0, locked)"
- context: "Coding Standards (8.0, locked)"
- context: "Dependency Analysis (8.0, locked)"
- context: "Security Analysis (8.0, locked)"
- context: "Static Code Analysis (8.0, locked)"
- context: "Code Coverage (7.4, locked)"
- context: "Coding Standards (7.4, locked)"
- context: "Dependency Analysis (7.4, locked)"
- context: "Security Analysis (7.4, locked)"
- context: "Static Code Analysis (7.4, locked)"
- context: "Tests (7.4, highest)"
- context: "Tests (7.4, locked)"
- context: "Tests (7.4, lowest)"
- context: "Tests (8.0, highest)"
- context: "Tests (8.0, locked)"
- context: "Tests (8.0, lowest)"
Expand Down
11 changes: 6 additions & 5 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.0"
- "7.4"

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

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

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

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

dependencies:
- "locked"
Expand Down Expand Up @@ -309,6 +309,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
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.0"
- "7.4"

dependencies:
- "locked"
Expand Down
18 changes: 15 additions & 3 deletions .php-cs-fixer.fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Ergebnis\PhpCsFixer;

$ruleSet = PhpCsFixer\Config\RuleSet\Php80::create()
$ruleSet = PhpCsFixer\Config\RuleSet\Php74::create()
->withHeader('')
->withRules(PhpCsFixer\Config\Rules::fromArray([
'constant_case' => false,
Expand All @@ -33,8 +33,20 @@
$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);

$config->getFinder()
->in(__DIR__ . '/test/Fixture')
->notPath('Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php');
->in(__DIR__ . '/test/Fixture/')
->notPath([
'Classes/PHPUnit/Framework/TestCaseWithSuffixRule/Success/ImplicitlyAbstractTestCase.php',
'Closures/NoNullableReturnTypeDeclarationRule/Failure/closure-with-nullable-union-type-return-type-declaration.php',
'Closures/NoParameterWithNullableTypeDeclarationRule/Failure/closure-with-parameter-with-nullable-union-type-declaration.php',
'Functions/NoNullableReturnTypeDeclarationRule/Failure/function-with-nullable-union-return-type-declaration.php',
'Functions/NoParameterWithNullableTypeDeclarationRule/Failure/function-with-parameter-with-nullable-union-type-declaration.php',
'Methods/NoNullableReturnTypeDeclarationRule/Failure/MethodInAnonymousClassWithNullableUnionReturnTypeDeclaration.php',
'Methods/NoNullableReturnTypeDeclarationRule/Failure/MethodInClassWithNullableUnionReturnTypeDeclaration.php',
'Methods/NoNullableReturnTypeDeclarationRule/Failure/MethodInInterfaceWithNullableUnionReturnTypeDeclaration.php',
'Methods/NoParameterWithNullableTypeDeclarationRule/Failure/method-in-anonymous-class-with-parameter-with-nullable-union-type-declaration.php',
'Methods/NoParameterWithNullableTypeDeclarationRule/Failure/MethodInClassWithParameterWithNullableUnionTypeDeclaration.php',
'Methods/NoParameterWithNullableTypeDeclarationRule/Failure/MethodInInterfaceWithParameterWithNullableUnionTypeDeclaration.php',
]);

$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php_cs.fixture.cache');

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\Php80::create()->withHeader($license->header());
$ruleSet = PhpCsFixer\Config\RuleSet\Php74::create()->withHeader($license->header());

$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For a full diff see [`2.4.0...main`][2.4.0...main].

- Added rule error identifiers ([#875]), by [@localheinz]
- Added support for PHP 8.0 ([#877]), by [@localheinz]
- Added support for PHP 7.4 ([#880]), by [@localheinz]

### Changed

Expand Down Expand Up @@ -535,6 +536,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[#875]: https://github.com/ergebnis/phpstan-rules/pull/875
[#877]: https://github.com/ergebnis/phpstan-rules/pull/877
[#878]: https://github.com/ergebnis/phpstan-rules/pull/878
[#880]: https://github.com/ergebnis/phpstan-rules/pull/880

[@enumag]: https://github.com/enumag
[@ergebnis]: https://github.com/ergebnis
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"security": "https://github.com/ergebnis/phpstan-rules/blob/main/.github/SECURITY.md"
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-mbstring": "*",
"phpstan/phpstan": "^1.10.21"
},
Expand Down Expand Up @@ -58,7 +58,7 @@
"abandoned": "report"
},
"platform": {
"php": "8.0.30"
"php": "7.4.33"
},
"preferred-install": "dist",
"sort-packages": true
Expand Down
Loading

0 comments on commit 47fcd1e

Please sign in to comment.