1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser\Node\Stmt; |
4: | |
5: | use PhpParser\Node; |
6: | |
7: | class Enum_ extends ClassLike |
8: | { |
9: | |
10: | public $scalarType; |
11: | |
12: | public $implements; |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | public function __construct($name, array $subNodes = [], array $attributes = []) { |
24: | $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
25: | $this->scalarType = $subNodes['scalarType'] ?? null; |
26: | $this->implements = $subNodes['implements'] ?? []; |
27: | $this->stmts = $subNodes['stmts'] ?? []; |
28: | $this->attrGroups = $subNodes['attrGroups'] ?? []; |
29: | |
30: | parent::__construct($attributes); |
31: | } |
32: | |
33: | public function getSubNodeNames() : array { |
34: | return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; |
35: | } |
36: | |
37: | public function getType() : string { |
38: | return 'Stmt_Enum'; |
39: | } |
40: | } |
41: | |