Closed
Closed
Copy link
Description
Symfony version(s) affected
5.4
Description
The traverse
option doesn't work when using a Valid
constraint as Attribute.
How to reproduce
use Symfony\Component\Validator\Constraints as Assert;
// var will not be traversed
class SomeAnnotationClass {
/** @Assert\Valid(traverse=false) */
private $someVar;
}
// var WILL be traversed
class SomeAttributeClass {
#[Assert\Valid(traverse: false)]
private $someVar;
}
Possible Solution
The constructor of Symfony\Component\Validator\Constraints\Valid
isn't overridden (like many other constraints) to add the traverse
named option.
Additional Context
No response