1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser\Node; |
4: | |
5: | use PhpParser\NodeAbstract; |
6: | |
7: | class Param extends NodeAbstract |
8: | { |
9: | |
10: | public $type; |
11: | |
12: | public $byRef; |
13: | |
14: | public $variadic; |
15: | |
16: | public $var; |
17: | |
18: | public $default; |
19: | |
20: | public $flags; |
21: | |
22: | public $attrGroups; |
23: | |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | |
31: | |
32: | |
33: | |
34: | |
35: | |
36: | public function __construct( |
37: | $var, ?Expr $default = null, $type = null, |
38: | bool $byRef = false, bool $variadic = false, |
39: | array $attributes = [], |
40: | int $flags = 0, |
41: | array $attrGroups = [] |
42: | ) { |
43: | $this->attributes = $attributes; |
44: | $this->type = \is_string($type) ? new Identifier($type) : $type; |
45: | $this->byRef = $byRef; |
46: | $this->variadic = $variadic; |
47: | $this->var = $var; |
48: | $this->default = $default; |
49: | $this->flags = $flags; |
50: | $this->attrGroups = $attrGroups; |
51: | } |
52: | |
53: | public function getSubNodeNames() : array { |
54: | return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; |
55: | } |
56: | |
57: | public function getType() : string { |
58: | return 'Param'; |
59: | } |
60: | } |
61: | |