diff --git a/.github/workflows/downgraded_release.yaml b/.github/workflows/downgraded_release.yaml index 816abeb..60cdf5c 100644 --- a/.github/workflows/downgraded_release.yaml +++ b/.github/workflows/downgraded_release.yaml @@ -20,12 +20,12 @@ jobs: - uses: "ramsey/composer-install@v2" - # downgrade /src to PHP 7.2 - - run: vendor/bin/rector process src --config build/rector-downgrade-php-72.php --ansi + # downgrade /src to PHP 7.4 + - run: vendor/bin/rector process src --config build/rector-downgrade-php-74.php --ansi - run: vendor/bin/ecs check src --fix --ansi - # copy PHP 7.2 composer - - run: cp build/composer-php-72.json composer.json + # copy PHP 7.4 composer + - run: cp build/composer-php-74.json composer.json # clear the dev files - run: rm -rf build .github tests stubs ecs.php phpstan.neon phpunit.xml @@ -42,7 +42,7 @@ jobs: run: | # separate a "git add" to add untracked (new) files too git add --all - git commit -m "release PHP 7.2 downgraded" + git commit -m "release PHP 7.4 downgraded" # force push tag, so there is only 1 version git tag "${GITHUB_REF#refs/tags/}" --force diff --git a/build/composer-php-72.json b/build/composer-php-74.json similarity index 88% rename from build/composer-php-72.json rename to build/composer-php-74.json index cb512c5..e32de7f 100644 --- a/build/composer-php-72.json +++ b/build/composer-php-74.json @@ -5,8 +5,8 @@ "license": "MIT", "keywords": ["static analysis", "phpstan-extension"], "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3", + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0", "nette/utils": "^3.2 || ^4.0" }, "autoload": { diff --git a/build/rector-downgrade-php-72.php b/build/rector-downgrade-php-74.php similarity index 73% rename from build/rector-downgrade-php-72.php rename to build/rector-downgrade-php-74.php index 5550cff..b98900a 100644 --- a/build/rector-downgrade-php-72.php +++ b/build/rector-downgrade-php-74.php @@ -6,5 +6,5 @@ use Rector\Set\ValueObject\DowngradeLevelSetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_72]); + $rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_74]); }; diff --git a/composer.json b/composer.json index b526bc4..1eaa42d 100644 --- a/composer.json +++ b/composer.json @@ -6,15 +6,15 @@ "keywords": ["static analysis", "phpstan-extension"], "require": { "php": "^8.2", - "phpstan/phpstan": "^1.10.67" + "phpstan/phpstan": "^2.0.3" }, "require-dev": { - "phpstan/extension-installer": "^1.3", - "phpunit/phpunit": "^10.5", - "symplify/easy-coding-standard": "^12.1", - "rector/rector": "^1.0.4", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit": "^11.5", + "symplify/easy-coding-standard": "^12.4", + "rector/rector": "^2.0", "tracy/tracy": "^2.10", - "tomasvotruba/unused-public": "^0.2" + "tomasvotruba/unused-public": "^2.0" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index d123cd1..5a56b1b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -24,6 +24,9 @@ parameters: ignoreErrors: - identifier: missingType.generics + # used in tests + - message: '#Public constant "TomasVotruba\\TypeCoverage\\(.*?)::ERROR_MESSAGE" is never#' + excludePaths: - "*/Fixture/*" - "*/Source/*" diff --git a/tests/Rules/ConstantTypeCoverageRule/ConstantTypeCoverageRuleTest.php b/tests/Rules/ConstantTypeCoverageRule/ConstantTypeCoverageRuleTest.php index 721d23c..751034f 100644 --- a/tests/Rules/ConstantTypeCoverageRule/ConstantTypeCoverageRuleTest.php +++ b/tests/Rules/ConstantTypeCoverageRule/ConstantTypeCoverageRuleTest.php @@ -23,7 +23,7 @@ public static function setUpBeforeClass(): void /** * @param string[] $filePaths - * @param mixed[] $expectedErrorsWithLines + * @param list $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void diff --git a/tests/Rules/DeclareCoverageRule/DeclareCoverageRuleTest.php b/tests/Rules/DeclareCoverageRule/DeclareCoverageRuleTest.php index 8a6ed45..3c5252d 100644 --- a/tests/Rules/DeclareCoverageRule/DeclareCoverageRuleTest.php +++ b/tests/Rules/DeclareCoverageRule/DeclareCoverageRuleTest.php @@ -16,7 +16,7 @@ final class DeclareCoverageRuleTest extends RuleTestCase { /** * @param string[] $filePaths - * @param mixed[] $expectedErrorsWithLines + * @param list $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void diff --git a/tests/Rules/ParamTypeCoverageRule/ParamTypeCoverageRuleTest.php b/tests/Rules/ParamTypeCoverageRule/ParamTypeCoverageRuleTest.php index 3c48349..2af7f2e 100644 --- a/tests/Rules/ParamTypeCoverageRule/ParamTypeCoverageRuleTest.php +++ b/tests/Rules/ParamTypeCoverageRule/ParamTypeCoverageRuleTest.php @@ -16,7 +16,7 @@ final class ParamTypeCoverageRuleTest extends RuleTestCase { /** * @param string[] $filePaths - * @param mixed[] $expectedErrorsWithLines + * @param list $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void diff --git a/tests/Rules/PropertyTypeCoverageRule/PropertyTypeCoverageRuleTest.php b/tests/Rules/PropertyTypeCoverageRule/PropertyTypeCoverageRuleTest.php index 292806f..1c34cc2 100644 --- a/tests/Rules/PropertyTypeCoverageRule/PropertyTypeCoverageRuleTest.php +++ b/tests/Rules/PropertyTypeCoverageRule/PropertyTypeCoverageRuleTest.php @@ -16,7 +16,7 @@ final class PropertyTypeCoverageRuleTest extends RuleTestCase { /** * @param string[] $filePaths - * @param mixed[] $expectedErrorsWithLines + * @param list $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void diff --git a/tests/Rules/ReturnTypeCoverageRule/ReturnTypeCoverageRuleTest.php b/tests/Rules/ReturnTypeCoverageRule/ReturnTypeCoverageRuleTest.php index b297ffa..73c5918 100644 --- a/tests/Rules/ReturnTypeCoverageRule/ReturnTypeCoverageRuleTest.php +++ b/tests/Rules/ReturnTypeCoverageRule/ReturnTypeCoverageRuleTest.php @@ -16,7 +16,7 @@ final class ReturnTypeCoverageRuleTest extends RuleTestCase { /** * @param string[] $filePaths - * @param mixed[] $expectedErrorsWithLines + * @param list $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void