Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23294e5

Browse files
committed
bug #21155 [Validator] Check cascasdedGroups for being countable (scaytrase)
This PR was squashed before being merged into the 2.7 branch (closes #21155). Discussion ---------- [Validator] Check cascasdedGroups for being countable Prevents notice for PHP 7.2 | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | Just repeated for this place #20859 Waiting travis to fill in the `Tests pass` field `cascasdedGroups` can be null at this point (according to failures and phpdoc) Commits ------- 8fa45a1 [Validator] Check cascasdedGroups for being countable
2 parents e18f47f + 8fa45a1 commit 23294e5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,9 +746,7 @@ private function validateGenericNode($value, $object, $cacheKey, MetadataInterfa
746746
// The $cascadedGroups property is set, if the "Default" group is
747747
// overridden by a group sequence
748748
// See validateClassNode()
749-
$cascadedGroups = count($cascadedGroups) > 0
750-
? $cascadedGroups
751-
: $groups;
749+
$cascadedGroups = null !== $cascadedGroups && count($cascadedGroups) > 0 ? $cascadedGroups : $groups;
752750

753751
if (is_array($value)) {
754752
// Arrays are always traversed, independent of the specified

0 commit comments

Comments
 (0)