From 497418d1c38cd538b3235bd65c34cb021571e0ff Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 8 Mar 2024 11:22:36 +0100 Subject: [PATCH 1/3] Fix build --- .../FetchingDeprecatedConstRule.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/Rules/Deprecations/FetchingDeprecatedConstRule.php b/src/Rules/Deprecations/FetchingDeprecatedConstRule.php index 8b77ce1..c909203 100644 --- a/src/Rules/Deprecations/FetchingDeprecatedConstRule.php +++ b/src/Rules/Deprecations/FetchingDeprecatedConstRule.php @@ -8,7 +8,6 @@ use PHPStan\Reflection\ReflectionProvider; use PHPStan\Rules\Rule; use function sprintf; -use const PHP_VERSION_ID; /** * @implements Rule @@ -22,19 +21,10 @@ class FetchingDeprecatedConstRule implements Rule /** @var DeprecatedScopeHelper */ private $deprecatedScopeHelper; - /** @var array */ - private $deprecatedConstants = []; - public function __construct(ReflectionProvider $reflectionProvider, DeprecatedScopeHelper $deprecatedScopeHelper) { $this->reflectionProvider = $reflectionProvider; $this->deprecatedScopeHelper = $deprecatedScopeHelper; - - // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed - if (PHP_VERSION_ID >= 70300) { - $this->deprecatedConstants['FILTER_FLAG_SCHEME_REQUIRED'] = 'Use of constant %s is deprecated since PHP 7.3.'; - $this->deprecatedConstants['FILTER_FLAG_HOST_REQUIRED'] = 'Use of constant %s is deprecated since PHP 7.3.'; - } } public function getNodeType(): string @@ -61,13 +51,6 @@ public function processNode(Node $node, Scope $scope): array )]; } - if (isset($this->deprecatedConstants[$constantReflection->getName()])) { - return [sprintf( - $this->deprecatedConstants[$constantReflection->getName()], - $constantReflection->getName() - )]; - } - return []; } From e47ebbe11e00f75482ffd272b33a11013d6f48f7 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 8 Mar 2024 11:24:32 +0100 Subject: [PATCH 2/3] Update FetchingDeprecatedConstRuleTest.php --- .../Deprecations/FetchingDeprecatedConstRuleTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php b/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php index 08c95c4..76207c1 100644 --- a/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php +++ b/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php @@ -31,27 +31,27 @@ public function testFetchingDeprecatedConst(): void if (PHP_VERSION_ID >= 70300) { $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.', 5, ]; $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.', 6, ]; $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.', 7, ]; $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.', 8, ]; $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.', 37, ]; $expectedErrors[] = [ - 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated since PHP 7.3.', + 'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.', 38, ]; } From 4c1e4ab32e33dc1751267d0b2a454528663e3c47 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Wed, 13 Mar 2024 09:01:35 +0100 Subject: [PATCH 3/3] Update PHPStan version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 149508f..80f0087 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.3" + "phpstan/phpstan": "^1.10.61" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2",