From 342155bd47d5299d40299c59659707f5f3393bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= Date: Tue, 14 May 2024 20:28:51 +0200 Subject: [PATCH] add error identifiers (#4) --- src/SealedClassRule.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SealedClassRule.php b/src/SealedClassRule.php index 486e3b1..b812df9 100644 --- a/src/SealedClassRule.php +++ b/src/SealedClassRule.php @@ -48,7 +48,9 @@ public function processNode(Node $node, Scope $scope): array if ( ! $classReflection->isClass() && ! $classReflection->isInterface()) { $messages[] = RuleErrorBuilder::message( '#[Sealed] can only be used over a class or an interface.' - )->build(); + ) + ->identifier('sealedClass.invalidTarget') + ->build(); return $messages; } @@ -77,7 +79,9 @@ public function processNode(Node $node, Scope $scope): array $permittedClassName, $classReflection->isClass() ? 'class' : 'interface', $classReflection->getName(), - ))->build(); + )) + ->identifier('sealedClass.notDirectSubtype') + ->build(); } return $messages;