From 0364cb5e31c19b03b5000b346f3c73b987e889d5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 12 Jul 2024 10:12:51 +0200 Subject: [PATCH] Add hint as to what might be wrong when invalid identifiers are used --- src/Rules/RuleErrorBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;