From c56389bcdfca938eed6ac4970c918a1998a0519f Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 17:33:19 +0200 Subject: [PATCH 1/8] Transform source code on PHP 8.1 --- .github/workflows/lint.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f69863446..1a029d2dee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: 8.0 + php-version: 8.1 extensions: mbstring, intl - name: "Rector downgrade cache key" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index d47ab8b0c5..85fb3ca0a3 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -60,7 +60,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: 8.0 + php-version: 8.1 extensions: mbstring, intl - name: "Rector downgrade cache key" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2159aa1a9a..b464ec28fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,7 +61,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: 8.0 + php-version: 8.1 extensions: mbstring, intl - name: "Rector downgrade cache key" @@ -182,7 +182,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "8.0" + php-version: "8.1" extensions: mbstring, intl - name: "Rector downgrade cache key" From fff554225a07654bea91952f51ed2e0431cd1a5c Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 17:33:49 +0200 Subject: [PATCH 2/8] phpstan-src: Require PHP 8.1 --- composer.json | 4 ++-- composer.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1174a3e1d2..d02f9ae28b 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "MIT" ], "require": { - "php": "^8.0", + "php": "^8.1", "composer-runtime-api": "^2.0", "clue/ndjson-react": "^1.0", "composer/ca-bundle": "^1.2", @@ -63,7 +63,7 @@ }, "config": { "platform": { - "php": "8.0.99" + "php": "8.1.99" }, "platform-check": false, "sort-packages": true, diff --git a/composer.lock b/composer.lock index aa7b3f3c8f..ab8d1e014e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "71a2fded26fcd140b9b5330792cc5031", + "content-hash": "95e06fb3db5986d6adad21d50fd3d0fa", "packages": [ { "name": "clue/ndjson-react", @@ -7231,12 +7231,12 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.0", + "php": "^8.1", "composer-runtime-api": "^2.0" }, "platform-dev": [], "platform-overrides": { - "php": "8.0.99" + "php": "8.1.99" }, "plugin-api-version": "2.3.0" } From 6a0202b16ca0cf9a6eb98c41689799aba573201b Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 17:51:00 +0200 Subject: [PATCH 3/8] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab112fcf7d..2c54109d72 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Any contributions are welcome. ### Building -PHPStan's source code is developed on PHP 8.0. For distribution in `phpstan/phpstan` package and as a PHAR file, the source code is transformed to run on PHP 7.2 and higher. +PHPStan's source code is developed on PHP 8.1. For distribution in `phpstan/phpstan` package and as a PHAR file, the source code is transformed to run on PHP 7.2 and higher. Initially you need to run `composer install` in case you aren't working in a directory which was built before. From 0b3ee858e1f64c789d84d98c1e973883b61ebd34 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 18:12:25 +0200 Subject: [PATCH 4/8] Transform source code on PHP 8.0 --- .github/workflows/backward-compatibility.yml | 2 +- .github/workflows/e2e-tests.yml | 6 ++--- .github/workflows/lint.yml | 28 +++++++------------- .github/workflows/phar.yml | 4 +-- .github/workflows/static-analysis.yml | 22 ++++++--------- .github/workflows/tests.yml | 20 +++++++------- .github/workflows/update-phpstorm-stubs.yml | 2 +- tests/e2e/phpstan.neon | 1 + tests/e2e/phpstan_resultcachepath.neon | 1 + 9 files changed, 35 insertions(+), 51 deletions(-) diff --git a/.github/workflows/backward-compatibility.yml b/.github/workflows/backward-compatibility.yml index 28e49e2ee5..e34b144092 100644 --- a/.github/workflows/backward-compatibility.yml +++ b/.github/workflows/backward-compatibility.yml @@ -35,7 +35,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "8.0" + php-version: "8.1" - name: "Install dependencies" run: "composer install --no-dev --no-interaction --no-progress" diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 5d7afa2fa5..741654b414 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -33,8 +33,6 @@ jobs: strategy: fail-fast: false matrix: - php-version: - - "8.0" operating-system: [ubuntu-latest, windows-latest] steps: @@ -45,7 +43,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "${{ matrix.php-version }}" + php-version: "8.1" extensions: mbstring ini-values: memory_limit=256M @@ -82,7 +80,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "8.0" + php-version: "8.1" tools: ${{ matrix.tools }} extensions: ${{ matrix.extensions }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1a029d2dee..e04e551a97 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,7 +49,7 @@ jobs: run: "composer install --no-interaction --no-progress" - name: "Install PHP for code transform" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -58,25 +58,25 @@ jobs: - name: "Rector downgrade cache key" id: rector-cache-key - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' run: | echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)" - name: "Rector downgrade cache" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: actions/cache@v3 with: path: ./tmp/rectorCache.php - key: "rector-v1-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" + key: "rector-v2-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" restore-keys: | - rector-v1-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- + rector-v2-lint-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- - name: "Transform source code" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' run: "build/transform-source ${{ matrix.php-version }}" - name: "Reinstall matrix PHP version" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -91,11 +91,6 @@ jobs: runs-on: "ubuntu-latest" timeout-minutes: 60 - strategy: - matrix: - php-version: - - "8.0" - steps: - name: "Checkout" uses: actions/checkout@v3 @@ -104,7 +99,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "${{ matrix.php-version }}" + php-version: "8.1" - name: "Validate Composer" run: "composer validate" @@ -124,11 +119,6 @@ jobs: runs-on: "ubuntu-latest" timeout-minutes: 60 - strategy: - matrix: - php-version: - - "8.0" - steps: - name: "Checkout" uses: actions/checkout@v3 @@ -137,7 +127,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "${{ matrix.php-version }}" + php-version: "8.1" - name: "Install dependencies" run: "composer install --no-interaction --no-progress" diff --git a/.github/workflows/phar.yml b/.github/workflows/phar.yml index 2277f2f072..dfcafa819c 100644 --- a/.github/workflows/phar.yml +++ b/.github/workflows/phar.yml @@ -60,9 +60,9 @@ jobs: uses: actions/cache@v3 with: path: ./tmp/rectorCache.php - key: "rector-v1-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ steps.rector-cache-key.outputs.sha }}" + key: "rector-v2-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ steps.rector-cache-key.outputs.sha }}" restore-keys: | - rector-v1-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}- + rector-v2-phar-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}- - name: "Prepare for PHAR compilation" working-directory: "compiler" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 85fb3ca0a3..50e3664a8f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -56,7 +56,7 @@ jobs: run: "composer install --no-interaction --no-progress" - name: "Install PHP for code transform" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -65,26 +65,26 @@ jobs: - name: "Rector downgrade cache key" id: rector-cache-key - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' run: | echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)" - name: "Rector downgrade cache" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: actions/cache@v3 with: path: ./tmp/rectorCache.php - key: "rector-v1-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" + key: "rector-v2-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" restore-keys: | - rector-v1-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- + rector-v2-sa-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- - name: "Transform source code" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' shell: bash run: "build/transform-source ${{ matrix.php-version }}" - name: "Reinstall matrix PHP version" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -108,7 +108,6 @@ jobs: fail-fast: false matrix: php-version: - - "8.0" - "8.1" - "8.2" @@ -153,11 +152,6 @@ jobs: runs-on: "ubuntu-latest" timeout-minutes: 60 - strategy: - matrix: - php-version: - - "8.0" - steps: - name: "Checkout" uses: actions/checkout@v3 @@ -166,7 +160,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "${{ matrix.php-version }}" + php-version: "8.1" - name: "Install dependencies" run: "composer install --no-interaction --no-progress" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b464ec28fb..6d532bb9b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,7 +57,7 @@ jobs: run: "composer install --no-interaction --no-progress" - name: "Install PHP for code transform" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -66,26 +66,26 @@ jobs: - name: "Rector downgrade cache key" id: rector-cache-key - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' run: | echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)" - name: "Rector downgrade cache" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: actions/cache@v3 with: path: ./tmp/rectorCache.php - key: "rector-v1-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" + key: "rector-v2-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" restore-keys: | - rector-v1-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- + rector-v2-tests-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- - name: "Transform source code" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' shell: bash run: "build/transform-source ${{ matrix.php-version }}" - name: "Reinstall matrix PHP version" - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' uses: "shivammathur/setup-php@v2" with: coverage: "none" @@ -187,7 +187,7 @@ jobs: - name: "Rector downgrade cache key" id: rector-cache-key - if: matrix.php-version != '8.0' && matrix.php-version != '8.1' && matrix.php-version != '8.2' + if: matrix.php-version != '8.1' && matrix.php-version != '8.2' run: | echo "::set-output name=sha::$(php build/rector-cache-files-hash.php)" @@ -195,9 +195,9 @@ jobs: uses: actions/cache@v3 with: path: ./tmp/rectorCache.php - key: "rector-v1-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" + key: "rector-v2-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}-${{ steps.rector-cache-key.outputs.sha }}" restore-keys: | - rector-v1-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- + rector-v2-tests-old-${{ matrix.script }}-${{ matrix.operating-system }}-${{ hashFiles('composer.lock', 'build/rector-downgrade.php') }}-${{ matrix.php-version }}- - name: "Transform source code" shell: bash diff --git a/.github/workflows/update-phpstorm-stubs.yml b/.github/workflows/update-phpstorm-stubs.yml index 10dad9c621..6809f43227 100644 --- a/.github/workflows/update-phpstorm-stubs.yml +++ b/.github/workflows/update-phpstorm-stubs.yml @@ -23,7 +23,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - php-version: "8.0" + php-version: "8.1" - name: "Install dependencies" run: "composer install --no-interaction --no-progress" - name: "Checkout stubs" diff --git a/tests/e2e/phpstan.neon b/tests/e2e/phpstan.neon index 4bf004daf0..8b96fff56d 100644 --- a/tests/e2e/phpstan.neon +++ b/tests/e2e/phpstan.neon @@ -2,4 +2,5 @@ includes: - baseline.neon parameters: + phpVersion: 80000 tmpDir: tmp diff --git a/tests/e2e/phpstan_resultcachepath.neon b/tests/e2e/phpstan_resultcachepath.neon index cab1d3fdaa..5aaf1200bd 100644 --- a/tests/e2e/phpstan_resultcachepath.neon +++ b/tests/e2e/phpstan_resultcachepath.neon @@ -2,4 +2,5 @@ includes: - baseline.neon parameters: + phpVersion: 80000 resultCachePath: %tmpDir%/myResultCacheFile.php From 9f2fd03bfd457d909c5f6c56b7615be27110368f Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 18:12:50 +0200 Subject: [PATCH 5/8] Use readonly properties --- build/rector-downgrade.php | 5 +++++ src/Analyser/NodeScopeResolver.php | 36 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/build/rector-downgrade.php b/build/rector-downgrade.php index e4f65721dc..cd460fb679 100644 --- a/build/rector-downgrade.php +++ b/build/rector-downgrade.php @@ -12,6 +12,7 @@ use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeMixedTypeDeclarationRector; use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector; use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector; +use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector; return static function (RectorConfig $config): void { $parsePhpVersion = static function (string $version, int $defaultPatch = 0): int { @@ -27,6 +28,10 @@ $config->phpVersion($targetPhpVersionId); $config->skip(RectorCache::SKIP_PATHS); + if ($targetPhpVersionId < 80100) { + $config->rule(DowngradeReadonlyPropertyRector::class); + } + if ($targetPhpVersionId < 80000) { $config->rule(DowngradeTrailingCommasInParamUseRector::class); $config->rule(DowngradeNonCapturingCatchesRector::class); diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php index 94a3453cc9..f8cbcb4ff0 100644 --- a/src/Analyser/NodeScopeResolver.php +++ b/src/Analyser/NodeScopeResolver.php @@ -188,24 +188,24 @@ class NodeScopeResolver * @param array $earlyTerminatingFunctionCalls */ public function __construct( - private ReflectionProvider $reflectionProvider, - private InitializerExprTypeResolver $initializerExprTypeResolver, - private Reflector $reflector, - private ClassReflectionExtensionRegistryProvider $classReflectionExtensionRegistryProvider, - private Parser $parser, - private FileTypeMapper $fileTypeMapper, - private StubPhpDocProvider $stubPhpDocProvider, - private PhpVersion $phpVersion, - private PhpDocInheritanceResolver $phpDocInheritanceResolver, - private FileHelper $fileHelper, - private TypeSpecifier $typeSpecifier, - private DynamicThrowTypeExtensionProvider $dynamicThrowTypeExtensionProvider, - private ReadWritePropertiesExtensionProvider $readWritePropertiesExtensionProvider, - private bool $polluteScopeWithLoopInitialAssignments, - private bool $polluteScopeWithAlwaysIterableForeach, - private array $earlyTerminatingMethodCalls, - private array $earlyTerminatingFunctionCalls, - private bool $implicitThrows, + private readonly ReflectionProvider $reflectionProvider, + private readonly InitializerExprTypeResolver $initializerExprTypeResolver, + private readonly Reflector $reflector, + private readonly ClassReflectionExtensionRegistryProvider $classReflectionExtensionRegistryProvider, + private readonly Parser $parser, + private readonly FileTypeMapper $fileTypeMapper, + private readonly StubPhpDocProvider $stubPhpDocProvider, + private readonly PhpVersion $phpVersion, + private readonly PhpDocInheritanceResolver $phpDocInheritanceResolver, + private readonly FileHelper $fileHelper, + private readonly TypeSpecifier $typeSpecifier, + private readonly DynamicThrowTypeExtensionProvider $dynamicThrowTypeExtensionProvider, + private readonly ReadWritePropertiesExtensionProvider $readWritePropertiesExtensionProvider, + private readonly bool $polluteScopeWithLoopInitialAssignments, + private readonly bool $polluteScopeWithAlwaysIterableForeach, + private readonly array $earlyTerminatingMethodCalls, + private readonly array $earlyTerminatingFunctionCalls, + private readonly bool $implicitThrows, ) { $earlyTerminatingMethodNames = []; From c64e7337234b509eb5fa901311dc831c78412b7e Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 18:31:25 +0200 Subject: [PATCH 6/8] Fix integration tests --- tests/PHPStan/Generics/data/bug2620-3.json | 2 +- tests/PHPStan/Generics/data/bug2620.php | 1 + tests/PHPStan/Generics/data/bug2622.php | 1 + tests/PHPStan/Levels/data/coalesce-4.json | 7 ------- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 tests/PHPStan/Levels/data/coalesce-4.json diff --git a/tests/PHPStan/Generics/data/bug2620-3.json b/tests/PHPStan/Generics/data/bug2620-3.json index 2906315156..a73d0e83fe 100644 --- a/tests/PHPStan/Generics/data/bug2620-3.json +++ b/tests/PHPStan/Generics/data/bug2620-3.json @@ -4,4 +4,4 @@ "line": 17, "ignorable": true } -] \ No newline at end of file +] diff --git a/tests/PHPStan/Generics/data/bug2620.php b/tests/PHPStan/Generics/data/bug2620.php index b2f0a6295d..d502138259 100644 --- a/tests/PHPStan/Generics/data/bug2620.php +++ b/tests/PHPStan/Generics/data/bug2620.php @@ -14,6 +14,7 @@ class SomeIterator implements \IteratorAggregate { /** * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { yield new Bar; } diff --git a/tests/PHPStan/Generics/data/bug2622.php b/tests/PHPStan/Generics/data/bug2622.php index f3aa345443..c92e6faa21 100644 --- a/tests/PHPStan/Generics/data/bug2622.php +++ b/tests/PHPStan/Generics/data/bug2622.php @@ -14,6 +14,7 @@ public function __construct() { $this->values = []; } + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayObject($this->values); } diff --git a/tests/PHPStan/Levels/data/coalesce-4.json b/tests/PHPStan/Levels/data/coalesce-4.json deleted file mode 100644 index 4d9dd368f4..0000000000 --- a/tests/PHPStan/Levels/data/coalesce-4.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "message": "Property ReflectionClass::$name (class-string) on left side of ?? is not nullable.", - "line": 10, - "ignorable": true - } -] \ No newline at end of file From aebf1ba132b56dc6feef8f044290ec7086e51e87 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 20:54:39 +0200 Subject: [PATCH 7/8] Update CS --- build-cs/composer.lock | 18 +++++++++--------- phpcs.xml | 7 +++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build-cs/composer.lock b/build-cs/composer.lock index 076d95da3b..da896907b0 100644 --- a/build-cs/composer.lock +++ b/build-cs/composer.lock @@ -196,16 +196,16 @@ }, { "name": "slevomat/coding-standard", - "version": "8.5.1", + "version": "8.5.2", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "971f489404350bf4608b7e59381e603c47700366" + "reference": "f32937dc41b587f3500efed1dbca2f82aa519373" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/971f489404350bf4608b7e59381e603c47700366", - "reference": "971f489404350bf4608b7e59381e603c47700366", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/f32937dc41b587f3500efed1dbca2f82aa519373", + "reference": "f32937dc41b587f3500efed1dbca2f82aa519373", "shasum": "" }, "require": { @@ -217,11 +217,11 @@ "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.8.5", + "phpstan/phpstan": "1.4.10|1.8.6", "phpstan/phpstan-deprecation-rules": "1.0.0", "phpstan/phpstan-phpunit": "1.0.0|1.1.1", - "phpstan/phpstan-strict-rules": "1.4.3", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.24" + "phpstan/phpstan-strict-rules": "1.4.4", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.25" }, "type": "phpcodesniffer-standard", "extra": { @@ -241,7 +241,7 @@ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.5.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.5.2" }, "funding": [ { @@ -253,7 +253,7 @@ "type": "tidelift" } ], - "time": "2022-09-23T05:34:53+00:00" + "time": "2022-09-27T16:45:37+00:00" }, { "name": "squizlabs/php_codesniffer", diff --git a/phpcs.xml b/phpcs.xml index 8424334283..5ed2ae964d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -40,6 +40,9 @@ + + + 10 @@ -48,6 +51,7 @@ + @@ -56,6 +60,9 @@ + + + 10 From af93bd0e404eb691bbe7e063cef85e832eb16bfe Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 27 Sep 2022 21:30:34 +0200 Subject: [PATCH 8/8] Update roave-backward-compatibility-check --- .github/workflows/backward-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backward-compatibility.yml b/.github/workflows/backward-compatibility.yml index e34b144092..64306d0fc7 100644 --- a/.github/workflows/backward-compatibility.yml +++ b/.github/workflows/backward-compatibility.yml @@ -44,7 +44,7 @@ jobs: run: | composer global config minimum-stability dev composer global config prefer-stable true - composer global require --dev ondrejmirtes/backward-compatibility-check:^5.0.9 + composer global require --dev ondrejmirtes/backward-compatibility-check:^7.1.0 - name: "Check" run: "$(composer global config bin-dir --absolute)/roave-backward-compatibility-check"