CodeExplorer parseNodes example
protected function parseNodes(array
$nodes): array
{ $values =
[];
foreach ($nodes as $name =>
$childNodes) { if (is_numeric($name) && \
is_array($childNodes) && 1 === \
count($childNodes)) { $options =
current($childNodes);
if (\
is_array($options)) { $options =
$this->
parseNodes($options);
} $values[] =
$this->
newConstraint(key($childNodes),
$options);
} else { if (\
is_array($childNodes)) { $childNodes =
$this->
parseNodes($childNodes);
} $values[$name] =
$childNodes;
} } protected function parseNodes(array
$nodes): array
{ $values =
[];
foreach ($nodes as $name =>
$childNodes) { if (is_numeric($name) && \
is_array($childNodes) && 1 === \
count($childNodes)) { $options =
current($childNodes);
if (\
is_array($options)) { $options =
$this->
parseNodes($options);
} $values[] =
$this->
newConstraint(key($childNodes),
$options);
} else { if (\
is_array($childNodes)) { $childNodes =
$this->
parseNodes($childNodes);
} $values[$name] =
$childNodes;
} }