$it->
seek($foundAtIndex);
} return $target;
} /**
* Reconstructs a property path from a violation path and a form tree.
*/
private function reconstructPath(ViolationPath
$violationPath, FormInterface
$origin): ?RelativePath
{ $propertyPathBuilder =
new PropertyPathBuilder($violationPath);
$it =
$violationPath->
getIterator();
$scope =
$origin;
// Remember the current index in the builder
$i = 0;
// Expand elements that map to a form (like "children[address]")
for ($it->
rewind();
$it->
valid() &&
$it->
mapsForm();
$it->
next()) { if (!
$scope->
has($it->
current())) { // Scope relates to a form that does not exist
// Bail out