$trait
$trait : \PhpParser\Node\Name
$trait : \PhpParser\Node\Name
$insteadof : array<mixed,\PhpParser\Node\Name>
__construct(\PhpParser\Node\Name $trait, string $method, array<mixed,\PhpParser\Node\Name> $insteadof, array $attributes = array())
Constructs a trait use precedence adaptation node.
\PhpParser\Node\Name | $trait | Trait name |
string | $method | Method name |
array<mixed,\PhpParser\Node\Name> | $insteadof | Overwritten traits |
array | $attributes | Additional attributes |
getDocComment() : null|\PhpParser\Comment\Doc
Gets the doc comment of the node.
The doc comment has to be the last comment associated with the node.
Doc comment object or null
None found |
setDocComment(\PhpParser\Comment\Doc $docComment)
Sets the doc comment of the node.
This will either replace an existing doc comment or add it to the comments array.
\PhpParser\Comment\Doc | $docComment | Doc comment to set |
None found |
setAttribute(string $key, mixed $value)
Sets an attribute on a node.
string | $key | |
mixed | $value |
None found |
hasAttribute(string $key) : boolean
Returns whether an attribute exists.
string | $key |
None found |
getAttribute(string $key, mixed $default = null) : mixed
Returns the value of an attribute.
string | $key | |
mixed | $default |
None found |
None found |
None found |
None found |
<?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 $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 = $method;
$this->insteadof = $insteadof;
}
public function getSubNodeNames() {
return array('trait', 'method', 'insteadof');
}
}