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

Skip to content

Commit 297ba4f

Browse files
committed
[Validator] Added a note why scalars are passed to cascadeObject() in NodeTraverser
1 parent 9b07b0c commit 297ba4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Validator/NodeTraverser/NodeTraverser.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ private function traverseNode(Node $node)
113113
$traversalStrategy
114114
);
115115
} elseif ($cascadingStrategy & CascadingStrategy::CASCADE) {
116+
// If the value is a scalar, pass it anyway, because we want
117+
// a NoSuchMetadataException to be thrown in that case
118+
// (BC with Symfony < 2.5)
116119
$this->cascadeObject(
117120
$node->value,
118121
$node->propertyPath,

0 commit comments

Comments
 (0)