10000 [Validator] Fix traverse option on Valid constraint when used as Attr… · symfony/symfony@4e5e1e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e5e1e0

Browse files
tobias-93Tobias Feijten
authored and
Tobias Feijten
committed
[Validator] Fix traverse option on Valid constraint when used as Attribute
1 parent 8d028be commit 4e5e1e0

File tree

1 file changed

+7
-0
lines changed
  • src/Symfony/Component/Validator/Constraints

1 file changed

+7
-0
lines changed

src/Symfony/Component/Validator/Constraints/Valid.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ class Valid extends Constraint
2424
{
2525
public $traverse = true;
2626

27+
public function __construct(array $options = null, array $groups = null, $payload = null, bool $traverse = null)
28+
{
29+
parent::__construct($options ?? [], $groups, $payload);
30+
31+
$this->traverse = $traverse ?? $this->traverse;
32+
}
33+
2734
public function __get(string $option)
2835
{
2936
if ('groups' === $option) {

0 commit comments

Comments
 (0)
0