private function traitAdaptation() {
    /** @var NameNode $qualified_name */
    $qualified_name = $this->name();
    if ($qualified_name->childCount() === 1 && $this->currentType !== T_DOUBLE_COLON) {
      return $this->traitAlias($qualified_name);
    }
    $node = new TraitMethodReferenceNode();
    $node->addChild($qualified_name, 'traitName');
    $this->mustMatch(T_DOUBLE_COLON, $node);
    $this->mustMatch(T_STRING, $node, 'methodReference', TRUE);
    if ($this->currentType === T_AS) {
      return $this->traitAlias($node);
    }
    $method_reference_node = $node;
    $node = new TraitPrecedenceNode();
    $node->addChild($method_reference_node, 'traitMethodReference');
    $this->mustMatch(T_INSTEADOF, $node);
    $trait_names = new CommaListNode();
    do {
      $trait_names->addChild($this->name());
    } while ($this->tryMatch(',', $trait_names));
    $node->addChild($trait_names, 'traitNames');
    $this->endStatement($node);
    return $node;
  }
private function traitAdaptation() {
    /** @var NameNode $qualified_name */
    $qualified_name = $this->name();
    if ($qualified_name->childCount() === 1 && $this->currentType !== T_DOUBLE_COLON) {
      return $this->traitAlias($qualified_name);
    }
    $node = new TraitMethodReferenceNode();
    $node->addChild($qualified_name, 'traitName');
    $this->mustMatch(T_DOUBLE_COLON, $node);
    $this->mustMatch(T_STRING, $node, 'methodReference', TRUE);
    if ($this->currentType === T_AS) {
      return $this->traitAlias($node);
    }
    $method_reference_node = $node;
    $node = new TraitPrecedenceNode();
    $node->addChild($method_reference_node, 'traitMethodReference');
    $this->mustMatch(T_INSTEADOF, $node);
    $trait_names = new CommaListNode();
    do {
      $trait_names->addChild($this->name());
    } while ($this->tryMatch(',', $trait_names));
    $node->addChild($trait_names, 'traitNames');
    $this->endStatement($node);
    return $node;
  }
private function traitAdaptation ( ) { /** @var NameNode $qualified_name */ $ qualified_name = $ this -> name ( ) ; if ( $ qualified_name -> childCount ( ) === 1 && $ this -> currentType !== T_DOUBLE_COLON ) { return $ this -> traitAlias ( $ qualified_name ) ; } $ node = new TraitMethodReferenceNode ( ) ; $ node -> addChild ( $ qualified_name , 'traitName' ) ; $ this -> mustMatch ( T_DOUBLE_COLON , $ node ) ; $ this -> mustMatch ( T_STRING , $ node , 'methodReference' , TRUE ) ; if ( $ this -> currentType === T_AS ) { return $ this -> traitAlias ( $ node ) ; } $ method_reference_node = $ node ; $ node = new TraitPrecedenceNode ( ) ; $ node -> addChild ( $ method_reference_node , 'traitMethodReference' ) ; $ this -> mustMatch ( T_INSTEADOF , $ node ) ; $ trait_names = new CommaListNode ( ) ; do { $ trait_names -> addChild ( $ this -> name ( ) ) ; } while ( $ this -> tryMatch ( ',' , $ trait_names ) ) ; $ node -> addChild ( $ trait_names , 'traitNames' ) ; $ this -> endStatement ( $ node ) ; return $ node ; }
Parse a trait adaptation statement.
@return Node
Parse a trait adaptation statement .