Chris@13
|
1 <?php declare(strict_types=1);
|
Chris@0
|
2
|
Chris@0
|
3 namespace PhpParser\Node\Stmt\TraitUseAdaptation;
|
Chris@0
|
4
|
Chris@0
|
5 use PhpParser\Node;
|
Chris@0
|
6
|
Chris@0
|
7 class Alias extends Node\Stmt\TraitUseAdaptation
|
Chris@0
|
8 {
|
Chris@0
|
9 /** @var null|int New modifier */
|
Chris@0
|
10 public $newModifier;
|
Chris@13
|
11 /** @var null|Node\Identifier New name */
|
Chris@0
|
12 public $newName;
|
Chris@0
|
13
|
Chris@0
|
14 /**
|
Chris@0
|
15 * Constructs a trait use precedence adaptation node.
|
Chris@0
|
16 *
|
Chris@13
|
17 * @param null|Node\Name $trait Trait name
|
Chris@13
|
18 * @param string|Node\Identifier $method Method name
|
Chris@13
|
19 * @param null|int $newModifier New modifier
|
Chris@13
|
20 * @param null|string|Node\Identifier $newName New name
|
Chris@13
|
21 * @param array $attributes Additional attributes
|
Chris@0
|
22 */
|
Chris@13
|
23 public function __construct($trait, $method, $newModifier, $newName, array $attributes = []) {
|
Chris@0
|
24 parent::__construct($attributes);
|
Chris@0
|
25 $this->trait = $trait;
|
Chris@13
|
26 $this->method = \is_string($method) ? new Node\Identifier($method) : $method;
|
Chris@0
|
27 $this->newModifier = $newModifier;
|
Chris@13
|
28 $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName;
|
Chris@0
|
29 }
|
Chris@0
|
30
|
Chris@13
|
31 public function getSubNodeNames() : array {
|
Chris@13
|
32 return ['trait', 'method', 'newModifier', 'newName'];
|
Chris@13
|
33 }
|
Chris@13
|
34
|
Chris@13
|
35 public function getType() : string {
|
Chris@13
|
36 return 'Stmt_TraitUseAdaptation_Alias';
|
Chris@0
|
37 }
|
Chris@0
|
38 }
|