From 952e06ca839db74384de367a8d03c159b6bbd480 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 11:50:15 +0000 Subject: [PATCH 01/28] initialize branch 7.1 that will support PHP 8.3 --- .github/workflows/gh-pages.yml | 6 ++--- README.md | 26 ++++++++++++++----- composer.json | 2 +- .../Console/Command/AboutCommand.php | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9fd204fb..72f04b86 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -5,7 +5,7 @@ on: push: branches: - master - - "7.0" + - "7.1" paths: - docs/** pull_request: @@ -13,9 +13,9 @@ on: jobs: deploy: - uses: llaville/.github/.github/workflows/gh-pages.yml@uml + uses: llaville/.github/.github/workflows/gh-pages.yml@master with: - destination-dir: "7.0" + destination-dir: "7.1" force-orphan: false hook-script: "resources/gh-pages-hook.sh" php-version: "8.1" diff --git a/README.md b/README.md index 3b735e3a..781abb5f 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ Running on PHP greater or equal than 7.2 for parsing source code in a format PHP ## Versions -| Releases | Branch | PHP | Packagist | License | Documentation | -|:--------------|:-------------------------------------------:|:-------------------------------------------------------------:|:---------------------------------------------------------:|:----------------------------------------------:|:----------------------------------------------------------------:| -| Stable v5.5.x | [![Branch 5.5][Branch_55x-img]][Branch_55x] | [![Minimum PHP Version)][PHPVersion_55x-img]][PHPVersion_55x] | [![Stable Version 5.5][Packagist_55x-img]][Packagist_55x] | [![License 5.5][License_55x-img]][License_55x] | [![Documentation 5.5][Documentation_55x-img]][Documentation_55x] | -| Stable v6.5.x | [![Branch 6.5][Branch_65x-img]][Branch_65x] | [![Minimum PHP Version)][PHPVersion_65x-img]][PHPVersion_65x] | [![Stable Version 6.5][Packagist_65x-img]][Packagist_65x] | [![License 6.5][License_65x-img]][License_65x] | [![Documentation 6.5][Documentation_65x-img]][Documentation_65x] | -| Stable v7.0.x | [![Branch 7.0][Branch_70x-img]][Branch_70x] | [![Minimum PHP Version)][PHPVersion_70x-img]][PHPVersion_70x] | [![Stable Version 7.0][Packagist_70x-img]][Packagist_70x] | [![License 7.0][License_70x-img]][License_70x] | [![Documentation 7.0][Documentation_70x-img]][Documentation_70x] | +| Releases | Branch | PHP | Packagist | License | Documentation | +|:----------------|:-------------------------------------------:|:-------------------------------------------------------------:|:---------------------------------------------------------:|:----------------------------------------------:|:----------------------------------------------------------------:| +| Stable v5.5.x | [![Branch 5.5][Branch_55x-img]][Branch_55x] | [![Minimum PHP Version)][PHPVersion_55x-img]][PHPVersion_55x] | [![Stable Version 5.5][Packagist_55x-img]][Packagist_55x] | [![License 5.5][License_55x-img]][License_55x] | [![Documentation 5.5][Documentation_55x-img]][Documentation_55x] | +| Stable v6.5.x | [![Branch 6.5][Branch_65x-img]][Branch_65x] | [![Minimum PHP Version)][PHPVersion_65x-img]][PHPVersion_65x] | [![Stable Version 6.5][Packagist_65x-img]][Packagist_65x] | [![License 6.5][License_65x-img]][License_65x] | [![Documentation 6.5][Documentation_65x-img]][Documentation_65x] | +| Stable v7.0.x | [![Branch 7.0][Branch_70x-img]][Branch_70x] | [![Minimum PHP Version)][PHPVersion_70x-img]][PHPVersion_70x] | [![Stable Version 7.0][Packagist_70x-img]][Packagist_70x] | [![License 7.0][License_70x-img]][License_70x] | [![Documentation 7.0][Documentation_70x-img]][Documentation_70x] | +| Upcoming v7.1.x | [![Branch 7.1][Branch_71x-img]][Branch_71x] | [![Minimum PHP Version)][PHPVersion_71x-img]][PHPVersion_71x] | [![Stable Version 7.1][Packagist_71x-img]][Packagist_71x] | [![License 7.1][License_71x-img]][License_71x] | [![Documentation 7.1][Documentation_71x-img]][Documentation_71x] | [Branch_55x-img]: https://img.shields.io/badge/branch-5.5-orange [Branch_55x]: https://github.com/llaville/php-compatinfo/tree/5.5 @@ -49,10 +50,21 @@ Running on PHP greater or equal than 7.2 for parsing source code in a format PHP [Documentation_70x-img]: https://img.shields.io/badge/documentation-v7.0-green [Documentation_70x]: https://github.com/llaville/php-compatinfo/tree/7.0/docs +[Branch_71x-img]: https://img.shields.io/badge/branch-7.1-orange +[Branch_71x]: https://github.com/llaville/php-compatinfo/tree/7.1 +[PHPVersion_71x-img]: https://img.shields.io/packagist/php-v/bartlett/php-compatinfo/7.1.0 +[PHPVersion_71x]: https://www.php.net/supported-versions.php +[Packagist_71x-img]: https://img.shields.io/badge/packagist-v7.1.0-blue +[Packagist_71x]: https://packagist.org/packages/bartlett/php-compatinfo +[License_71x-img]: https://img.shields.io/packagist/l/bartlett/php-compatinfo +[License_71x]: https://github.com/llaville/php-compatinfo/blob/7.1/LICENSE +[Documentation_71x-img]: https://img.shields.io/badge/documentation-v7.1-green +[Documentation_71x]: https://github.com/llaville/php-compatinfo/tree/7.1/docs + ## Documentation -All the documentation is available on [website](https://llaville.github.io/php-compatinfo/7.0), -generated from the [docs](https://github.com/llaville/php-compatinfo/tree/7.0/docs) folder. +All the documentation is available on [website](https://llaville.github.io/php-compatinfo/7.1), +generated from the [docs](https://github.com/llaville/php-compatinfo/tree/7.1/docs) folder. ## Contributors diff --git a/composer.json b/composer.json index fb31fc4c..c795fce1 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,7 @@ }, "extra": { "branch-alias": { - "dev-master": "7.0.x-dev" + "dev-master": "7.1.x-dev" }, "bamarni-bin": { "bin-links": true, diff --git a/src/Presentation/Console/Command/AboutCommand.php b/src/Presentation/Console/Command/AboutCommand.php index 560d556d..1394b25b 100644 --- a/src/Presentation/Console/Command/AboutCommand.php +++ b/src/Presentation/Console/Command/AboutCommand.php @@ -45,7 +45,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @var ApplicationInterface $app */ $app = $this->getApplication(); - $defaultVersion = '7.0'; + $defaultVersion = '7.1'; $lines = [ sprintf( From e51a37cdd62c663955c96abecbeb8bd5724b1bed Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 12:40:39 +0000 Subject: [PATCH 02/28] initialize PHP 8.3 support (#366) --- README.md | 2 +- config/set/php83.php | 23 +++++++++++++++++++++++ config/set/up-to-php83.php | 20 ++++++++++++++++++++ docs/README.md | 4 ++-- docs/components/sniffs/README.md | 5 +++++ 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 config/set/php83.php create mode 100644 config/set/up-to-php83.php diff --git a/README.md b/README.md index 781abb5f..7542764c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **PHP CompatInfo** is a library that can find the minimum version and the extensions required for a piece of code to run. -Running on PHP greater or equal than 7.2 for parsing source code in a format PHP 5.2 to PHP 8.2 +Running on PHP greater or equal than 7.2 for parsing source code in a format PHP 5.2 to PHP 8.3 ## Versions diff --git a/config/set/php83.php b/config/set/php83.php new file mode 100644 index 00000000..a0537c84 --- /dev/null +++ b/config/set/php83.php @@ -0,0 +1,23 @@ +services(); + + $services->defaults() + ->autowire() + ; +}; diff --git a/config/set/up-to-php83.php b/config/set/up-to-php83.php new file mode 100644 index 00000000..9ba2f3d4 --- /dev/null +++ b/config/set/up-to-php83.php @@ -0,0 +1,20 @@ +import(__DIR__ . '/up-to-php82.php'); + $containerConfigurator->import(__DIR__ . '/php83.php'); +}; diff --git a/docs/README.md b/docs/README.md index 08ade0d8..67b7479b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,13 +4,13 @@ **PHP CompatInfo** is a library that can find the minimum version and the extensions required for a piece of code to run. -Running on PHP greater or equal than 8.0 for parsing source code in a format PHP 5.2 to PHP 8.2 +Running on PHP greater or equal than 8.0 for parsing source code in a format PHP 5.2 to PHP 8.3 ![Graph Composer](./assets/images/graph-composer.svg) ## Features -- Parse source code in format PHP 5.2 to PHP 8.2 +- Parse source code in format PHP 5.2 to PHP 8.3 - Detect PHP features for each Major/minor versions - Detect versions of all directives, constants, functions, classes, interfaces of 100 extensions and more - Display/Inspect list of extensions, and their versions supported diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index b9008e67..60500e51 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -248,6 +248,11 @@ Here is the list of features supported and their corresponding sniffs : [AllowNullFalseTrueAsStandaloneTypes]: https://wiki.php.net/rfc/true-type [DeprecateDollarBraceStringInterpolation]: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation +## [PHP 8.3](https://www.php.net/manual/en/migration83.php) + +| Sniff category | Sniff class name | PHP Feature | +|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------------| + ## Special cases * **Namespaces** declaration have no sniff, because its detected by the `VersionResolverVisitor` From b837f7656aea1318e7816d0c2a3337e0f4a86bae Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 12:43:56 +0000 Subject: [PATCH 03/28] upgrade Unit Tests workflow to support PHP 8.3 --- .github/workflows/unit-tests.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index ccbe829f..e9ef00a2 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -35,12 +35,17 @@ jobs: os: ubuntu-20.04 php: 8.1 extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:10.4 + tools: phpunit:10.5 - os: ubuntu-20.04 php: 8.2 extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:10.4 + tools: phpunit:10.5 + - + os: ubuntu-22.04 + php: 8.3 + extensions: json,pcre,pdo,phar,spl,mbstring,sqlite + tools: phpunit:10.5 name: Compatibility Info @@ -71,15 +76,14 @@ jobs: - # https://github.com/llaville/php-compatinfo-db name: Build Database run: | - bin/phpcompatinfo db:create --ansi - bin/phpcompatinfo db:init --ansi + bin/phpcompatinfo db:new --ansi - # https://github.com/sebastianbergmann/phpunit/tree/9.6 name: Unit tests with PHPUnit 9 if: | ${{ matrix.php == '8.0' }} run: phpunit --group features,large,reference,regression,default --testdox --do-not-cache-result --configuration ./phpunit-9.xml - - # https://github.com/sebastianbergmann/phpunit/tree/10.4 + - # https://github.com/sebastianbergmann/phpunit/tree/10.5 name: Unit tests with PHPUnit 10 if: | ${{ matrix.php == '8.1' }} || From a7b152608117ddaf5ba81a0f96ea441e75ee12c7 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 12:54:32 +0000 Subject: [PATCH 04/28] add Typed Class Constants support (#366) --- docs/components/README.md | 2 +- docs/components/sniffs/README.md | 7 +- .../Constants/TypedClassConstantSniff.php | 56 +++++++++++++ tests/Sniffs/TypedClassConstantSniffTest.php | 83 +++++++++++++++++++ .../fixtures/sniffs/constants/typed_const.php | 10 +++ 5 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 src/Application/Sniffs/Constants/TypedClassConstantSniff.php create mode 100644 tests/Sniffs/TypedClassConstantSniffTest.php create mode 100644 tests/fixtures/sniffs/constants/typed_const.php diff --git a/docs/components/README.md b/docs/components/README.md index 6864fbe8..f9272a0e 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -26,7 +26,7 @@ They are grouped by categories to solve PHP features (from 4.0 to 8.2) - Arrays (3) - Attributes (3) - Classes (11) -- Constants (4) +- Constants (5) - ControlStructures (4) - Enumerations (1) - Expressions (3) diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index 60500e51..85a87e53 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -250,8 +250,11 @@ Here is the list of features supported and their corresponding sniffs : ## [PHP 8.3](https://www.php.net/manual/en/migration83.php) -| Sniff category | Sniff class name | PHP Feature | -|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------------| +| Sniff category | Sniff class name | PHP Feature | +|----------------|-------------------------|---------------------------------------------| +| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | + +[TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants ## Special cases diff --git a/src/Application/Sniffs/Constants/TypedClassConstantSniff.php b/src/Application/Sniffs/Constants/TypedClassConstantSniff.php new file mode 100644 index 00000000..2fbe5351 --- /dev/null +++ b/src/Application/Sniffs/Constants/TypedClassConstantSniff.php @@ -0,0 +1,56 @@ +type instanceof Node\Identifier) { + $this->updateNodeElementVersion($node, $this->attributeKeyStore, ['php.min' => '8.3.0alpha1']); + $this->updateNodeElementRule($node, $this->attributeKeyStore, self::CA83); + } + return null; + } + + /** + * @inheritDoc + */ + public function getRules(): Generator + { + yield self::CA83 => [ + 'name' => $this->getShortClass(), + 'fullDescription' => "Type hinting class constants has been introduced in PHP 8.3.0", + 'helpUri' => '%baseHelpUri%/01_Components/03_Sniffs/Features/#php-83', + ]; + } +} diff --git a/tests/Sniffs/TypedClassConstantSniffTest.php b/tests/Sniffs/TypedClassConstantSniffTest.php new file mode 100644 index 00000000..696c7ec3 --- /dev/null +++ b/tests/Sniffs/TypedClassConstantSniffTest.php @@ -0,0 +1,83 @@ + [ + 'Test\FOO' => [ + 'php.min' => '8.3.0alpha1', + ], + 'Test\GARPLY' => [ + 'php.min' => '8.3.0alpha1', + ], + 'Test\WALDO' => [ + 'php.min' => '8.3.0alpha1', + ], + ], + ]; + + foreach ($provides as $filename => $versions) { + yield [$filename, $versions]; + } + } + + /** + * Feature test for typed class constants + * + * @link https://github.com/llaville/php-compatinfo/issues/366 + * Typed class constants are detected as PHP 8.3 + * @link https://github.com/php/php-src/commit/414f71a90254cc33896bb3ba953f979f743c198c + * @group features + * @dataProvider typedConstantsProvider + * @return void + * @throws Exception + */ + public function testTypedClassConstants(string $dataSource, array $expectedVersions) + { + $metrics = $this->executeAnalysis($dataSource); + $constants = $metrics[self::$analyserId]['constants']; + + foreach ($expectedVersions as $name => $versions) { + $this->assertArrayHasKey($name, $constants); + foreach ($versions as $key => $value) { + $this->assertEquals($value, $constants[$name][$key]); + } + } + } +} diff --git a/tests/fixtures/sniffs/constants/typed_const.php b/tests/fixtures/sniffs/constants/typed_const.php new file mode 100644 index 00000000..89dd20dc --- /dev/null +++ b/tests/fixtures/sniffs/constants/typed_const.php @@ -0,0 +1,10 @@ + Date: Sun, 31 Dec 2023 13:02:04 +0000 Subject: [PATCH 05/28] add Override attribute support (#366) --- docs/components/README.md | 2 +- docs/components/sniffs/README.md | 2 + .../Attributes/OverrideAttributeSniff.php | 69 +++++++++++++++++++ tests/Sniffs/OverrideAttributeSniffTest.php | 56 +++++++++++++++ tests/fixtures/sniffs/attributes/override.php | 13 ++++ 5 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/Application/Sniffs/Attributes/OverrideAttributeSniff.php create mode 100644 tests/Sniffs/OverrideAttributeSniffTest.php create mode 100644 tests/fixtures/sniffs/attributes/override.php diff --git a/docs/components/README.md b/docs/components/README.md index f9272a0e..733b8ced 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -24,7 +24,7 @@ They are grouped by categories to solve PHP features (from 4.0 to 8.2) - Arrays (3) -- Attributes (3) +- Attributes (4) - Classes (11) - Constants (5) - ControlStructures (4) diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index 85a87e53..233dd48c 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -252,8 +252,10 @@ Here is the list of features supported and their corresponding sniffs : | Sniff category | Sniff class name | PHP Feature | |----------------|-------------------------|---------------------------------------------| +| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | | Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | +[OverrideAttribute]: https://www.php.net/releases/8.3/en.php#override_attribute [TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants ## Special cases diff --git a/src/Application/Sniffs/Attributes/OverrideAttributeSniff.php b/src/Application/Sniffs/Attributes/OverrideAttributeSniff.php new file mode 100644 index 00000000..9ab83c0d --- /dev/null +++ b/src/Application/Sniffs/Attributes/OverrideAttributeSniff.php @@ -0,0 +1,69 @@ + [ + 'name' => $this->getShortClass(), + 'fullDescription' => "Override attribute is available since PHP 8.3.0", + 'helpUri' => '%baseHelpUri%/01_Components/03_Sniffs/Features/#php-83', + ]; + } + + /** + * @inheritDoc + */ + public function enterNode(Node $node) + { + if (!$node instanceof Node\AttributeGroup) { + return null; + } + $found = false; + foreach ($node->attrs as $attr) { + if ($attr->name->toString() == 'Override') { + $found = true; + break; + } + } + if (!$found) { + return null; + } + + if (!$parent = $node->getAttribute($this->attributeParentKeyStore)) { + return null; + } + $this->updateNodeElementVersion($parent, $this->attributeKeyStore, ['php.all' => '8.3.0alpha3']); + $this->updateNodeElementRule($parent, $this->attributeKeyStore, self::CA83); + return null; + } +} diff --git a/tests/Sniffs/OverrideAttributeSniffTest.php b/tests/Sniffs/OverrideAttributeSniffTest.php new file mode 100644 index 00000000..0c1ec93e --- /dev/null +++ b/tests/Sniffs/OverrideAttributeSniffTest.php @@ -0,0 +1,56 @@ +executeAnalysis($dataSource); + $traits = $metrics[self::$analyserId]['traits']; + + $this->assertEquals( + '8.3.0alpha3', // due to native override attribute + $traits['T']['php.all'] + ); + $this->assertEquals( + '7.1.0', // because attribute act as a comment + $traits['T']['php.min'] + ); + } +} diff --git a/tests/fixtures/sniffs/attributes/override.php b/tests/fixtures/sniffs/attributes/override.php new file mode 100644 index 00000000..ac138825 --- /dev/null +++ b/tests/fixtures/sniffs/attributes/override.php @@ -0,0 +1,13 @@ + Date: Sun, 31 Dec 2023 13:12:21 +0000 Subject: [PATCH 06/28] add static variable initializers support (#366) --- docs/components/README.md | 2 +- docs/components/sniffs/README.md | 10 ++-- .../Expressions/StaticVarInitializerSniff.php | 59 +++++++++++++++++++ .../Sniffs/StaticVarInitializerSniffTest.php | 50 ++++++++++++++++ .../expressions/static_var_initializer.php | 9 +++ 5 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 src/Application/Sniffs/Expressions/StaticVarInitializerSniff.php create mode 100644 tests/Sniffs/StaticVarInitializerSniffTest.php create mode 100644 tests/fixtures/sniffs/expressions/static_var_initializer.php diff --git a/docs/components/README.md b/docs/components/README.md index 733b8ced..1eeb4c9f 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -29,7 +29,7 @@ They are grouped by categories to solve PHP features (from 4.0 to 8.2) - Constants (5) - ControlStructures (4) - Enumerations (1) -- Expressions (3) +- Expressions (4) - Fibers (1) - FunctionCalls (1) - FunctionDeclarations (7) diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index 233dd48c..277700d3 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -250,12 +250,14 @@ Here is the list of features supported and their corresponding sniffs : ## [PHP 8.3](https://www.php.net/manual/en/migration83.php) -| Sniff category | Sniff class name | PHP Feature | -|----------------|-------------------------|---------------------------------------------| -| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | -| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | +| Sniff category | Sniff class name | PHP Feature | +|----------------|---------------------------|------------------------------------------------------| +| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | +| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | +| Expressions | StaticVarInitializerSniff | [Static Variable initializers][StaticVarInitializer] | [OverrideAttribute]: https://www.php.net/releases/8.3/en.php#override_attribute +[StaticVarInitializer]: https://www.php.net/manual/en/migration83.new-features.php#migration83.new-features.core.static-variable-initializers [TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants ## Special cases diff --git a/src/Application/Sniffs/Expressions/StaticVarInitializerSniff.php b/src/Application/Sniffs/Expressions/StaticVarInitializerSniff.php new file mode 100644 index 00000000..6403ef46 --- /dev/null +++ b/src/Application/Sniffs/Expressions/StaticVarInitializerSniff.php @@ -0,0 +1,59 @@ + [ + 'name' => $this->getShortClass(), + 'fullDescription' => "Static variable initializers syntax is available since PHP 8.3.0", + 'helpUri' => '%baseHelpUri%/01_Components/03_Sniffs/Features/#php-83', + ]; + } + + /** + * @inheritDoc + */ + public function enterNode(Node $node) + { + if (!$node instanceof Node\Stmt\StaticVar) { + return null; + } + + if ($node->default instanceof Node\Expr\CallLike && !$node->default instanceof Node\Expr\New_) { + if (!$parent = $node->getAttribute($this->attributeParentKeyStore)) { + return null; + } + $this->updateNodeElementVersion($parent, $this->attributeKeyStore, ['php.min' => '8.3.0alpha1']); + $this->updateNodeElementRule($parent, $this->attributeKeyStore, self::CA83); + } + return null; + } +} diff --git a/tests/Sniffs/StaticVarInitializerSniffTest.php b/tests/Sniffs/StaticVarInitializerSniffTest.php new file mode 100644 index 00000000..f95051d4 --- /dev/null +++ b/tests/Sniffs/StaticVarInitializerSniffTest.php @@ -0,0 +1,50 @@ +executeAnalysis($dataSource); + $functions = $metrics[self::$analyserId]['functions']; + + $this->assertEquals( + '8.3.0alpha1', + $functions['foo']['php.min'] + ); + } +} diff --git a/tests/fixtures/sniffs/expressions/static_var_initializer.php b/tests/fixtures/sniffs/expressions/static_var_initializer.php new file mode 100644 index 00000000..9931216a --- /dev/null +++ b/tests/fixtures/sniffs/expressions/static_var_initializer.php @@ -0,0 +1,9 @@ + Date: Sun, 31 Dec 2023 13:14:11 +0000 Subject: [PATCH 07/28] upgrade php constraint to support PHP 8.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c795fce1..c6eddd3a 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "issues": "https://github.com/llaville/php-compatinfo/issues" }, "require": { - "php": "~8.0 || ~8.1 || ~8.2", + "php": "~8.0 || ~8.1 || ~8.2 || ~8.3", "ext-json": "*", "ext-pcre": "*", "ext-spl": "*", From 46f03fac23b73baaadfa346fc81f65e527f568b8 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 13:28:15 +0000 Subject: [PATCH 08/28] add dynamic class constant fetch support (#366) --- docs/components/README.md | 2 +- docs/components/sniffs/README.md | 14 +++-- .../DynamicClassConstantFetchSniff.php | 61 +++++++++++++++++++ .../DynamicClassConstantFetchSniffTest.php | 57 +++++++++++++++++ .../constants/dynamic_class_const_fetch.php | 14 +++++ 5 files changed, 141 insertions(+), 7 deletions(-) create mode 100644 src/Application/Sniffs/Constants/DynamicClassConstantFetchSniff.php create mode 100644 tests/Sniffs/DynamicClassConstantFetchSniffTest.php create mode 100644 tests/fixtures/sniffs/constants/dynamic_class_const_fetch.php diff --git a/docs/components/README.md b/docs/components/README.md index 1eeb4c9f..07b876a6 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -26,7 +26,7 @@ They are grouped by categories to solve PHP features (from 4.0 to 8.2) - Arrays (3) - Attributes (4) - Classes (11) -- Constants (5) +- Constants (6) - ControlStructures (4) - Enumerations (1) - Expressions (4) diff --git a/docs/components/sniffs/README.md b/docs/components/sniffs/README.md index 277700d3..9a404b35 100644 --- a/docs/components/sniffs/README.md +++ b/docs/components/sniffs/README.md @@ -250,12 +250,14 @@ Here is the list of features supported and their corresponding sniffs : ## [PHP 8.3](https://www.php.net/manual/en/migration83.php) -| Sniff category | Sniff class name | PHP Feature | -|----------------|---------------------------|------------------------------------------------------| -| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | -| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | -| Expressions | StaticVarInitializerSniff | [Static Variable initializers][StaticVarInitializer] | - +| Sniff category | Sniff class name | PHP Feature | +|----------------|--------------------------------|------------------------------------------------------------------| +| Attributes | OverrideAttributeSniff | [Override attribute][OverrideAttribute] | +| Constants | DynamicClassConstantFetchSniff | [Dynamic Class Constant fetch syntax][DynamicClassConstantFetch] | +| Constants | TypedClassConstantSniff | [Typed Class Constants][TypedClassConstant] | +| Expressions | StaticVarInitializerSniff | [Static Variable initializers][StaticVarInitializer] | + +[DynamicClassConstantFetch]: https://www.php.net/releases/8.3/en.php#dynamic_class_constant_fetch [OverrideAttribute]: https://www.php.net/releases/8.3/en.php#override_attribute [StaticVarInitializer]: https://www.php.net/manual/en/migration83.new-features.php#migration83.new-features.core.static-variable-initializers [TypedClassConstant]: https://www.php.net/releases/8.3/en.php#typed_class_constants diff --git a/src/Application/Sniffs/Constants/DynamicClassConstantFetchSniff.php b/src/Application/Sniffs/Constants/DynamicClassConstantFetchSniff.php new file mode 100644 index 00000000..833092ce --- /dev/null +++ b/src/Application/Sniffs/Constants/DynamicClassConstantFetchSniff.php @@ -0,0 +1,61 @@ + [ + 'name' => $this->getShortClass(), + 'fullDescription' => "Dynamic class constant fetch syntax is available since PHP 8.3.0", + 'helpUri' => '%baseHelpUri%/01_Components/03_Sniffs/Features/#php-83', + ]; + } + + /** + * @inheritDoc + */ + public function enterNode(Node $node) + { + if (!$node instanceof Node\Expr\ClassConstFetch) { + return null; + } + + if ($node->name instanceof Node\Expr\Variable) { + if (!$parent = $node->getAttribute($this->attributeParentKeyStore)) { + return null; + } + $this->updateNodeElementVersion($parent, $this->attributeKeyStore, ['php.min' => '8.3.0alpha1']); + $this->updateNodeElementRule($parent, $this->attributeKeyStore, self::CA83); + } + return null; + } +} diff --git a/tests/Sniffs/DynamicClassConstantFetchSniffTest.php b/tests/Sniffs/DynamicClassConstantFetchSniffTest.php new file mode 100644 index 00000000..ff3821a0 --- /dev/null +++ b/tests/Sniffs/DynamicClassConstantFetchSniffTest.php @@ -0,0 +1,57 @@ +executeAnalysis($dataSource); + $versions = $metrics[self::$analyserId]['versions']; + + $this->assertEquals( + '8.3.0alpha1', + $versions['php.min'] + ); + + $this->assertEquals( + '', + $versions['php.max'] + ); + } +} diff --git a/tests/fixtures/sniffs/constants/dynamic_class_const_fetch.php b/tests/fixtures/sniffs/constants/dynamic_class_const_fetch.php new file mode 100644 index 00000000..d02ef6bf --- /dev/null +++ b/tests/fixtures/sniffs/constants/dynamic_class_const_fetch.php @@ -0,0 +1,14 @@ + Date: Sun, 31 Dec 2023 13:43:00 +0000 Subject: [PATCH 09/28] update php83 config set for new sniffs --- config/set/php83.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/set/php83.php b/config/set/php83.php index a0537c84..17cb9d4e 100644 --- a/config/set/php83.php +++ b/config/set/php83.php @@ -6,6 +6,11 @@ * file that was distributed with this source code. */ +use Bartlett\CompatInfo\Application\Sniffs\Attributes\OverrideAttributeSniff; +use Bartlett\CompatInfo\Application\Sniffs\Constants\DynamicClassConstantFetchSniff; +use Bartlett\CompatInfo\Application\Sniffs\Constants\TypedClassConstantSniff; +use Bartlett\CompatInfo\Application\Sniffs\Expressions\StaticVarInitializerSniff; + use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; /** @@ -20,4 +25,9 @@ $services->defaults() ->autowire() ; + + $services->set(OverrideAttributeSniff::class); + $services->set(DynamicClassConstantFetchSniff::class); + $services->set(TypedClassConstantSniff::class); + $services->set(StaticVarInitializerSniff::class); }; From 91dead150508ad98ec68afe454738b2f2760a822 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 13:45:31 +0000 Subject: [PATCH 10/28] upgrade PHPUnit schema to 10.5 --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c0bfa0cd..3ab75039 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ Date: Sun, 31 Dec 2023 14:10:29 +0000 Subject: [PATCH 11/28] upgrade resources to draw UML graph for Sniffs about PHP 8.3 --- resources/application-sniffs/datasource.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/application-sniffs/datasource.php b/resources/application-sniffs/datasource.php index bb283d2f..982f274f 100644 --- a/resources/application-sniffs/datasource.php +++ b/resources/application-sniffs/datasource.php @@ -15,6 +15,8 @@ \Bartlett\CompatInfo\Application\Sniffs\Arrays\ArrayDereferencingSyntaxSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Arrays\ShortArraySyntaxSniff::class, + \Bartlett\CompatInfo\Application\Sniffs\Attributes\OverrideAttributeSniff::class, + \Bartlett\CompatInfo\Application\Sniffs\Classes\AnonymousClassSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Classes\ClassMemberAccessSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Classes\MagicMethodsSniff::class, @@ -24,7 +26,9 @@ \Bartlett\CompatInfo\Application\Sniffs\Constants\ClassConstantSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Constants\ConstSyntaxSniff::class, + \Bartlett\CompatInfo\Application\Sniffs\Constants\DynamicClassConstantFetchSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Constants\MagicClassConstantSniff::class, + \Bartlett\CompatInfo\Application\Sniffs\Constants\TypedClassConstantSniff::class, \Bartlett\CompatInfo\Application\Sniffs\ControlStructures\DeclareSniff::class, \Bartlett\CompatInfo\Application\Sniffs\ControlStructures\GotoSniff::class, @@ -32,6 +36,7 @@ \Bartlett\CompatInfo\Application\Sniffs\Expressions\ClassExprSyntaxSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Expressions\ConditionalCodeSniff::class, \Bartlett\CompatInfo\Application\Sniffs\Expressions\EmptySniff::class, + \Bartlett\CompatInfo\Application\Sniffs\Expressions\StaticVarInitializerSniff::class, \Bartlett\CompatInfo\Application\Sniffs\FunctionCalls\SameSiteCookieSniff::class, From 7f974b36728a5414e6bec739077ba5a2cc1d5463 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 14:27:55 +0000 Subject: [PATCH 12/28] upgrade documentation --- docs/components/README.md | 2 +- mkdocs.yml | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/components/README.md b/docs/components/README.md index 07b876a6..1a3c29a5 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -21,7 +21,7 @@ ### [Sniffs](./sniffs/README.md) -They are grouped by categories to solve PHP features (from 4.0 to 8.2) +They are grouped by categories to solve PHP features (from 4.0 to 8.3) - Arrays (3) - Attributes (4) diff --git a/mkdocs.yml b/mkdocs.yml index 085737ba..577d9c90 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,20 +29,8 @@ markdown_extensions: nav: - "Home": README.md - "Getting-Started": installation.md - - "Components": - - "PHP Parser": - - "Visitors": components/parser/README.md - - "Profiler": - - "Data Collectors": components/profiler/README.md - - "Sniffs": components/sniffs/README.md - - "Extensions": components/extensions/README.md - - "Output format": components/extensions/reporter.md - - "Polyfills": components/polyfills/README.md + - "Components": components/README.md - "Configurations": configs/README.md - - "Conditional Code": - - "Introduction": conditional-code/introduction.md - - "Indirect Call": conditional-code/indirect-call.md - - "Multiple Signature": conditional-code/multiple-signature.md - - "Some Limitation": conditional-code/limitation.md + - "Conditional Code": conditional-code/README.md - "Exclusions": exclusions/README.md - "Architecture": architecture/README.md From cfefb9f46d5b6ff978e766359c6571ddfe3b9453 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 14:32:16 +0000 Subject: [PATCH 13/28] fixed markdownlint errors related to title levels --- docs/components/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/components/README.md b/docs/components/README.md index 1a3c29a5..0ee24a7d 100644 --- a/docs/components/README.md +++ b/docs/components/README.md @@ -1,25 +1,25 @@ -## Components +# Components - Parsing PHP 5, PHP 7 or PHP 8 code into an abstract syntax tree (AST) is provided by the [PHP-Parser](https://github.com/nikic/PHP-Parser) library. - Contextual elements and minimum PHP versions detection provided by following node visitors. -### PHP-Parser [Node Visitors](./parser/README.md) +## PHP-Parser [Node Visitors](./parser/README.md) - Parent references with the `ParentContextVisitor` - Name Resolution with the `NameResolverVisitor` - Version Resolution with the `VersionResolverVisitor` -### [Profiler](./profiler/README.md) +## [Profiler](./profiler/README.md) - Data Collector(s) with common `DataCollector` and specialized `VersionDataCollector` classes - Data Collector(s) contract with the `CollectorInterface` - Collector Handler for both Profile and Profiler with `CollectorTrait` - Profile information for a single data source with `Profile` -### [Sniffs](./sniffs/README.md) +## [Sniffs](./sniffs/README.md) They are grouped by categories to solve PHP features (from 4.0 to 8.3) @@ -40,7 +40,7 @@ They are grouped by categories to solve PHP features (from 4.0 to 8.3) - TextProcessing (2) - UseDeclarations (2) -### [Extensions](./extensions/README.md) +## [Extensions](./extensions/README.md) PHPCompatInfo can be extended by registering objects that implement one or more of the following interfaces: @@ -59,7 +59,7 @@ PHPCompatInfo can be extended by registering objects that implement one or more Furthermore, extensions may implement the `Symfony\Component\EventDispatcher\EventSubscriberInterface` in order to have its event handlers automatically registered with the EventDispatcher when the extension is loaded. -### [Polyfills](./polyfills/README.md) +## [Polyfills](./polyfills/README.md) They are identified by services that implements the `Bartlett\CompatInfo\Application\Polyfills\PolyfillInterface`. From dbfb81ac9161b97bf582d69dc51d55c3b20deb10 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 14:50:59 +0000 Subject: [PATCH 14/28] upgrade Release workflow by using standard BOX tool to build PHAR version --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1df2c4dc..5ebdf2c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,9 @@ jobs: os: - ubuntu-22.04 php: - - 8.1 + - 8.2 + tools: + - box:4.6 # available since https://github.com/shivammathur/setup-php/releases/tag/2.27.0 steps: - # https://github.com/actions/checkout @@ -37,6 +39,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} + coverage: "none" + tools: ${{ matrix.tools }} - # https://github.com/ramsey/composer-install name: Install Composer dependencies @@ -56,7 +60,7 @@ jobs: box-manifest manifest:build --ansi -vv -c box.json --output-file=sbom.json box-manifest manifest:build --ansi -vv -c box.json --output-file=console.txt --format console box-manifest manifest:stub --ansi -vv -c box.json --output-file=stub.php --resource console.txt --resource sbom.json - box-manifest box:compile --ansi -vv -c box.json.dist + box compile --ansi -vv -c box.json.dist - # https://github.com/softprops/action-gh-release name: Create Release from current tag @@ -64,7 +68,7 @@ jobs: uses: softprops/action-gh-release@v1 with: # https://github.com/softprops/action-gh-release#-customizing prerelease: false - draft: true + draft: false body_path: ${{ github.workspace }}/.changes/7.x/${{ github.ref_name }}.md # https://github.com/softprops/action-gh-release#%EF%B8%8F-uploading-release-assets files: | From 323fd1f3606f22cf6517bacd08d62dd7e5cedcec Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 15:22:15 +0000 Subject: [PATCH 15/28] upgrade documentation : getting-started guide --- docs/README.md | 6 +++++ docs/usage/README.md | 5 ++++ docs/usage/console.md | 44 ++++++++++++++++++++++++++++++++++ docs/usage/docker.md | 20 ++++++++++++++++ docs/usage/programmatically.md | 4 ++++ 5 files changed, 79 insertions(+) create mode 100644 docs/usage/README.md create mode 100644 docs/usage/console.md create mode 100644 docs/usage/docker.md create mode 100644 docs/usage/programmatically.md diff --git a/docs/README.md b/docs/README.md index 67b7479b..c5003226 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,6 +15,12 @@ Running on PHP greater or equal than 8.0 for parsing source code in a format PHP - Detect versions of all directives, constants, functions, classes, interfaces of 100 extensions and more - Display/Inspect list of extensions, and their versions supported +## Usage + +> Learn more about different usages with console, Docker and programmatically. + +See [Getting-Started's Guide](usage/README.md) to know how to use it. + ## Installation > Learn how to install `CompatInfo` application in different way. diff --git a/docs/usage/README.md b/docs/usage/README.md new file mode 100644 index 00000000..9ce2db09 --- /dev/null +++ b/docs/usage/README.md @@ -0,0 +1,5 @@ +# Usage + +1. [Console CLI](console.md) +2. [Docker CLI](docker.md) +3. [Programmatically](programmatically.md) diff --git a/docs/usage/console.md b/docs/usage/console.md new file mode 100644 index 00000000..7a635d4a --- /dev/null +++ b/docs/usage/console.md @@ -0,0 +1,44 @@ + +# Console CLI + +> **WARNING** Depending on your PHP version, with 8.0 you won't have usage of the most up-to-date Database version of `CompatInfoDB` +> +> With PHP 8.1 or greater `CompatInfoDB` 6.1+ is supported, +> adding the `db:new` command that combine `db:create` and `db:init` actions. + +```text +phpCompatInfo version 7.1.0 DB version 5.14.1 + +Usage: + command [options] [arguments] + +Options: + -h, --help Display help for the given command. When no command is given display help for the list command + -q, --quiet Do not output any message + -V, --version Display this application version + --ansi|--no-ansi Force (or disable --no-ansi) ANSI output + -n, --no-interaction Do not ask any interactive question + --profile Display timing and memory usage information + --progress Show progress bar + --output=OUTPUT Affect output to produce results in different format [default: ["console"]] (multiple values allowed) + --debug Display debugging information + -c, --config=CONFIG Read configuration from PHP file + --php=PHP PHP feature version (format Major.Minor) + -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug + +Available commands: + about Shows short information about this package + completion Dump the shell completion script + diagnose Diagnoses the system to identify common errors + help Display help for a command + list List commands + analyser + analyser:run Analyse a data source to find out requirements + db + db:create Create the database schema and load its contents from JSON files + db:init Load JSON file(s) into database + db:list List all references supported in the Database + db:show Show details of a reference supported in the Database + rule + rule:list Display list of Compatibility Analyser rules supported +``` diff --git a/docs/usage/docker.md b/docs/usage/docker.md new file mode 100644 index 00000000..5b47ecec --- /dev/null +++ b/docs/usage/docker.md @@ -0,0 +1,20 @@ + +# Docker CLI + +**IMPORTANT** : Docker image with `latest` tag use the PHP 8.1 runtime ! + +> Please mount your system temporary folder to `/home/appuser/.cache/bartlett` in the container. +> +> **NOTE**: On most Linux distribution, it should be `/tmp` +> +> Don't forget to also mount your source code to `/app` folder (i.e) in the container and make it as the current working directory + +```shell +docker run --rm -it -u "$(id -u):$(id -g)" \ + -v /tmp:/home/appuser/.cache/bartlett \ + -v ${PWD}:/app \ + -w /app \ + ghcr.io/llaville/php-compatinfo:latest +``` + +Then you can run any commands supported by application : `db:*`, `diagnose`, `about`, `analyser:run`, `rule:list` diff --git a/docs/usage/programmatically.md b/docs/usage/programmatically.md new file mode 100644 index 00000000..f1fe405d --- /dev/null +++ b/docs/usage/programmatically.md @@ -0,0 +1,4 @@ + +# Programmatically + +Repository contains an `examples` directory that have a good first to follow. From b52529854deef993db9c05444e768aa295cd4d58 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Sun, 31 Dec 2023 15:22:56 +0000 Subject: [PATCH 16/28] introduces the Dockerfile to build Docker image --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ entrypoint.sh | 13 +++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..aa896935 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# syntax=docker/dockerfile:1.4 +ARG PHP_VERSION=8.1 + +FROM php:${PHP_VERSION}-cli-alpine + +# https://github.com/opencontainers/image-spec/blob/main/annotations.md + +LABEL org.opencontainers.image.title="llaville/php-compatinfo" +LABEL org.opencontainers.image.description="Docker image of bartlett/php-compatinfo Composer package" +LABEL org.opencontainers.image.source="https://github.com/llaville/php-compatinfo" +LABEL org.opencontainers.image.licenses="MIT" +LABEL org.opencontainers.image.authors="llaville" + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh \ + && cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini + +# Create a group and user +RUN addgroup appgroup && adduser appuser -D -G appgroup + +# Tell docker that all future commands should run as the appuser user +USER appuser + +# Install Composer v2 binary version +COPY --from=composer/composer:2-bin /composer /usr/bin/composer +ENV COMPOSER_ALLOW_SUPERUSER 1 +ENV COMPOSER_PREFER_STABLE 1 +#RUN composer global require --no-progress bartlett/php-compatinfo ^7.1 +RUN composer global require --no-progress bartlett/php-compatinfo 7.1.x-dev + +# Following recommendation at https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..532a8b6a --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +[ "$APP_DEBUG" == 'true' ] && set -x +set -e + +if [ "$APP_DEBUG" == 'true' ] +then + echo "> You will act as user: $(id -u -n)" + echo "$(composer config --global --list)" + /bin/sh -c "ls -l $(composer config --global home)" +fi + +php -d memory_limit=512M "$(composer config --global home)/vendor/bin/phpcompatinfo" $@ From d515713094d2988f7f053b3cd38f5453d5148bc1 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 06:42:12 +0000 Subject: [PATCH 17/28] bump new year 2024 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 3094565b..3a61c175 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ - Copyright (c) 2010-2023, Laurent Laville + Copyright (c) 2010-2024, Laurent Laville Credits to : From 64690f7f9c63ddf2ff736dd3a436d0961c98948f Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 06:46:02 +0000 Subject: [PATCH 18/28] update Dockerfile for final release 7.1.0 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa896935..63c8ed74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,8 @@ USER appuser COPY --from=composer/composer:2-bin /composer /usr/bin/composer ENV COMPOSER_ALLOW_SUPERUSER 1 ENV COMPOSER_PREFER_STABLE 1 -#RUN composer global require --no-progress bartlett/php-compatinfo ^7.1 -RUN composer global require --no-progress bartlett/php-compatinfo 7.1.x-dev +RUN composer global require --no-progress bartlett/php-compatinfo ^7.1 +#RUN composer global require --no-progress bartlett/php-compatinfo 7.1.x-dev # Following recommendation at https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir From bb2917558f507b34da89e4830fa41fef9da6e01a Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 07:34:45 +0000 Subject: [PATCH 19/28] Add compatibility with Symfony Components v7 --- composer.json | 16 ++++++++-------- docs/exclusions/README.md | 2 +- examples/api_analyser_run.php | 2 +- .../Normalizer/NodeNormalizer.php | 18 +++++++++++++++--- src/Presentation/Console/Application.php | 10 +++++++--- .../Console/ApplicationInterface.php | 10 +++++----- .../Console/Command/AnalyserCommand.php | 2 +- 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index c6eddd3a..bbc89e5f 100644 --- a/composer.json +++ b/composer.json @@ -21,16 +21,16 @@ "nikic/php-parser": "^4.10", "psr/log": "^3.0", "ramsey/uuid": "^3.9 || ^4.0", - "symfony/config": "^5.4 || ^6.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/dependency-injection": "^5.4 || ^6.0", - "symfony/serializer": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/serializer": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "symfony/framework-bundle": "^5.4 || ^6.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", "bamarni/composer-bin-plugin": "^1.8" }, "authors": [ diff --git a/docs/exclusions/README.md b/docs/exclusions/README.md index b48eb229..9f7904c5 100644 --- a/docs/exclusions/README.md +++ b/docs/exclusions/README.md @@ -40,7 +40,7 @@ try { $dump = reset($data); var_export($dump); } catch (HandlerFailedException $e) { - foreach ($e->getNestedExceptions() as $ex) { + foreach ($e->getWrappedExceptions() as $ex) { printf('Exception -- %s >> %s%s' . $ex->getMessage(), $ex->getTraceAsString(), PHP_EOL); }; } diff --git a/examples/api_analyser_run.php b/examples/api_analyser_run.php index 1037d414..e337ee22 100644 --- a/examples/api_analyser_run.php +++ b/examples/api_analyser_run.php @@ -42,7 +42,7 @@ $dump = reset($data); var_export($dump); } catch (HandlerFailedException $e) { - foreach ($e->getNestedExceptions() as $ex) { + foreach ($e->getWrappedExceptions() as $ex) { printf('Exception -- %s%s%s%s', $ex->getMessage(), PHP_EOL, $ex->getTraceAsString(), PHP_EOL); }; } diff --git a/src/Application/DataCollector/Normalizer/NodeNormalizer.php b/src/Application/DataCollector/Normalizer/NodeNormalizer.php index d1fcd424..68c046ae 100644 --- a/src/Application/DataCollector/Normalizer/NodeNormalizer.php +++ b/src/Application/DataCollector/Normalizer/NodeNormalizer.php @@ -15,6 +15,8 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +use ArrayObject; + /** * @author Laurent Laville * @since Release 5.4.0 @@ -27,9 +29,8 @@ final class NodeNormalizer implements NormalizerInterface /** * {@inheritDoc} * @param array $context - * @return null|array */ - public function normalize($object, $format = null, array $context = []) + public function normalize($object, $format = null, array $context = []): float|array|ArrayObject|bool|int|string|null { $node = $object; $this->attributeNamespacedName = $context['nodeAttributeNamespacedName'] ?? 'bartlett.name'; @@ -74,8 +75,11 @@ public function normalize($object, $format = null, array $context = []) /** * {@inheritDoc} + * @param mixed $data + * @param string|null $format + * @param array $context */ - public function supportsNormalization($data, $format = null) + public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool { if ($data instanceof Node\Expr\New_) { $this->name = $data->class instanceof Node\Stmt\Class_ ? 'class' : (string) $data->class; @@ -155,6 +159,14 @@ public function supportsNormalization($data, $format = null) return true; } + /** + * @link https://symfony.com/blog/new-in-symfony-6-3-performance-improvements#improved-performance-of-serializer-normalizers-denormalizers + */ + public function getSupportedTypes(?string $format): array + { + return []; + } + private function getType(Node $node): string { if ($this->isConstantDefineExpression($node)) { diff --git a/src/Presentation/Console/Application.php b/src/Presentation/Console/Application.php index fa94aa0b..75942291 100644 --- a/src/Presentation/Console/Application.php +++ b/src/Presentation/Console/Application.php @@ -7,7 +7,6 @@ */ namespace Bartlett\CompatInfo\Presentation\Console; -use Bartlett\CompatInfo\Presentation\Console\Command\AbstractCommand; use Bartlett\CompatInfoDb\Infrastructure\Framework\Composer\InstalledVersions; use Symfony\Component\Console\Application as SymfonyApplication; @@ -18,7 +17,7 @@ use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Phar; @@ -32,7 +31,12 @@ */ class Application extends SymfonyApplication implements ApplicationInterface { - use ContainerAwareTrait; + protected ?ContainerInterface $container; + + public function setContainer(ContainerInterface $container = null): void + { + $this->container = $container; + } /** * @var string diff --git a/src/Presentation/Console/ApplicationInterface.php b/src/Presentation/Console/ApplicationInterface.php index ec986b42..65283534 100644 --- a/src/Presentation/Console/ApplicationInterface.php +++ b/src/Presentation/Console/ApplicationInterface.php @@ -8,7 +8,7 @@ namespace Bartlett\CompatInfo\Presentation\Console; use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Console Application contract. @@ -16,10 +16,12 @@ * @since Release 6.0.0 * @author Laurent Laville */ -interface ApplicationInterface extends ContainerAwareInterface +interface ApplicationInterface { public const NAME = 'phpCompatInfo'; + public function setContainer(ContainerInterface $container = null): void; + /** * @return void */ @@ -27,10 +29,8 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader); /** * Gets the name of the application. - * - * @return string */ - public function getName(); + public function getName(): string; public function getInstalledVersion(bool $withRef = true, string $packageName = 'bartlett/php-compatinfo'): ?string; diff --git a/src/Presentation/Console/Command/AnalyserCommand.php b/src/Presentation/Console/Command/AnalyserCommand.php index 50eae514..755f07e7 100644 --- a/src/Presentation/Console/Command/AnalyserCommand.php +++ b/src/Presentation/Console/Command/AnalyserCommand.php @@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->queryBus->query($compatibilityQuery); } catch (HandlerFailedException $e) { $exceptions = []; - foreach ($e->getNestedExceptions() as $exception) { + foreach ($e->getWrappedExceptions() as $exception) { $exceptions[] = $exception->getMessage() . sprintf(' from file "%s" at line %d', $exception->getFile(), $exception->getLine()); } From 19e30f878ba7eeeb32ee36381180f0f4f55dacd8 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 07:46:24 +0000 Subject: [PATCH 20/28] fixed PHPStan linter errors --- .github/linters/phpstan.neon.dist | 1 + src/Application/DataCollector/Normalizer/NodeNormalizer.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/linters/phpstan.neon.dist b/.github/linters/phpstan.neon.dist index c143cbc7..02689cc1 100644 --- a/.github/linters/phpstan.neon.dist +++ b/.github/linters/phpstan.neon.dist @@ -5,6 +5,7 @@ parameters: excludePaths: - ../../src/Infrastructure/ManifestBuilder.php treatPhpDocTypesAsCertain: false + checkGenericClassInNonGenericObjectType: false ignoreErrors: - message: "#^Method Bartlett\\\\CompatInfo\\\\Application\\\\Analyser\\\\CompatibilityAnalyser\\:\\:leave[a-zA-Z0-9\\_]+\\(\\) is unused\\.$#" diff --git a/src/Application/DataCollector/Normalizer/NodeNormalizer.php b/src/Application/DataCollector/Normalizer/NodeNormalizer.php index 68c046ae..00d3f66c 100644 --- a/src/Application/DataCollector/Normalizer/NodeNormalizer.php +++ b/src/Application/DataCollector/Normalizer/NodeNormalizer.php @@ -29,6 +29,7 @@ final class NodeNormalizer implements NormalizerInterface /** * {@inheritDoc} * @param array $context + * @return float|array|ArrayObject|bool|int|string|null */ public function normalize($object, $format = null, array $context = []): float|array|ArrayObject|bool|int|string|null { @@ -75,9 +76,7 @@ public function normalize($object, $format = null, array $context = []): float|a /** * {@inheritDoc} - * @param mixed $data - * @param string|null $format - * @param array $context + * @phpstan-ignore-next-line */ public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool { From a4f6062cbd39d19278a7b97788b66f1272480abc Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 07:54:02 +0000 Subject: [PATCH 21/28] upgrade Unit Tests workflow (MegaLinter default PHP version is now 8.1) --- .github/workflows/unit-tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index e9ef00a2..20862d74 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -15,7 +15,6 @@ jobs: uses: llaville/.github/.github/workflows/mega-linter.yml@master with: repository: ${{ github.repository }} - php-version: "8.0" unit_tests: needs: lint_files From 5616aafcd644564b94eba8b508e62497a7711887 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 08:13:53 +0000 Subject: [PATCH 22/28] fix missing one PHPStan linter error --- src/Application/DataCollector/Normalizer/NodeNormalizer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Application/DataCollector/Normalizer/NodeNormalizer.php b/src/Application/DataCollector/Normalizer/NodeNormalizer.php index 00d3f66c..5f6749f7 100644 --- a/src/Application/DataCollector/Normalizer/NodeNormalizer.php +++ b/src/Application/DataCollector/Normalizer/NodeNormalizer.php @@ -160,6 +160,7 @@ public function supportsNormalization(mixed $data, string $format = null, array /** * @link https://symfony.com/blog/new-in-symfony-6-3-performance-improvements#improved-performance-of-serializer-normalizers-denormalizers + * @return array */ public function getSupportedTypes(?string $format): array { From ca5ecfad153e6abe911928850dc0d38323eddb4d Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 08:21:30 +0000 Subject: [PATCH 23/28] upgrade Unit Tests workflow to keep compatibility with PHP 8.0 and CompatInfoDB v5, and run PHPUnit with PHP 8.3 --- .github/workflows/unit-tests.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 20862d74..f4182092 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -74,6 +74,18 @@ jobs: - # https://github.com/llaville/php-compatinfo-db name: Build Database + if: | + ${{ matrix.php == '8.0' }} + run: | + bin/phpcompatinfo db:create --ansi + bin/phpcompatinfo db:init --ansi + + - # https://github.com/llaville/php-compatinfo-db + name: Build Database + if: | + ${{ matrix.php == '8.1' }} || + ${{ matrix.php == '8.2' }} || + ${{ matrix.php == '8.3' }} run: | bin/phpcompatinfo db:new --ansi @@ -86,5 +98,6 @@ jobs: name: Unit tests with PHPUnit 10 if: | ${{ matrix.php == '8.1' }} || - ${{ matrix.php == '8.2' }} + ${{ matrix.php == '8.2' }} || + ${{ matrix.php == '8.3' }} run: phpunit --group features,large,reference,regression,default --testdox --do-not-cache-result From 40bbc59d4c5aaf5be8314c290420825e68a7d9e3 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 08:31:01 +0000 Subject: [PATCH 24/28] upgrade Unit Tests workflow --- .github/workflows/unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index f4182092..a5134a51 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -46,7 +46,7 @@ jobs: extensions: json,pcre,pdo,phar,spl,mbstring,sqlite tools: phpunit:10.5 - name: Compatibility Info + name: Unit Tests env: APP_ENV: dev # see explains at https://github.com/llaville/php-compatinfo-db/issues/101 From cb0eed7e2152ee206452a29310618c1dca5d06bf Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 09:01:56 +0000 Subject: [PATCH 25/28] simplify CompatInfoDB step for all PHP versions --- .github/workflows/unit-tests.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index a5134a51..f5850efa 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -74,21 +74,10 @@ jobs: - # https://github.com/llaville/php-compatinfo-db name: Build Database - if: | - ${{ matrix.php == '8.0' }} run: | bin/phpcompatinfo db:create --ansi bin/phpcompatinfo db:init --ansi - - # https://github.com/llaville/php-compatinfo-db - name: Build Database - if: | - ${{ matrix.php == '8.1' }} || - ${{ matrix.php == '8.2' }} || - ${{ matrix.php == '8.3' }} - run: | - bin/phpcompatinfo db:new --ansi - - # https://github.com/sebastianbergmann/phpunit/tree/9.6 name: Unit tests with PHPUnit 9 if: | From 99aeb8d67634b1ea634cb50ce1e0c7c1c2c2b45a Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 09:58:16 +0000 Subject: [PATCH 26/28] simplify matrix condition runs --- .github/workflows/unit-tests.yaml | 45 +++++++++++-------------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index f5850efa..5d59cc8d 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -24,27 +24,16 @@ jobs: strategy: fail-fast: false matrix: - include: - - - os: ubuntu-20.04 - php: 8.0 - extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:9.6 - - - os: ubuntu-20.04 - php: 8.1 - extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:10.5 - - - os: ubuntu-20.04 - php: 8.2 - extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:10.5 - - - os: ubuntu-22.04 - php: 8.3 - extensions: json,pcre,pdo,phar,spl,mbstring,sqlite - tools: phpunit:10.5 + os: + - "ubuntu-22.04" + php: + - "8.0" + - "8.1" + - "8.2" + - "8.3" + tools: + - phpunit:9.6 + - phpunit:10.5 name: Unit Tests @@ -62,7 +51,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: ${{ matrix.extensions }} + extensions: json,pcre,pdo,phar,spl,mbstring,sqlite tools: ${{ matrix.tools }} - # https://github.com/ramsey/composer-install @@ -80,13 +69,9 @@ jobs: - # https://github.com/sebastianbergmann/phpunit/tree/9.6 name: Unit tests with PHPUnit 9 - if: | - ${{ matrix.php == '8.0' }} - run: phpunit --group features,large,reference,regression,default --testdox --do-not-cache-result --configuration ./phpunit-9.xml + if: matrix.tools == 'phpunit:9.6' + run: phpunit --group features,large,reference,regression,default --do-not-cache-result --configuration ./phpunit-9.xml - # https://github.com/sebastianbergmann/phpunit/tree/10.5 name: Unit tests with PHPUnit 10 - if: | - ${{ matrix.php == '8.1' }} || - ${{ matrix.php == '8.2' }} || - ${{ matrix.php == '8.3' }} - run: phpunit --group features,large,reference,regression,default --testdox --do-not-cache-result + if: matrix.tools == 'phpunit:10.5' && matrix.php != '8.0' + run: phpunit --group features,large,reference,regression,default --do-not-cache-result --no-progress From 94d1ad0503dcfc9e59fcb4c6e7f9d48f51961584 Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 11:13:47 +0000 Subject: [PATCH 27/28] still keep compatibility with Symfony Messenger 6.0 --- src/Presentation/Console/Command/AnalyserCommand.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Presentation/Console/Command/AnalyserCommand.php b/src/Presentation/Console/Command/AnalyserCommand.php index 755f07e7..e9d25850 100644 --- a/src/Presentation/Console/Command/AnalyserCommand.php +++ b/src/Presentation/Console/Command/AnalyserCommand.php @@ -18,6 +18,8 @@ use Symfony\Component\Messenger\Exception\HandlerFailedException; use function sprintf; +use function version_compare; +use const PHP_VERSION; /** * Analyse a data source to find out requirements. @@ -74,7 +76,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->queryBus->query($compatibilityQuery); } catch (HandlerFailedException $e) { $exceptions = []; - foreach ($e->getWrappedExceptions() as $exception) { + if (version_compare(PHP_VERSION, '8.1', 'ge')) { + $failures = $e->getWrappedExceptions(); // @phpstan-ignore-line + } else { + // still keep compatibility with Symfony Messenger Component 6.0 + $failures = $e->getNestedExceptions(); + } + foreach ($failures as $exception) { $exceptions[] = $exception->getMessage() . sprintf(' from file "%s" at line %d', $exception->getFile(), $exception->getLine()); } From 45c36a84ce53abde532bbb4a8b3ba602ff72715c Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Mon, 1 Jan 2024 11:14:53 +0000 Subject: [PATCH 28/28] prepare feature release 7.1 --- .changes/7.x/7.1.0.md | 16 ++++++++++++++++ CHANGELOG.md | 16 ++++++++++++++++ README.md | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .changes/7.x/7.1.0.md diff --git a/.changes/7.x/7.1.0.md b/.changes/7.x/7.1.0.md new file mode 100644 index 00000000..ebfa814e --- /dev/null +++ b/.changes/7.x/7.1.0.md @@ -0,0 +1,16 @@ + +## 7.1.0 - 2024-01-01 + +> **WARNING** +> +> As PHP 8.0 is still supported, database of CompatInfoDB (v5.14) is outdated and does not contain recent PHP 8.3 elements. +> +> But source code that implement PHP 8.3 new features may be detected ! + +### Added + +- PHP 8.3.0 support +- Docker support with official image : +- Compatibility with Symfony Components v7 + +**Full Changelog**: [7.0.3...7.1.0](https://github.com/llaville/php-compatinfo/compare/7.0.3...7.1.0) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e87904c..9d2e2d18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## 7.1.0 - 2024-01-01 + +> **WARNING** +> +> As PHP 8.0 is still supported, database of CompatInfoDB (v5.14) is outdated and does not contain recent PHP 8.3 elements. +> +> But source code that implement PHP 8.3 new features may be detected ! + +### Added + +- PHP 8.3.0 support +- Docker support with official image : +- Compatibility with Symfony Components v7 + +**Full Changelog**: [7.0.3...7.1.0](https://github.com/llaville/php-compatinfo/compare/7.0.3...7.1.0) + ## 7.0.3 - 2023-12-30 ### Fixed diff --git a/README.md b/README.md index 7542764c..64455c17 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Running on PHP greater or equal than 7.2 for parsing source code in a format PHP | Stable v5.5.x | [![Branch 5.5][Branch_55x-img]][Branch_55x] | [![Minimum PHP Version)][PHPVersion_55x-img]][PHPVersion_55x] | [![Stable Version 5.5][Packagist_55x-img]][Packagist_55x] | [![License 5.5][License_55x-img]][License_55x] | [![Documentation 5.5][Documentation_55x-img]][Documentation_55x] | | Stable v6.5.x | [![Branch 6.5][Branch_65x-img]][Branch_65x] | [![Minimum PHP Version)][PHPVersion_65x-img]][PHPVersion_65x] | [![Stable Version 6.5][Packagist_65x-img]][Packagist_65x] | [![License 6.5][License_65x-img]][License_65x] | [![Documentation 6.5][Documentation_65x-img]][Documentation_65x] | | Stable v7.0.x | [![Branch 7.0][Branch_70x-img]][Branch_70x] | [![Minimum PHP Version)][PHPVersion_70x-img]][PHPVersion_70x] | [![Stable Version 7.0][Packagist_70x-img]][Packagist_70x] | [![License 7.0][License_70x-img]][License_70x] | [![Documentation 7.0][Documentation_70x-img]][Documentation_70x] | -| Upcoming v7.1.x | [![Branch 7.1][Branch_71x-img]][Branch_71x] | [![Minimum PHP Version)][PHPVersion_71x-img]][PHPVersion_71x] | [![Stable Version 7.1][Packagist_71x-img]][Packagist_71x] | [![License 7.1][License_71x-img]][License_71x] | [![Documentation 7.1][Documentation_71x-img]][Documentation_71x] | +| Stable v7.1.x | [![Branch 7.1][Branch_71x-img]][Branch_71x] | [![Minimum PHP Version)][PHPVersion_71x-img]][PHPVersion_71x] | [![Stable Version 7.1][Packagist_71x-img]][Packagist_71x] | [![License 7.1][License_71x-img]][License_71x] | [![Documentation 7.1][Documentation_71x-img]][Documentation_71x] | [Branch_55x-img]: https://img.shields.io/badge/branch-5.5-orange [Branch_55x]: https://github.com/llaville/php-compatinfo/tree/5.5