diff --git a/src/Rule/Nette/DoNotExtendNetteObjectRule.php b/src/Rule/Nette/DoNotExtendNetteObjectRule.php index 457ed9a..605614b 100644 --- a/src/Rule/Nette/DoNotExtendNetteObjectRule.php +++ b/src/Rule/Nette/DoNotExtendNetteObjectRule.php @@ -35,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array $classReflection->getDisplayName(), 'Nette\Object', 'Nette\SmartObject' - ))->build(), + ))->identifier('class.extendsNetteObject')->build(), ]; } diff --git a/src/Rule/Nette/RegularExpressionPatternRule.php b/src/Rule/Nette/RegularExpressionPatternRule.php index 35fea39..bee94ea 100644 --- a/src/Rule/Nette/RegularExpressionPatternRule.php +++ b/src/Rule/Nette/RegularExpressionPatternRule.php @@ -35,7 +35,9 @@ public function processNode(Node $node, Scope $scope): array continue; } - $errors[] = RuleErrorBuilder::message(sprintf('Regex pattern is invalid: %s', $errorMessage))->build(); + $errors[] = RuleErrorBuilder::message(sprintf('Regex pattern is invalid: %s', $errorMessage)) + ->identifier('regexp.pattern') + ->build(); } return $errors; diff --git a/src/Rule/Nette/RethrowExceptionRule.php b/src/Rule/Nette/RethrowExceptionRule.php index 6edcdfa..f11b1eb 100644 --- a/src/Rule/Nette/RethrowExceptionRule.php +++ b/src/Rule/Nette/RethrowExceptionRule.php @@ -8,6 +8,7 @@ use PhpParser\Node\Stmt\TryCatch; use PHPStan\Analyser\Scope; use PHPStan\Rules\Rule; +use PHPStan\Rules\RuleErrorBuilder; use PHPStan\Type\ObjectType; use PHPStan\Type\TypeCombinator; use Throwable; @@ -86,7 +87,7 @@ public function processNode(Node $node, Scope $scope): array } } - $messages[] = sprintf('Exception %s needs to be rethrown.', $exceptionName); + $messages[] = RuleErrorBuilder::message(sprintf('Exception %s needs to be rethrown.', $exceptionName))->identifier('nette.rethrowException')->build(); } return $messages;