original_string: private function validateAlias(\DOMElement $alias, $file)
      {
          foreach ($alias->attributes as $name => $node) {
              if (!\in_array($name, ['alias', 'id', 'public'])) {
                  throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->getAttribute('id'), $file));
              }
          }
  
          foreach ($alias->childNodes as $child) {
              if (!$child instanceof \DOMElement || self::NS !== $child->namespaceURI) {
                  continue;
              }
              if (!\in_array($child->localName, ['deprecated'], true)) {
                  throw new InvalidArgumentException(sprintf('Invalid child element "%s" defined for alias "%s" in "%s".', $child->localName, $alias->getAttribute('id'), $file));
              }
          }
      }
code: private function validateAlias(\DOMElement $alias, $file)
      {
          foreach ($alias->attributes as $name => $node) {
              if (!\in_array($name, ['alias', 'id', 'public'])) {
                  throw new InvalidArgumentException(sprintf('Invalid attribute "%s" defined for alias "%s" in "%s".', $name, $alias->getAttribute('id'), $file));
              }
          }
  
          foreach ($alias->childNodes as $child) {
              if (!$child instanceof \DOMElement || self::NS !== $child->namespaceURI) {
                  continue;
              }
              if (!\in_array($child->localName, ['deprecated'], true)) {
                  throw new InvalidArgumentException(sprintf('Invalid child element "%s" defined for alias "%s" in "%s".', $child->localName, $alias->getAttribute('id'), $file));
              }
          }
      }
code_tokens: private function validateAlias ( \ DOMElement $ alias , $ file ) { foreach ( $ alias -> attributes as $ name => $ node ) { if ( ! \ in_array ( $ name , [ 'alias' , 'id' , 'public' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid attribute "%s" defined for alias "%s" in "%s".' , $ name , $ alias -> getAttribute ( 'id' ) , $ file ) ) ; } } foreach ( $ alias -> childNodes as $ child ) { if ( ! $ child instanceof \ DOMElement || self :: NS !== $ child -> namespaceURI ) { continue ; } if ( ! \ in_array ( $ child -> localName , [ 'deprecated' ] , true ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid child element "%s" defined for alias "%s" in "%s".' , $ child -> localName , $ alias -> getAttribute ( 'id' ) , $ file ) ) ; } } }
docstring: Validates an alias.
  
  @param \DOMElement $alias
  @param string      $file
docstring_tokens: Validates an alias .