Skip to content

Commit f212e05

Browse files
committed
minor #39534 Normalize exceptions messages containing methods references (ogizanagi)
This PR was merged into the 4.4 branch. Discussion ---------- Normalize exceptions messages containing methods references | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix symfony/symfony#39399 (comment) <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | N/A Normalizes across the codebase any exception message mentioning methods to contain a trailing `()` (Seems OK on 5.1 and 5.2 branch after this on is merged up) Commits ------- e2da2acd6d Normalize exceptions messages containing methods references
2 parents d1118f2 + 3e2dca4 commit f212e05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Mapping/Loader/AnnotationLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
7777
if (preg_match('/^(get|is|has)(.+)$/i', $method->name, $matches)) {
7878
$metadata->addGetterMethodConstraint(lcfirst($matches[2]), $matches[0], $constraint);
7979
} else {
80-
throw new MappingException(sprintf('The constraint on "%s::%s" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name));
80+
throw new MappingException(sprintf('The constraint on "%s::%s()" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name));
8181
}
8282
}
8383

0 commit comments

Comments
 (0)