diff --git a/src/Rules/RuleErrorBuilder.php b/src/Rules/RuleErrorBuilder.php index 9a99e89636..a838200800 100644 --- a/src/Rules/RuleErrorBuilder.php +++ b/src/Rules/RuleErrorBuilder.php @@ -221,7 +221,7 @@ public function treatPhpDocTypesAsCertainTip(): self public function identifier(string $identifier): self { if (!Error::validateIdentifier($identifier)) { - throw new ShouldNotHappenException(sprintf('Invalid identifier: %s', $identifier)); + throw new ShouldNotHappenException(sprintf('Invalid identifier: %s, error identifiers must match /%s/', $identifier, Error::PATTERN_IDENTIFIER)); } $this->properties['identifier'] = $identifier;