Symfony\Component\Validator\Mapping\Loader\XmlFileLoader::parseConstraints PHP Метод

parseConstraints() защищенный Метод

Parses a collection of "constraint" XML nodes.
protected parseConstraints ( SimpleXMLElement $nodes ) : array
$nodes SimpleXMLElement The XML nodes
Результат array The Constraint instances
    protected function parseConstraints(\SimpleXMLElement $nodes)
    {
        $constraints = array();
        foreach ($nodes as $node) {
            if (count($node) > 0) {
                if (count($node->value) > 0) {
                    $options = $this->parseValues($node->value);
                } elseif (count($node->constraint) > 0) {
                    $options = $this->parseConstraints($node->constraint);
                } elseif (count($node->option) > 0) {
                    $options = $this->parseOptions($node->option);
                } else {
                    $options = array();
                }
            } elseif (strlen((string) $node) > 0) {
                $options = XmlUtils::phpize(trim($node));
            } else {
                $options = null;
            }
            $constraints[] = $this->newConstraint((string) $node['name'], $options);
        }
        return $constraints;
    }