isValid()) { return; } $errors = []; foreach ($node->messages() as $message) { if ($message->isError()) { $errors[] = (string)$message; } } if (count($errors) > 0) { yield $node->path() => "{$node->path()}: " . implode(' / ', $errors); } foreach ($node->children() as $child) { yield from $errorFinder($child, $errorFinder); } }; $list = iterator_to_array($errorFinder($error->node(), $errorFinder)); self::fail(implode(' — ', $list)); } }