Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Drop support for PHP 8.0 #702

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ 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: "Mutation Tests (8.0, locked)"
- context: "Refactoring (8.0, locked)"
- context: "Security Analysis (8.0, locked)"
- context: "Static Code Analysis (8.0, locked)"
- context: "Tests (8.0, highest)"
- context: "Tests (8.0, locked)"
- context: "Tests (8.0, lowest)"
- context: "Code Coverage (8.1, locked)"
- context: "Coding Standards (8.1, locked)"
- context: "Dependency Analysis (8.1, locked)"
- context: "Mutation Tests (8.1, locked)"
- context: "Refactoring (8.1, locked)"
- context: "Security Analysis (8.1, locked)"
- context: "Static Code Analysis (8.1, locked)"
- context: "Tests (8.1, highest)"
- context: "Tests (8.1, locked)"
- context: "Tests (8.1, lowest)"
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.0"
- "8.1"

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

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

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

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

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

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

dependencies:
- "locked"
Expand Down Expand Up @@ -409,7 +409,6 @@ jobs:
strategy:
matrix:
php-version:
- "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 @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.0"
- "8.1"

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();

$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php80($license->header()));
$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php81($license->header()));

$config->getFinder()
->exclude([
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 [`1.4.0...main`][1.4.0...main].

### Changed

- Dropped support for PHP 8.0 ([#702]), by [@localheinz]

## [`1.4.0`][1.4.0]

For a full diff see [`1.3.0...1.4.0`][1.3.0...1.4.0].
Expand Down Expand Up @@ -158,6 +162,7 @@ For a full diff see [`0.4.0...0.5.0`][0.4.0...0.5.0].
[#481]: https://github.com/ergebnis/classy/pull/481
[#486]: https://github.com/ergebnis/classy/pull/486
[#619]: https://github.com/ergebnis/classy/pull/619
[#702]: https://github.com/ergebnis/classy/pull/702

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"source": "https://github.com/ergebnis/classy"
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0",
"ext-tokenizer": "*"
},
"require-dev": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"infection/extension-installer": true
},
"platform": {
"php": "8.0.25"
"php": "8.1.20"
},
"preferred-install": "dist",
"sort-packages": true
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

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

4 changes: 2 additions & 2 deletions infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"logs": {
"text": ".build/infection/infection-log.txt"
},
"minCoveredMsi": 87,
"minMsi": 82,
"minCoveredMsi": 89,
"minMsi": 87,
"phpUnit": {
"configDir": "test\/Unit"
},
Expand Down
34 changes: 1 addition & 33 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.11.0@c9b192ab8400fdaf04b2b13d110575adc879aa90">
<files psalm-version="5.13.0@a0a9c27630bcf8301ee78cb06741d2907d8c9fef">
<file src="src/Constructs.php">
<MixedAssignment>
<code>$fileInfo</code>
Expand All @@ -25,38 +25,6 @@
}]]></code>
</TooManyArguments>
</file>
<file src="test/Unit/ConstructsTest.php">
<MixedArgument>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Bar::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Baz::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Foo::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Qux::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Bar::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Baz::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Foo::class</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Qux::class</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Bar::class</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Baz::class</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Foo::class</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Qux::class</code>
<code>Test\Fixture\Classy\Php81\WithinNamespace\Qux::class</code>
</MixedArgument>
<UndefinedClass>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Bar</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Baz</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Foo</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Qux</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Bar</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Baz</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Foo</code>
<code>Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Qux</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Bar</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Baz</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Foo</code>
<code>Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Qux</code>
<code>Test\Fixture\Classy\Php81\WithinNamespace\Qux</code>
</UndefinedClass>
</file>
<file src="test/Util/PhpVersion.php">
<PossiblyUnusedMethod>
<code>toInt</code>
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
__DIR__ . '/test/',
]);

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

$rectorConfig->sets([
PHPUnit\Set\PHPUnitSetList::PHPUNIT_91,
Expand Down
11 changes: 1 addition & 10 deletions src/Constructs.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,11 @@ public static function fromSource(string $source): array

$classyTokens = [
\T_CLASS,
\T_ENUM,
\T_INTERFACE,
\T_TRAIT,
];

// https://wiki.php.net/rfc/enumerations
if (\PHP_VERSION_ID >= 80100 && \defined('T_ENUM')) {
$classyTokens = [
\T_CLASS,
\T_ENUM,
\T_INTERFACE,
\T_TRAIT,
];
}

for ($index = 0; $index < $count; ++$index) {
$token = $sequence[$index];

Expand Down