PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / ClassConst.php

ClassConst.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php

86 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 /** @var int Modifiers */
10 public $flags;
11 /** @var Node\Const_[] Constant declarations */
12 public $consts;
13 /** @var Node\AttributeGroup[] PHP attribute groups */
14 public $attrGroups;
15 /** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */
16 public $type;
17
18 /**
19 * Constructs a class const list node.
20 *
21 * @param Node\Const_[] $consts Constant declarations
22 * @param int $flags Modifiers
23 * @param array $attributes Additional attributes
24 * @param Node\AttributeGroup[] $attrGroups PHP attribute groups
25 * @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration
26 */
27 public function __construct(
28 array $consts,
29 int $flags = 0,
30 array $attributes = [],
31 array $attrGroups = [],
32 $type = null
33 ) {
34 $this->attributes = $attributes;
35 $this->flags = $flags;
36 $this->consts = $consts;
37 $this->attrGroups = $attrGroups;
38 $this->type = \is_string($type) ? new Node\Identifier($type) : $type;
39 }
40
41 public function getSubNodeNames() : array {
42 return ['attrGroups', 'flags', 'type', 'consts'];
43 }
44
45 /**
46 * Whether constant is explicitly or implicitly public.
47 *
48 * @return bool
49 */
50 public function isPublic() : bool {
51 return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0
52 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
53 }
54
55 /**
56 * Whether constant is protected.
57 *
58 * @return bool
59 */
60 public function isProtected() : bool {
61 return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
62 }
63
64 /**
65 * Whether constant is private.
66 *
67 * @return bool
68 */
69 public function isPrivate() : bool {
70 return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
71 }
72
73 /**
74 * Whether constant is final.
75 *
76 * @return bool
77 */
78 public function isFinal() : bool {
79 return (bool) ($this->flags & Class_::MODIFIER_FINAL);
80 }
81
82 public function getType() : string {
83 return 'Stmt_ClassConst';
84 }
85 }
86