From ec67b1d0bc20dcfae67412731ee37ebd7f47d5b5 Mon Sep 17 00:00:00 2001 From: denys_danylov Date: Fri, 10 Jan 2025 13:42:58 +0200 Subject: [PATCH 1/5] Updated phpstan to 2.0.1 version. Updated rules to reflect the new package requirements. --- composer.json | 2 +- src/PhpStan/AbstractNoNamedArgumentUsedRule.php | 9 ++++----- src/PhpStan/ForbiddenFunctionCallRule.php | 7 ++++++- src/PhpStan/ForbiddenMethodCallRule.php | 16 +++++++--------- src/PhpStan/ForbiddenNodeTypeRule.php | 7 ++++++- .../ForbiddenPassArgumentAsReferenceRule.php | 7 ++++++- src/PhpStan/ForbiddenSuppressErrorRule.php | 7 ++++++- 7 files changed, 36 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 73786a4..77ecec5 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "phpunit/phpunit": "~9.5", - "phpstan/phpstan": "~1.10", + "phpstan/phpstan": "~2.1.1", "escapestudios/symfony2-coding-standard": "~3.13" }, diff --git a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php index fdf9cfd..c7d27b4 100644 --- a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php +++ b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php @@ -16,6 +16,7 @@ use PhpParser\Node; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; /** * @implements Rule @@ -70,11 +71,9 @@ public function processNode(Node $node, Scope $scope): array if ('all' === $forbiddenMethods || \in_array(\strtolower($methodName), $forbiddenMethods, true)) { if ($this->findNullableName($node)) { - $errors[] = \sprintf( - 'The method "%s::%s" is forbidden to call without named arguments.', - $className, - $methodName - ); + $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call without named arguments.', $className, $methodName)) + ->identifier('method.call.without.named.arguments.forbidden') + ->build(); } } } diff --git a/src/PhpStan/ForbiddenFunctionCallRule.php b/src/PhpStan/ForbiddenFunctionCallRule.php index 2e49532..3e54344 100644 --- a/src/PhpStan/ForbiddenFunctionCallRule.php +++ b/src/PhpStan/ForbiddenFunctionCallRule.php @@ -16,6 +16,7 @@ use PhpParser\Node; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; /** * @implements Rule @@ -58,7 +59,11 @@ public function processNode(Node $node, Scope $scope): array $funcName = $node->name->toString(); if (\in_array($funcName, $this->forbiddenFunctions, true)) { - return [\sprintf('The function "%s" is forbidden for usage.', $funcName)]; + return [ + RuleErrorBuilder::message(\sprintf('The function "%s" is forbidden for usage.', $funcName)) + ->identifier('function.usage.forbidden') + ->build(), + ]; } return []; diff --git a/src/PhpStan/ForbiddenMethodCallRule.php b/src/PhpStan/ForbiddenMethodCallRule.php index c3367e8..c0b7547 100644 --- a/src/PhpStan/ForbiddenMethodCallRule.php +++ b/src/PhpStan/ForbiddenMethodCallRule.php @@ -16,6 +16,7 @@ use PhpParser\Node; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; use PHPStan\Type\ObjectType; /** @@ -76,16 +77,13 @@ public function processNode(Node $node, Scope $scope): array if ($varClassReflection && \is_a($varClassReflection->getName(), $forbiddenClass, true)) { if ('all' === $forbiddenMethods) { - $errors[] = \sprintf( - 'Any method call from "%s" is forbidden.', - $forbiddenClass - ); + $errors[] = RuleErrorBuilder::message(\sprintf('Any method call from "%s" is forbidden.', $forbiddenClass)) + ->identifier('call.any.method.forbidden') + ->build(); } elseif (\in_array($node->name->toLowerString(), $forbiddenMethods, true)) { - $errors[] = \sprintf( - 'The method "%s::%s" is forbidden to call.', - $varClassReflection->getName(), - $node->name->toString() - ); + $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call.', $varClassReflection->getName(), $node->name->toString())) + ->identifier('call.method.forbidden') + ->build(); } } } diff --git a/src/PhpStan/ForbiddenNodeTypeRule.php b/src/PhpStan/ForbiddenNodeTypeRule.php index c50882a..91c0488 100644 --- a/src/PhpStan/ForbiddenNodeTypeRule.php +++ b/src/PhpStan/ForbiddenNodeTypeRule.php @@ -16,6 +16,7 @@ use PhpParser\Node; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; /** * @implements Rule @@ -66,6 +67,10 @@ public function getNodeType(): string public function processNode(Node $node, Scope $scope): array { - return [$this->message]; + return [ + RuleErrorBuilder::message($this->message) + ->identifier('node.usage.forbidden') + ->build(), + ]; } } diff --git a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php index a15fee9..5f50a62 100644 --- a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php +++ b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php @@ -16,6 +16,7 @@ use PhpParser\Node; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; /** * @implements Rule @@ -60,7 +61,11 @@ public function processNode(Node $node, Scope $scope): array { foreach ($node->getParams() as $param) { if ($param->byRef) { - return ['Pass arguments by reference is forbidden.']; + return [ + RuleErrorBuilder::message('Pass arguments by reference is forbidden.') + ->identifier('pass.by.reference.forbidden') + ->build(), + ]; } } diff --git a/src/PhpStan/ForbiddenSuppressErrorRule.php b/src/PhpStan/ForbiddenSuppressErrorRule.php index 242eba0..a79babc 100644 --- a/src/PhpStan/ForbiddenSuppressErrorRule.php +++ b/src/PhpStan/ForbiddenSuppressErrorRule.php @@ -21,6 +21,7 @@ use PhpParser\Node\Expr\MethodCall; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; use PHPStan\Type\ObjectType; /** @@ -106,6 +107,10 @@ public function processNode(Node $node, Scope $scope): array } } - return ['Suppress error is forbidden.']; + return [ + RuleErrorBuilder::message('Suppress error is forbidden.') + ->identifier('suppress.error.forbidden') + ->build(), + ]; } } From ef22a17683fe2d0d006900a2e5e57714d0153c60 Mon Sep 17 00:00:00 2001 From: denys_danylov Date: Fri, 10 Jan 2025 13:43:52 +0200 Subject: [PATCH 2/5] Removed unnecessary annotation in tests. --- tests/PhpStan/ForbiddenFunctionCallRuleTest.php | 8 -------- tests/PhpStan/ForbiddenMethodCallRuleTest.php | 8 -------- tests/PhpStan/ForbiddenNodeTypeRuleTest.php | 3 --- .../PhpStan/ForbiddenPassArgumentAsReferenceRuleTest.php | 3 --- tests/PhpStan/ForbiddenSuppressErrorRuleTest.php | 8 -------- tests/PhpStan/NoNamedArgumentUsedConstructorRuleTest.php | 8 -------- tests/PhpStan/NoNamedArgumentUsedMethodCallRuleTest.php | 8 -------- 7 files changed, 46 deletions(-) diff --git a/tests/PhpStan/ForbiddenFunctionCallRuleTest.php b/tests/PhpStan/ForbiddenFunctionCallRuleTest.php index a6db370..429b0de 100644 --- a/tests/PhpStan/ForbiddenFunctionCallRuleTest.php +++ b/tests/PhpStan/ForbiddenFunctionCallRuleTest.php @@ -18,9 +18,6 @@ class ForbiddenFunctionCallRuleTest extends RuleTestCase { - /** - * @var ForbiddenFunctionCallRule - */ private ForbiddenFunctionCallRule $rule; protected function getRule(): ForbiddenFunctionCallRule @@ -43,11 +40,6 @@ public function shouldSuccessProcess(array $functions, array $errors): void $this->analyse([__DIR__.'/Resources/forbidden-functions.php'], [...$errors]); } - /** - * Provide data for test analyze - * - * @return array - */ public function provideDataForProcess(): array { return [ diff --git a/tests/PhpStan/ForbiddenMethodCallRuleTest.php b/tests/PhpStan/ForbiddenMethodCallRuleTest.php index 7465867..0e7a1ba 100644 --- a/tests/PhpStan/ForbiddenMethodCallRuleTest.php +++ b/tests/PhpStan/ForbiddenMethodCallRuleTest.php @@ -19,9 +19,6 @@ class ForbiddenMethodCallRuleTest extends RuleTestCase { - /** - * @var ForbiddenMethodCallRule - */ private ForbiddenMethodCallRule $rule; protected function getRule(): Rule @@ -44,11 +41,6 @@ public function shouldSuccessProcess(array $methods, array $errors): void $this->analyse([__DIR__.'/Resources/forbidden-methods.php'], [...$errors]); } - /** - * Provide data for testing - * - * @return array - */ public function provideDataForTesting(): array { return [ diff --git a/tests/PhpStan/ForbiddenNodeTypeRuleTest.php b/tests/PhpStan/ForbiddenNodeTypeRuleTest.php index f3bddf6..aaf0492 100644 --- a/tests/PhpStan/ForbiddenNodeTypeRuleTest.php +++ b/tests/PhpStan/ForbiddenNodeTypeRuleTest.php @@ -21,9 +21,6 @@ class ForbiddenNodeTypeRuleTest extends RuleTestCase { - /** - * @var ForbiddenNodeTypeRule - */ private ForbiddenNodeTypeRule $rule; protected function getRule(): Rule diff --git a/tests/PhpStan/ForbiddenPassArgumentAsReferenceRuleTest.php b/tests/PhpStan/ForbiddenPassArgumentAsReferenceRuleTest.php index bafe388..e8a0bdd 100644 --- a/tests/PhpStan/ForbiddenPassArgumentAsReferenceRuleTest.php +++ b/tests/PhpStan/ForbiddenPassArgumentAsReferenceRuleTest.php @@ -20,9 +20,6 @@ class ForbiddenPassArgumentAsReferenceRuleTest extends RuleTestCase { - /** - * @var ForbiddenPassArgumentAsReferenceRule - */ private ForbiddenPassArgumentAsReferenceRule $rule; protected function getRule(): ForbiddenPassArgumentAsReferenceRule diff --git a/tests/PhpStan/ForbiddenSuppressErrorRuleTest.php b/tests/PhpStan/ForbiddenSuppressErrorRuleTest.php index aac8a93..22aa4b5 100644 --- a/tests/PhpStan/ForbiddenSuppressErrorRuleTest.php +++ b/tests/PhpStan/ForbiddenSuppressErrorRuleTest.php @@ -18,9 +18,6 @@ class ForbiddenSuppressErrorRuleTest extends RuleTestCase { - /** - * @var ForbiddenSuppressErrorRule - */ private ForbiddenSuppressErrorRule $rule; protected function getRule(): ForbiddenSuppressErrorRule @@ -43,11 +40,6 @@ public function shouldSuccessProcess(array $allowed, array $errors): void $this->analyse([__DIR__.'/Resources/forbidden-suppress-error.php'], [...$errors]); } - /** - * Provide data for testing - * - * @return array - */ public function provideDataForTesting(): array { return [ diff --git a/tests/PhpStan/NoNamedArgumentUsedConstructorRuleTest.php b/tests/PhpStan/NoNamedArgumentUsedConstructorRuleTest.php index c2c123e..382add6 100644 --- a/tests/PhpStan/NoNamedArgumentUsedConstructorRuleTest.php +++ b/tests/PhpStan/NoNamedArgumentUsedConstructorRuleTest.php @@ -19,9 +19,6 @@ class NoNamedArgumentUsedConstructorRuleTest extends RuleTestCase { - /** - * @var NoNamedArgumentUsedConstructorRule - */ private NoNamedArgumentUsedConstructorRule $rule; protected function getRule(): Rule @@ -44,11 +41,6 @@ public function shouldSuccessProcess(array $methods, array $errors): void $this->analyse([__DIR__.'/Resources/no-named-argument-used-new.php'], [...$errors]); } - /** - * Provide data for testing - * - * @return array - */ public function provideDataForTesting(): array { return [ diff --git a/tests/PhpStan/NoNamedArgumentUsedMethodCallRuleTest.php b/tests/PhpStan/NoNamedArgumentUsedMethodCallRuleTest.php index ac6c847..f10b828 100644 --- a/tests/PhpStan/NoNamedArgumentUsedMethodCallRuleTest.php +++ b/tests/PhpStan/NoNamedArgumentUsedMethodCallRuleTest.php @@ -19,9 +19,6 @@ class NoNamedArgumentUsedMethodCallRuleTest extends RuleTestCase { - /** - * @var NoNamedArgumentUsedMethodCallRule - */ private NoNamedArgumentUsedMethodCallRule $rule; protected function getRule(): Rule @@ -44,11 +41,6 @@ public function shouldSuccessProcess(array $methods, array $errors): void $this->analyse([__DIR__.'/Resources/no-named-argument-used-method-call.php'], [...$errors]); } - /** - * Provide data for testing - * - * @return array - */ public function provideDataForTesting(): array { return [ From 6fe543669c0d4ed64e787af994e1d67bdfad915c Mon Sep 17 00:00:00 2001 From: denys_danylov Date: Fri, 10 Jan 2025 15:03:19 +0200 Subject: [PATCH 3/5] Fixed available phpstan version. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 77ecec5..624e570 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "phpunit/phpunit": "~9.5", - "phpstan/phpstan": "~2.1.1", + "phpstan/phpstan": "~2.0", "escapestudios/symfony2-coding-standard": "~3.13" }, From f4bb27304488580b0ed9fc627086954a4ac9c437 Mon Sep 17 00:00:00 2001 From: denys_danylov Date: Thu, 23 Jan 2025 11:14:39 +0200 Subject: [PATCH 4/5] Updated identifiers in RuleErrorBuilder. --- src/PhpStan/AbstractNoNamedArgumentUsedRule.php | 2 +- src/PhpStan/ForbiddenFunctionCallRule.php | 2 +- src/PhpStan/ForbiddenMethodCallRule.php | 4 ++-- src/PhpStan/ForbiddenNodeTypeRule.php | 2 +- src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php | 2 +- src/PhpStan/ForbiddenSuppressErrorRule.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php index c7d27b4..f018551 100644 --- a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php +++ b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php @@ -72,7 +72,7 @@ public function processNode(Node $node, Scope $scope): array if ('all' === $forbiddenMethods || \in_array(\strtolower($methodName), $forbiddenMethods, true)) { if ($this->findNullableName($node)) { $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call without named arguments.', $className, $methodName)) - ->identifier('method.call.without.named.arguments.forbidden') + ->identifier('methodCall.withoutNamedArguments') ->build(); } } diff --git a/src/PhpStan/ForbiddenFunctionCallRule.php b/src/PhpStan/ForbiddenFunctionCallRule.php index 3e54344..0a6201f 100644 --- a/src/PhpStan/ForbiddenFunctionCallRule.php +++ b/src/PhpStan/ForbiddenFunctionCallRule.php @@ -61,7 +61,7 @@ public function processNode(Node $node, Scope $scope): array if (\in_array($funcName, $this->forbiddenFunctions, true)) { return [ RuleErrorBuilder::message(\sprintf('The function "%s" is forbidden for usage.', $funcName)) - ->identifier('function.usage.forbidden') + ->identifier('functionCall') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenMethodCallRule.php b/src/PhpStan/ForbiddenMethodCallRule.php index c0b7547..a849bf6 100644 --- a/src/PhpStan/ForbiddenMethodCallRule.php +++ b/src/PhpStan/ForbiddenMethodCallRule.php @@ -78,11 +78,11 @@ public function processNode(Node $node, Scope $scope): array if ($varClassReflection && \is_a($varClassReflection->getName(), $forbiddenClass, true)) { if ('all' === $forbiddenMethods) { $errors[] = RuleErrorBuilder::message(\sprintf('Any method call from "%s" is forbidden.', $forbiddenClass)) - ->identifier('call.any.method.forbidden') + ->identifier('methodsCall') ->build(); } elseif (\in_array($node->name->toLowerString(), $forbiddenMethods, true)) { $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call.', $varClassReflection->getName(), $node->name->toString())) - ->identifier('call.method.forbidden') + ->identifier('methodCall') ->build(); } } diff --git a/src/PhpStan/ForbiddenNodeTypeRule.php b/src/PhpStan/ForbiddenNodeTypeRule.php index 91c0488..1ba4120 100644 --- a/src/PhpStan/ForbiddenNodeTypeRule.php +++ b/src/PhpStan/ForbiddenNodeTypeRule.php @@ -69,7 +69,7 @@ public function processNode(Node $node, Scope $scope): array { return [ RuleErrorBuilder::message($this->message) - ->identifier('node.usage.forbidden') + ->identifier('nodeCall') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php index 5f50a62..353f692 100644 --- a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php +++ b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php @@ -63,7 +63,7 @@ public function processNode(Node $node, Scope $scope): array if ($param->byRef) { return [ RuleErrorBuilder::message('Pass arguments by reference is forbidden.') - ->identifier('pass.by.reference.forbidden') + ->identifier('passArguments.byReference') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenSuppressErrorRule.php b/src/PhpStan/ForbiddenSuppressErrorRule.php index a79babc..c7d05ed 100644 --- a/src/PhpStan/ForbiddenSuppressErrorRule.php +++ b/src/PhpStan/ForbiddenSuppressErrorRule.php @@ -109,7 +109,7 @@ public function processNode(Node $node, Scope $scope): array return [ RuleErrorBuilder::message('Suppress error is forbidden.') - ->identifier('suppress.error.forbidden') + ->identifier('errorSuppress') ->build(), ]; } From e262aa17c74a0093682b3409dbfad7e7d09334cd Mon Sep 17 00:00:00 2001 From: denys_danylov Date: Thu, 23 Jan 2025 16:01:39 +0200 Subject: [PATCH 5/5] Updated identifiers in RuleErrorBuilder. --- src/PhpStan/AbstractNoNamedArgumentUsedRule.php | 2 +- src/PhpStan/ForbiddenFunctionCallRule.php | 2 +- src/PhpStan/ForbiddenMethodCallRule.php | 4 ++-- src/PhpStan/ForbiddenNodeTypeRule.php | 2 +- src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php | 2 +- src/PhpStan/ForbiddenSuppressErrorRule.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php index f018551..927b44b 100644 --- a/src/PhpStan/AbstractNoNamedArgumentUsedRule.php +++ b/src/PhpStan/AbstractNoNamedArgumentUsedRule.php @@ -72,7 +72,7 @@ public function processNode(Node $node, Scope $scope): array if ('all' === $forbiddenMethods || \in_array(\strtolower($methodName), $forbiddenMethods, true)) { if ($this->findNullableName($node)) { $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call without named arguments.', $className, $methodName)) - ->identifier('methodCall.withoutNamedArguments') + ->identifier('methodCall.withoutNamedArguments.forbidden') ->build(); } } diff --git a/src/PhpStan/ForbiddenFunctionCallRule.php b/src/PhpStan/ForbiddenFunctionCallRule.php index 0a6201f..d0636ae 100644 --- a/src/PhpStan/ForbiddenFunctionCallRule.php +++ b/src/PhpStan/ForbiddenFunctionCallRule.php @@ -61,7 +61,7 @@ public function processNode(Node $node, Scope $scope): array if (\in_array($funcName, $this->forbiddenFunctions, true)) { return [ RuleErrorBuilder::message(\sprintf('The function "%s" is forbidden for usage.', $funcName)) - ->identifier('functionCall') + ->identifier('functionCall.forbidden') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenMethodCallRule.php b/src/PhpStan/ForbiddenMethodCallRule.php index a849bf6..69a6f90 100644 --- a/src/PhpStan/ForbiddenMethodCallRule.php +++ b/src/PhpStan/ForbiddenMethodCallRule.php @@ -78,11 +78,11 @@ public function processNode(Node $node, Scope $scope): array if ($varClassReflection && \is_a($varClassReflection->getName(), $forbiddenClass, true)) { if ('all' === $forbiddenMethods) { $errors[] = RuleErrorBuilder::message(\sprintf('Any method call from "%s" is forbidden.', $forbiddenClass)) - ->identifier('methodsCall') + ->identifier('methodCall.forbidden') ->build(); } elseif (\in_array($node->name->toLowerString(), $forbiddenMethods, true)) { $errors[] = RuleErrorBuilder::message(\sprintf('The method "%s::%s" is forbidden to call.', $varClassReflection->getName(), $node->name->toString())) - ->identifier('methodCall') + ->identifier('methodCall.forbidden') ->build(); } } diff --git a/src/PhpStan/ForbiddenNodeTypeRule.php b/src/PhpStan/ForbiddenNodeTypeRule.php index 1ba4120..6d56ffe 100644 --- a/src/PhpStan/ForbiddenNodeTypeRule.php +++ b/src/PhpStan/ForbiddenNodeTypeRule.php @@ -69,7 +69,7 @@ public function processNode(Node $node, Scope $scope): array { return [ RuleErrorBuilder::message($this->message) - ->identifier('nodeCall') + ->identifier('nodeCall.forbidden') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php index 353f692..f619d0c 100644 --- a/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php +++ b/src/PhpStan/ForbiddenPassArgumentAsReferenceRule.php @@ -63,7 +63,7 @@ public function processNode(Node $node, Scope $scope): array if ($param->byRef) { return [ RuleErrorBuilder::message('Pass arguments by reference is forbidden.') - ->identifier('passArguments.byReference') + ->identifier('passArguments.byReference.forbidden') ->build(), ]; } diff --git a/src/PhpStan/ForbiddenSuppressErrorRule.php b/src/PhpStan/ForbiddenSuppressErrorRule.php index c7d05ed..3762547 100644 --- a/src/PhpStan/ForbiddenSuppressErrorRule.php +++ b/src/PhpStan/ForbiddenSuppressErrorRule.php @@ -109,7 +109,7 @@ public function processNode(Node $node, Scope $scope): array return [ RuleErrorBuilder::message('Suppress error is forbidden.') - ->identifier('errorSuppress') + ->identifier('errorSuppress.forbidden') ->build(), ]; }