PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.5.1
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.5.1
0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 All 33 releases
code-engine / vendor / nikic / php-parser / lib / PhpParser / Node / Stmt / ClassConst.php

ClassConst.php in Code Engine – PHP Snippets, AI Functions & Automation for WordPress 0.5.1, at vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php

78 lines 2.1 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\Modifiers;
6 use PhpParser\Node;
7
8 class ClassConst extends Node\Stmt {
9 /** @var int Modifiers */
10 public int $flags;
11 /** @var Node\Const_[] Constant declarations */
12 public array $consts;
13 /** @var Node\AttributeGroup[] PHP attribute groups */
14 public array $attrGroups;
15 /** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */
16 public ?Node $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<string, mixed> $attributes Additional attributes
24 * @param list<Node\AttributeGroup> $attrGroups PHP attribute groups
25 * @param null|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 ?Node $type = null
33 ) {
34 $this->attributes = $attributes;
35 $this->flags = $flags;
36 $this->consts = $consts;
37 $this->attrGroups = $attrGroups;
38 $this->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 public function isPublic(): bool {
49 return ($this->flags & Modifiers::PUBLIC) !== 0
50 || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;
51 }
52
53 /**
54 * Whether constant is protected.
55 */
56 public function isProtected(): bool {
57 return (bool) ($this->flags & Modifiers::PROTECTED);
58 }
59
60 /**
61 * Whether constant is private.
62 */
63 public function isPrivate(): bool {
64 return (bool) ($this->flags & Modifiers::PRIVATE);
65 }
66
67 /**
68 * Whether constant is final.
69 */
70 public function isFinal(): bool {
71 return (bool) ($this->flags & Modifiers::FINAL);
72 }
73
74 public function getType(): string {
75 return 'Stmt_ClassConst';
76 }
77 }
78