Skip to content

Commit 2505e94

Browse files
Seldaekondrejmirtes
authored andcommitted
Add hint as to what might be wrong when invalid identifiers are used
1 parent 998f817 commit 2505e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/RuleErrorBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function treatPhpDocTypesAsCertainTip(): self
221221
public function identifier(string $identifier): self
222222
{
223223
if (!Error::validateIdentifier($identifier)) {
224-
throw new ShouldNotHappenException(sprintf('Invalid identifier: %s', $identifier));
224+
throw new ShouldNotHappenException(sprintf('Invalid identifier: %s, error identifiers must match /%s/', $identifier, Error::PATTERN_IDENTIFIER));
225225
}
226226

227227
$this->properties['identifier'] = $identifier;

0 commit comments

Comments
 (0)