Skip to content

Commit 6c76813

Browse files
kalessilnicolas-grekas
authored andcommitted
SCA: consolidate non empty array checks across codebase
1 parent 6a9d39c commit 6c76813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Extension/Validator/Constraints/FormValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function validate($form, Constraint $constraint)
4848

4949
// Validate the data against its own constraints
5050
if ($form->isRoot() && (\is_object($data) || \is_array($data))) {
51-
if (\is_array($groups) && \count($groups) > 0 || $groups instanceof GroupSequence && \count($groups->groups) > 0) {
51+
if (($groups && \is_array($groups)) || ($groups instanceof GroupSequence && $groups->groups)) {
5252
$validator->atPath('data')->validate($form->getData(), null, $groups);
5353
}
5454
}

0 commit comments

Comments
 (0)