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