2017-08-18 22:57:27 +02:00
|
|
|
<?php declare(strict_types=1);
|
2014-02-06 14:44:16 +01:00
|
|
|
|
|
|
|
namespace PhpParser\Node\Stmt\TraitUseAdaptation;
|
|
|
|
|
|
|
|
use PhpParser\Node;
|
|
|
|
|
|
|
|
class Precedence extends Node\Stmt\TraitUseAdaptation
|
|
|
|
{
|
2015-02-28 18:44:28 +01:00
|
|
|
/** @var Node\Name[] Overwritten traits */
|
|
|
|
public $insteadof;
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
/**
|
|
|
|
* Constructs a trait use precedence adaptation node.
|
|
|
|
*
|
2017-04-28 19:09:39 +02:00
|
|
|
* @param Node\Name $trait Trait name
|
|
|
|
* @param string|Node\Identifier $method Method name
|
|
|
|
* @param Node\Name[] $insteadof Overwritten traits
|
|
|
|
* @param array $attributes Additional attributes
|
2014-02-06 14:44:16 +01:00
|
|
|
*/
|
2017-08-13 14:06:08 +02:00
|
|
|
public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = []) {
|
2015-05-02 22:17:34 +02:00
|
|
|
parent::__construct($attributes);
|
2015-02-28 18:44:28 +01:00
|
|
|
$this->trait = $trait;
|
2017-04-28 19:09:39 +02:00
|
|
|
$this->method = \is_string($method) ? new Node\Identifier($method) : $method;
|
2015-02-28 18:44:28 +01:00
|
|
|
$this->insteadof = $insteadof;
|
|
|
|
}
|
|
|
|
|
2017-04-28 21:40:59 +02:00
|
|
|
public function getSubNodeNames() : array {
|
2017-08-13 14:06:08 +02:00
|
|
|
return ['trait', 'method', 'insteadof'];
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
2017-11-12 21:25:57 +01:00
|
|
|
|
|
|
|
function getType() : string {
|
|
|
|
return 'Stmt_TraitUseAdaptation_Precedence';
|
|
|
|
}
|
2015-02-28 18:44:28 +01:00
|
|
|
}
|