Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7432601

Browse filesBrowse files
committed
bug #33834 [Validator] Fix ValidValidator group cascading usage (fancyweb)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] Fix ValidValidator group cascading usage | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `$this->context->getGroup()` returns `string` or `null`. `ContextualValidatorInterface::validate()` 3rd argument accepts an array but it must not contain `null` (its contract doesn't allow it). If it does, it will fail in `RecursiveContextualValidator::validateInGroup()` for example because of the `string` scalar type on the `$group` argument. (on 4.4) Note that in our "common" usage of the `Valid` constraint, the group in its validator will never be `null` because this constraint has a special treatment. However, if this validator is reused in a custom way, it can fail. Commits ------- 72684b0 [Validator] Fix ValidValidator group cascading usage
2 parents 718fb38 + 72684b0 commit 7432601
Copy full SHA for 7432601

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Validator/Constraints/ValidValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/ValidValidator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function validate($value, Constraint $constraint)
3333
$this->context
3434
->getValidator()
3535
->inContext($this->context)
36-
->validate($value, null, [$this->context->getGroup()]);
36+
->validate($value, null, $this->context->getGroup());
3737
}
3838
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.