1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser\Node\Stmt; |
4: | |
5: | use PhpParser\Node; |
6: | |
7: | class ClassConst extends Node\Stmt |
8: | { |
9: | |
10: | public $flags; |
11: | |
12: | public $consts; |
13: | |
14: | public $attrGroups; |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | |
22: | |
23: | |
24: | public function __construct( |
25: | array $consts, |
26: | int $flags = 0, |
27: | array $attributes = [], |
28: | array $attrGroups = [] |
29: | ) { |
30: | $this->attributes = $attributes; |
31: | $this->flags = $flags; |
32: | $this->consts = $consts; |
33: | $this->attrGroups = $attrGroups; |
34: | } |
35: | |
36: | public function getSubNodeNames() : array { |
37: | return ['attrGroups', 'flags', 'consts']; |
38: | } |
39: | |
40: | |
41: | |
42: | |
43: | |
44: | |
45: | public function isPublic() : bool { |
46: | return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 |
47: | || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; |
48: | } |
49: | |
50: | |
51: | |
52: | |
53: | |
54: | |
55: | public function isProtected() : bool { |
56: | return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); |
57: | } |
58: | |
59: | |
60: | |
61: | |
62: | |
63: | |
64: | public function isPrivate() : bool { |
65: | return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); |
66: | } |
67: | |
68: | |
69: | |
70: | |
71: | |
72: | |
73: | public function isFinal() : bool { |
74: | return (bool) ($this->flags & Class_::MODIFIER_FINAL); |
75: | } |
76: | |
77: | public function getType() : string { |
78: | return 'Stmt_ClassConst'; |
79: | } |
80: | } |
81: | |