Skip to content

Commit

Permalink
add error identifiers (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiripudil authored May 14, 2024
1 parent 15687cd commit 342155b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SealedClassRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 342155b

Please sign in to comment.