protected function parseNodes(array $nodes)
    {
        $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;
            }
        }

        return $values;
    }
protected function parseNodes(array $nodes)
    {
        $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;
            }
        }

        return $values;
    }
protected function parseNodes ( array $ nodes ) { $ 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 ; } } return $ values ; }
Parses a collection of YAML nodes.

@param array $nodes The YAML nodes

@return array An array of values or Constraint instances
Parses a collection of YAML nodes .