original_string: protected function parseConstraints(\SimpleXMLElement $nodes)
      {
          $constraints = [];
  
          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 = [];
                  }
              } elseif (\strlen((string) $node) > 0) {
                  $options = XmlUtils::phpize(trim($node));
              } else {
                  $options = null;
              }
  
              $constraints[] = $this->newConstraint((string) $node['name'], $options);
          }
  
          return $constraints;
      }
code: protected function parseConstraints(\SimpleXMLElement $nodes)
      {
          $constraints = [];
  
          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 = [];
                  }
              } elseif (\strlen((string) $node) > 0) {
                  $options = XmlUtils::phpize(trim($node));
              } else {
                  $options = null;
              }
  
              $constraints[] = $this->newConstraint((string) $node['name'], $options);
          }
  
          return $constraints;
      }
code_tokens: protected function parseConstraints ( \ SimpleXMLElement $ nodes ) { $ constraints = [ ] ; 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 = [ ] ; } } elseif ( \ strlen ( ( string ) $ node ) > 0 ) { $ options = XmlUtils :: phpize ( trim ( $ node ) ) ; } else { $ options = null ; } $ constraints [ ] = $ this -> newConstraint ( ( string ) $ node [ 'name' ] , $ options ) ; } return $ constraints ; }
docstring: Parses a collection of "constraint" XML nodes.
  
  @param \SimpleXMLElement $nodes The XML nodes
  
  @return array The Constraint instances
docstring_tokens: Parses a collection of constraint XML nodes .