Parses a collection of YAML nodes
array $nodes The YAML nodes:
array An array of values or Constraint instances
protected function parseNodes(array $nodes) {
$values = array();
foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && is_array($childNodes) && count($childNodes) == 1) {
$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;
}
}
return $values;
}