mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-14 01:57:26 +01:00
a6846e3b71
The parser will now always generate Identifier nodes (for non-namespaced identifiers). This obsoletes the useIdentifierNodes parser option. Node constructors still accepts strings and will implicitly create an Identifier wrapper. Identifier implement __toString(), so that outside of strict-mode many things continue to work without changes.
31 lines
966 B
PHP
31 lines
966 B
PHP
<?php
|
|
|
|
namespace PhpParser\Node\Stmt\TraitUseAdaptation;
|
|
|
|
use PhpParser\Node;
|
|
|
|
class Precedence extends Node\Stmt\TraitUseAdaptation
|
|
{
|
|
/** @var Node\Name[] Overwritten traits */
|
|
public $insteadof;
|
|
|
|
/**
|
|
* Constructs a trait use precedence adaptation node.
|
|
*
|
|
* @param Node\Name $trait Trait name
|
|
* @param string|Node\Identifier $method Method name
|
|
* @param Node\Name[] $insteadof Overwritten traits
|
|
* @param array $attributes Additional attributes
|
|
*/
|
|
public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = array()) {
|
|
parent::__construct($attributes);
|
|
$this->trait = $trait;
|
|
$this->method = \is_string($method) ? new Node\Identifier($method) : $method;
|
|
$this->insteadof = $insteadof;
|
|
}
|
|
|
|
public function getSubNodeNames() {
|
|
return array('trait', 'method', 'insteadof');
|
|
}
|
|
}
|