12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php declare(strict_types=1);
- namespace PhpParser\Node\Stmt;
- use PhpParser\Modifiers;
- use PhpParser\Node;
- use PhpParser\Node\ComplexType;
- use PhpParser\Node\Identifier;
- use PhpParser\Node\Name;
- use PhpParser\Node\PropertyItem;
- class Property extends Node\Stmt {
-
- public int $flags;
-
- public array $props;
-
- public ?Node $type;
-
- public array $attrGroups;
-
- public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = []) {
- $this->attributes = $attributes;
- $this->flags = $flags;
- $this->props = $props;
- $this->type = $type;
- $this->attrGroups = $attrGroups;
- }
- public function getSubNodeNames(): array {
- return ['attrGroups', 'flags', 'type', 'props'];
- }
-
- public function isPublic(): bool {
- return ($this->flags & Modifiers::PUBLIC) !== 0
- || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;
- }
-
- public function isProtected(): bool {
- return (bool) ($this->flags & Modifiers::PROTECTED);
- }
-
- public function isPrivate(): bool {
- return (bool) ($this->flags & Modifiers::PRIVATE);
- }
-
- public function isStatic(): bool {
- return (bool) ($this->flags & Modifiers::STATIC);
- }
-
- public function isReadonly(): bool {
- return (bool) ($this->flags & Modifiers::READONLY);
- }
- public function getType(): string {
- return 'Stmt_Property';
- }
- }
|