You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#52867 [Validator] Only trigger deprecation when Validator annotations are used (HypeMC)
This PR was merged into the 6.4 branch.
Discussion
----------
[Validator] Only trigger deprecation when Validator annotations are used
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fixsymfony#52828
| License | MIT
The deprecations are now triggered only if one of the annotations is from the validator component.
Commits
-------
83a8cad [Validator] Only trigger deprecation when Validator annotations are used
Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -118,13 +118,13 @@ private function getAnnotations(\ReflectionMethod|\ReflectionClass|\ReflectionPr
118
118
$annotations = [];
119
119
120
120
if ($reflectioninstanceof \ReflectionClass && $annotations = $this->reader->getClassAnnotations($reflection)) {
121
-
trigger_deprecation('symfony/validator', '6.4', 'Class "%s" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.', $reflection->getName());
if ($reflectioninstanceof \ReflectionMethod && $annotations = $this->reader->getMethodAnnotations($reflection)) {
124
-
trigger_deprecation('symfony/validator', '6.4', 'Method "%s::%s()" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.', $reflection->getDeclaringClass()->getName(), $reflection->getName());
if ($reflectioninstanceof \ReflectionProperty && $annotations = $this->reader->getPropertyAnnotations($reflection)) {
127
-
trigger_deprecation('symfony/validator', '6.4', 'Property "%s::$%s" uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.', $reflection->getDeclaringClass()->getName(), $reflection->getName());
trigger_deprecation('symfony/validator', '6.4', sprintf('%s uses Doctrine Annotations to configure validation constraints, which is deprecated. Use PHP attributes instead.', $messagePrefix));
0 commit comments