comparison vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Node\Stmt;
4
5 use PhpParser\Node;
6
7 class Trait_ extends ClassLike
8 {
9 /**
10 * Constructs a trait node.
11 *
12 * @param string|Node\Identifier $name Name
13 * @param array $subNodes Array of the following optional subnodes:
14 * 'stmts' => array(): Statements
15 * @param array $attributes Additional attributes
16 */
17 public function __construct($name, array $subNodes = [], array $attributes = []) {
18 parent::__construct($attributes);
19 $this->name = \is_string($name) ? new Node\Identifier($name) : $name;
20 $this->stmts = $subNodes['stmts'] ?? [];
21 }
22
23 public function getSubNodeNames() : array {
24 return ['name', 'stmts'];
25 }
26
27 public function getType() : string {
28 return 'Stmt_Trait';
29 }
30 }