@@ -352,9 +352,7 @@ private function validateObject($object, $propertyPath, array $groups, $traversa
352
352
* Validates each object in a collection against the constraints defined
353
353
* for their classes.
354
354
*
355
- * If the parameter $recursive is set to true, nested {@link \Traversable}
356
- * objects are iterated as well. Nested arrays are always iterated,
357
- * regardless of the value of $recursive.
355
+ * Nested arrays are also iterated.
358
356
*
359
357
* @param iterable $collection The collection
360
358
* @param string $propertyPath The current property path
@@ -365,8 +363,7 @@ private function validateEachObjectIn($collection, $propertyPath, array $groups,
365
363
{
366
364
foreach ($ collection as $ key => $ value ) {
367
365
if (\is_array ($ value )) {
368
- // Arrays are always cascaded, independent of the specified
369
- // traversal strategy
366
+ // Also traverse nested arrays
370
367
$ this ->validateEachObjectIn (
371
368
$ value ,
372
369
$ propertyPath .'[ ' .$ key .'] ' ,
@@ -596,7 +593,8 @@ private function validateClassNode($object, $cacheKey, ClassMetadataInterface $m
596
593
* in the passed metadata object. Then, if the value is an instance of
597
594
* {@link \Traversable} and the selected traversal strategy permits it,
598
595
* the value is traversed and each nested object validated against its own
599
- * constraints. Arrays are always traversed.
596
+ * constraints. If the value is an array, it is traversed regardless of
597
+ * the given strategy.
600
598
*
601
599
* @param mixed $value The validated value
602
600
* @param object|null $object The current object
0 commit comments