@@ -7,25 +7,25 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Label extends Stmt |
| 9 | 9 | { |
| 10 | - /** @var Identifier Name */ |
|
| 11 | - public $name; |
|
| 10 | + /** @var Identifier Name */ |
|
| 11 | + public $name; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Constructs a label node. |
|
| 15 | - * |
|
| 16 | - * @param string|Identifier $name Name |
|
| 17 | - * @param array $attributes Additional attributes |
|
| 18 | - */ |
|
| 19 | - public function __construct($name, array $attributes = []) { |
|
| 20 | - $this->attributes = $attributes; |
|
| 21 | - $this->name = \is_string($name) ? new Identifier($name) : $name; |
|
| 22 | - } |
|
| 13 | + /** |
|
| 14 | + * Constructs a label node. |
|
| 15 | + * |
|
| 16 | + * @param string|Identifier $name Name |
|
| 17 | + * @param array $attributes Additional attributes |
|
| 18 | + */ |
|
| 19 | + public function __construct($name, array $attributes = []) { |
|
| 20 | + $this->attributes = $attributes; |
|
| 21 | + $this->name = \is_string($name) ? new Identifier($name) : $name; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public function getSubNodeNames() : array { |
|
| 25 | - return ['name']; |
|
| 26 | - } |
|
| 24 | + public function getSubNodeNames() : array { |
|
| 25 | + return ['name']; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - public function getType() : string { |
|
| 29 | - return 'Stmt_Label'; |
|
| 30 | - } |
|
| 28 | + public function getType() : string { |
|
| 29 | + return 'Stmt_Label'; |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use PhpParser\Node\Identifier; |
| 6 | 6 | use PhpParser\Node\Stmt; |
| 7 | 7 | |
| 8 | -class Label extends Stmt |
|
| 9 | -{ |
|
| 8 | +class Label extends Stmt { |
|
| 10 | 9 | /** @var Identifier Name */ |
| 11 | 10 | public $name; |
| 12 | 11 | |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Throw_ extends Node\Stmt |
| 8 | 8 | { |
| 9 | - /** @var Node\Expr Expression */ |
|
| 10 | - public $expr; |
|
| 9 | + /** @var Node\Expr Expression */ |
|
| 10 | + public $expr; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Constructs a legacy throw statement node. |
|
| 14 | - * |
|
| 15 | - * @param Node\Expr $expr Expression |
|
| 16 | - * @param array $attributes Additional attributes |
|
| 17 | - */ |
|
| 18 | - public function __construct(Node\Expr $expr, array $attributes = []) { |
|
| 19 | - $this->attributes = $attributes; |
|
| 20 | - $this->expr = $expr; |
|
| 21 | - } |
|
| 12 | + /** |
|
| 13 | + * Constructs a legacy throw statement node. |
|
| 14 | + * |
|
| 15 | + * @param Node\Expr $expr Expression |
|
| 16 | + * @param array $attributes Additional attributes |
|
| 17 | + */ |
|
| 18 | + public function __construct(Node\Expr $expr, array $attributes = []) { |
|
| 19 | + $this->attributes = $attributes; |
|
| 20 | + $this->expr = $expr; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public function getSubNodeNames() : array { |
|
| 24 | - return ['expr']; |
|
| 25 | - } |
|
| 23 | + public function getSubNodeNames() : array { |
|
| 24 | + return ['expr']; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function getType() : string { |
|
| 28 | - return 'Stmt_Throw'; |
|
| 29 | - } |
|
| 27 | + public function getType() : string { |
|
| 28 | + return 'Stmt_Throw'; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -6,42 +6,42 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Foreach_ extends Node\Stmt |
| 8 | 8 | { |
| 9 | - /** @var Node\Expr Expression to iterate */ |
|
| 10 | - public $expr; |
|
| 11 | - /** @var null|Node\Expr Variable to assign key to */ |
|
| 12 | - public $keyVar; |
|
| 13 | - /** @var bool Whether to assign value by reference */ |
|
| 14 | - public $byRef; |
|
| 15 | - /** @var Node\Expr Variable to assign value to */ |
|
| 16 | - public $valueVar; |
|
| 17 | - /** @var Node\Stmt[] Statements */ |
|
| 18 | - public $stmts; |
|
| 9 | + /** @var Node\Expr Expression to iterate */ |
|
| 10 | + public $expr; |
|
| 11 | + /** @var null|Node\Expr Variable to assign key to */ |
|
| 12 | + public $keyVar; |
|
| 13 | + /** @var bool Whether to assign value by reference */ |
|
| 14 | + public $byRef; |
|
| 15 | + /** @var Node\Expr Variable to assign value to */ |
|
| 16 | + public $valueVar; |
|
| 17 | + /** @var Node\Stmt[] Statements */ |
|
| 18 | + public $stmts; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Constructs a foreach node. |
|
| 22 | - * |
|
| 23 | - * @param Node\Expr $expr Expression to iterate |
|
| 24 | - * @param Node\Expr $valueVar Variable to assign value to |
|
| 25 | - * @param array $subNodes Array of the following optional subnodes: |
|
| 26 | - * 'keyVar' => null : Variable to assign key to |
|
| 27 | - * 'byRef' => false : Whether to assign value by reference |
|
| 28 | - * 'stmts' => array(): Statements |
|
| 29 | - * @param array $attributes Additional attributes |
|
| 30 | - */ |
|
| 31 | - public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { |
|
| 32 | - $this->attributes = $attributes; |
|
| 33 | - $this->expr = $expr; |
|
| 34 | - $this->keyVar = $subNodes['keyVar'] ?? null; |
|
| 35 | - $this->byRef = $subNodes['byRef'] ?? false; |
|
| 36 | - $this->valueVar = $valueVar; |
|
| 37 | - $this->stmts = $subNodes['stmts'] ?? []; |
|
| 38 | - } |
|
| 20 | + /** |
|
| 21 | + * Constructs a foreach node. |
|
| 22 | + * |
|
| 23 | + * @param Node\Expr $expr Expression to iterate |
|
| 24 | + * @param Node\Expr $valueVar Variable to assign value to |
|
| 25 | + * @param array $subNodes Array of the following optional subnodes: |
|
| 26 | + * 'keyVar' => null : Variable to assign key to |
|
| 27 | + * 'byRef' => false : Whether to assign value by reference |
|
| 28 | + * 'stmts' => array(): Statements |
|
| 29 | + * @param array $attributes Additional attributes |
|
| 30 | + */ |
|
| 31 | + public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { |
|
| 32 | + $this->attributes = $attributes; |
|
| 33 | + $this->expr = $expr; |
|
| 34 | + $this->keyVar = $subNodes['keyVar'] ?? null; |
|
| 35 | + $this->byRef = $subNodes['byRef'] ?? false; |
|
| 36 | + $this->valueVar = $valueVar; |
|
| 37 | + $this->stmts = $subNodes['stmts'] ?? []; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public function getSubNodeNames() : array { |
|
| 41 | - return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; |
|
| 42 | - } |
|
| 40 | + public function getSubNodeNames() : array { |
|
| 41 | + return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function getType() : string { |
|
| 45 | - return 'Stmt_Foreach'; |
|
| 46 | - } |
|
| 44 | + public function getType() : string { |
|
| 45 | + return 'Stmt_Foreach'; |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -7,131 +7,131 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Class_ extends ClassLike |
| 9 | 9 | { |
| 10 | - const MODIFIER_PUBLIC = 1; |
|
| 11 | - const MODIFIER_PROTECTED = 2; |
|
| 12 | - const MODIFIER_PRIVATE = 4; |
|
| 13 | - const MODIFIER_STATIC = 8; |
|
| 14 | - const MODIFIER_ABSTRACT = 16; |
|
| 15 | - const MODIFIER_FINAL = 32; |
|
| 16 | - const MODIFIER_READONLY = 64; |
|
| 17 | - |
|
| 18 | - const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 |
|
| 19 | - |
|
| 20 | - /** @var int Type */ |
|
| 21 | - public $flags; |
|
| 22 | - /** @var null|Node\Name Name of extended class */ |
|
| 23 | - public $extends; |
|
| 24 | - /** @var Node\Name[] Names of implemented interfaces */ |
|
| 25 | - public $implements; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * Constructs a class node. |
|
| 29 | - * |
|
| 30 | - * @param string|Node\Identifier|null $name Name |
|
| 31 | - * @param array $subNodes Array of the following optional subnodes: |
|
| 32 | - * 'flags' => 0 : Flags |
|
| 33 | - * 'extends' => null : Name of extended class |
|
| 34 | - * 'implements' => array(): Names of implemented interfaces |
|
| 35 | - * 'stmts' => array(): Statements |
|
| 36 | - * 'attrGroups' => array(): PHP attribute groups |
|
| 37 | - * @param array $attributes Additional attributes |
|
| 38 | - */ |
|
| 39 | - public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 40 | - $this->attributes = $attributes; |
|
| 41 | - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; |
|
| 42 | - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 43 | - $this->extends = $subNodes['extends'] ?? null; |
|
| 44 | - $this->implements = $subNodes['implements'] ?? []; |
|
| 45 | - $this->stmts = $subNodes['stmts'] ?? []; |
|
| 46 | - $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - public function getSubNodeNames() : array { |
|
| 50 | - return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Whether the class is explicitly abstract. |
|
| 55 | - * |
|
| 56 | - * @return bool |
|
| 57 | - */ |
|
| 58 | - public function isAbstract() : bool { |
|
| 59 | - return (bool) ($this->flags & self::MODIFIER_ABSTRACT); |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Whether the class is final. |
|
| 64 | - * |
|
| 65 | - * @return bool |
|
| 66 | - */ |
|
| 67 | - public function isFinal() : bool { |
|
| 68 | - return (bool) ($this->flags & self::MODIFIER_FINAL); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - public function isReadonly() : bool { |
|
| 72 | - return (bool) ($this->flags & self::MODIFIER_READONLY); |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * Whether the class is anonymous. |
|
| 77 | - * |
|
| 78 | - * @return bool |
|
| 79 | - */ |
|
| 80 | - public function isAnonymous() : bool { |
|
| 81 | - return null === $this->name; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * @internal |
|
| 86 | - */ |
|
| 87 | - public static function verifyClassModifier($a, $b) { |
|
| 88 | - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { |
|
| 89 | - throw new Error('Multiple abstract modifiers are not allowed'); |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { |
|
| 93 | - throw new Error('Multiple final modifiers are not allowed'); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { |
|
| 97 | - throw new Error('Multiple readonly modifiers are not allowed'); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - if ($a & 48 && $b & 48) { |
|
| 101 | - throw new Error('Cannot use the final modifier on an abstract class'); |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * @internal |
|
| 107 | - */ |
|
| 108 | - public static function verifyModifier($a, $b) { |
|
| 109 | - if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) { |
|
| 110 | - throw new Error('Multiple access type modifiers are not allowed'); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { |
|
| 114 | - throw new Error('Multiple abstract modifiers are not allowed'); |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) { |
|
| 118 | - throw new Error('Multiple static modifiers are not allowed'); |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { |
|
| 122 | - throw new Error('Multiple final modifiers are not allowed'); |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { |
|
| 126 | - throw new Error('Multiple readonly modifiers are not allowed'); |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - if ($a & 48 && $b & 48) { |
|
| 130 | - throw new Error('Cannot use the final modifier on an abstract class member'); |
|
| 131 | - } |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - public function getType() : string { |
|
| 135 | - return 'Stmt_Class'; |
|
| 136 | - } |
|
| 10 | + const MODIFIER_PUBLIC = 1; |
|
| 11 | + const MODIFIER_PROTECTED = 2; |
|
| 12 | + const MODIFIER_PRIVATE = 4; |
|
| 13 | + const MODIFIER_STATIC = 8; |
|
| 14 | + const MODIFIER_ABSTRACT = 16; |
|
| 15 | + const MODIFIER_FINAL = 32; |
|
| 16 | + const MODIFIER_READONLY = 64; |
|
| 17 | + |
|
| 18 | + const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 |
|
| 19 | + |
|
| 20 | + /** @var int Type */ |
|
| 21 | + public $flags; |
|
| 22 | + /** @var null|Node\Name Name of extended class */ |
|
| 23 | + public $extends; |
|
| 24 | + /** @var Node\Name[] Names of implemented interfaces */ |
|
| 25 | + public $implements; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * Constructs a class node. |
|
| 29 | + * |
|
| 30 | + * @param string|Node\Identifier|null $name Name |
|
| 31 | + * @param array $subNodes Array of the following optional subnodes: |
|
| 32 | + * 'flags' => 0 : Flags |
|
| 33 | + * 'extends' => null : Name of extended class |
|
| 34 | + * 'implements' => array(): Names of implemented interfaces |
|
| 35 | + * 'stmts' => array(): Statements |
|
| 36 | + * 'attrGroups' => array(): PHP attribute groups |
|
| 37 | + * @param array $attributes Additional attributes |
|
| 38 | + */ |
|
| 39 | + public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 40 | + $this->attributes = $attributes; |
|
| 41 | + $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; |
|
| 42 | + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 43 | + $this->extends = $subNodes['extends'] ?? null; |
|
| 44 | + $this->implements = $subNodes['implements'] ?? []; |
|
| 45 | + $this->stmts = $subNodes['stmts'] ?? []; |
|
| 46 | + $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + public function getSubNodeNames() : array { |
|
| 50 | + return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Whether the class is explicitly abstract. |
|
| 55 | + * |
|
| 56 | + * @return bool |
|
| 57 | + */ |
|
| 58 | + public function isAbstract() : bool { |
|
| 59 | + return (bool) ($this->flags & self::MODIFIER_ABSTRACT); |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Whether the class is final. |
|
| 64 | + * |
|
| 65 | + * @return bool |
|
| 66 | + */ |
|
| 67 | + public function isFinal() : bool { |
|
| 68 | + return (bool) ($this->flags & self::MODIFIER_FINAL); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + public function isReadonly() : bool { |
|
| 72 | + return (bool) ($this->flags & self::MODIFIER_READONLY); |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Whether the class is anonymous. |
|
| 77 | + * |
|
| 78 | + * @return bool |
|
| 79 | + */ |
|
| 80 | + public function isAnonymous() : bool { |
|
| 81 | + return null === $this->name; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * @internal |
|
| 86 | + */ |
|
| 87 | + public static function verifyClassModifier($a, $b) { |
|
| 88 | + if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { |
|
| 89 | + throw new Error('Multiple abstract modifiers are not allowed'); |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { |
|
| 93 | + throw new Error('Multiple final modifiers are not allowed'); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { |
|
| 97 | + throw new Error('Multiple readonly modifiers are not allowed'); |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + if ($a & 48 && $b & 48) { |
|
| 101 | + throw new Error('Cannot use the final modifier on an abstract class'); |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * @internal |
|
| 107 | + */ |
|
| 108 | + public static function verifyModifier($a, $b) { |
|
| 109 | + if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) { |
|
| 110 | + throw new Error('Multiple access type modifiers are not allowed'); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { |
|
| 114 | + throw new Error('Multiple abstract modifiers are not allowed'); |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) { |
|
| 118 | + throw new Error('Multiple static modifiers are not allowed'); |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { |
|
| 122 | + throw new Error('Multiple final modifiers are not allowed'); |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { |
|
| 126 | + throw new Error('Multiple readonly modifiers are not allowed'); |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + if ($a & 48 && $b & 48) { |
|
| 130 | + throw new Error('Cannot use the final modifier on an abstract class member'); |
|
| 131 | + } |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + public function getType() : string { |
|
| 135 | + return 'Stmt_Class'; |
|
| 136 | + } |
|
| 137 | 137 | } |
@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class Class_ extends ClassLike |
| 9 | 9 | { |
| 10 | - const MODIFIER_PUBLIC = 1; |
|
| 11 | - const MODIFIER_PROTECTED = 2; |
|
| 12 | - const MODIFIER_PRIVATE = 4; |
|
| 13 | - const MODIFIER_STATIC = 8; |
|
| 10 | + const MODIFIER_PUBLIC = 1; |
|
| 11 | + const MODIFIER_PROTECTED = 2; |
|
| 12 | + const MODIFIER_PRIVATE = 4; |
|
| 13 | + const MODIFIER_STATIC = 8; |
|
| 14 | 14 | const MODIFIER_ABSTRACT = 16; |
| 15 | 15 | const MODIFIER_FINAL = 32; |
| 16 | 16 | const MODIFIER_READONLY = 64; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @return bool |
| 57 | 57 | */ |
| 58 | 58 | public function isAbstract() : bool { |
| 59 | - return (bool) ($this->flags & self::MODIFIER_ABSTRACT); |
|
| 59 | + return (bool)($this->flags & self::MODIFIER_ABSTRACT); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | * @return bool |
| 66 | 66 | */ |
| 67 | 67 | public function isFinal() : bool { |
| 68 | - return (bool) ($this->flags & self::MODIFIER_FINAL); |
|
| 68 | + return (bool)($this->flags & self::MODIFIER_FINAL); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | public function isReadonly() : bool { |
| 72 | - return (bool) ($this->flags & self::MODIFIER_READONLY); |
|
| 72 | + return (bool)($this->flags & self::MODIFIER_READONLY); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use PhpParser\Error; |
| 6 | 6 | use PhpParser\Node; |
| 7 | 7 | |
| 8 | -class Class_ extends ClassLike |
|
| 9 | -{ |
|
| 8 | +class Class_ extends ClassLike { |
|
| 10 | 9 | const MODIFIER_PUBLIC = 1; |
| 11 | 10 | const MODIFIER_PROTECTED = 2; |
| 12 | 11 | const MODIFIER_PRIVATE = 4; |
@@ -7,155 +7,155 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ClassMethod extends Node\Stmt implements FunctionLike |
| 9 | 9 | { |
| 10 | - /** @var int Flags */ |
|
| 11 | - public $flags; |
|
| 12 | - /** @var bool Whether to return by reference */ |
|
| 13 | - public $byRef; |
|
| 14 | - /** @var Node\Identifier Name */ |
|
| 15 | - public $name; |
|
| 16 | - /** @var Node\Param[] Parameters */ |
|
| 17 | - public $params; |
|
| 18 | - /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ |
|
| 19 | - public $returnType; |
|
| 20 | - /** @var Node\Stmt[]|null Statements */ |
|
| 21 | - public $stmts; |
|
| 22 | - /** @var Node\AttributeGroup[] PHP attribute groups */ |
|
| 23 | - public $attrGroups; |
|
| 24 | - |
|
| 25 | - private static $magicNames = [ |
|
| 26 | - '__construct' => true, |
|
| 27 | - '__destruct' => true, |
|
| 28 | - '__call' => true, |
|
| 29 | - '__callstatic' => true, |
|
| 30 | - '__get' => true, |
|
| 31 | - '__set' => true, |
|
| 32 | - '__isset' => true, |
|
| 33 | - '__unset' => true, |
|
| 34 | - '__sleep' => true, |
|
| 35 | - '__wakeup' => true, |
|
| 36 | - '__tostring' => true, |
|
| 37 | - '__set_state' => true, |
|
| 38 | - '__clone' => true, |
|
| 39 | - '__invoke' => true, |
|
| 40 | - '__debuginfo' => true, |
|
| 41 | - '__serialize' => true, |
|
| 42 | - '__unserialize' => true, |
|
| 43 | - ]; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * Constructs a class method node. |
|
| 47 | - * |
|
| 48 | - * @param string|Node\Identifier $name Name |
|
| 49 | - * @param array $subNodes Array of the following optional subnodes: |
|
| 50 | - * 'flags => MODIFIER_PUBLIC: Flags |
|
| 51 | - * 'byRef' => false : Whether to return by reference |
|
| 52 | - * 'params' => array() : Parameters |
|
| 53 | - * 'returnType' => null : Return type |
|
| 54 | - * 'stmts' => array() : Statements |
|
| 55 | - * 'attrGroups' => array() : PHP attribute groups |
|
| 56 | - * @param array $attributes Additional attributes |
|
| 57 | - */ |
|
| 58 | - public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 59 | - $this->attributes = $attributes; |
|
| 60 | - $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; |
|
| 61 | - $this->byRef = $subNodes['byRef'] ?? false; |
|
| 62 | - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 63 | - $this->params = $subNodes['params'] ?? []; |
|
| 64 | - $returnType = $subNodes['returnType'] ?? null; |
|
| 65 | - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; |
|
| 66 | - $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; |
|
| 67 | - $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - public function getSubNodeNames() : array { |
|
| 71 | - return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - public function returnsByRef() : bool { |
|
| 75 | - return $this->byRef; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - public function getParams() : array { |
|
| 79 | - return $this->params; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - public function getReturnType() { |
|
| 83 | - return $this->returnType; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - public function getStmts() { |
|
| 87 | - return $this->stmts; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - public function getAttrGroups() : array { |
|
| 91 | - return $this->attrGroups; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - /** |
|
| 95 | - * Whether the method is explicitly or implicitly public. |
|
| 96 | - * |
|
| 97 | - * @return bool |
|
| 98 | - */ |
|
| 99 | - public function isPublic() : bool { |
|
| 100 | - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 |
|
| 101 | - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * Whether the method is protected. |
|
| 106 | - * |
|
| 107 | - * @return bool |
|
| 108 | - */ |
|
| 109 | - public function isProtected() : bool { |
|
| 110 | - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * Whether the method is private. |
|
| 115 | - * |
|
| 116 | - * @return bool |
|
| 117 | - */ |
|
| 118 | - public function isPrivate() : bool { |
|
| 119 | - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * Whether the method is abstract. |
|
| 124 | - * |
|
| 125 | - * @return bool |
|
| 126 | - */ |
|
| 127 | - public function isAbstract() : bool { |
|
| 128 | - return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * Whether the method is final. |
|
| 133 | - * |
|
| 134 | - * @return bool |
|
| 135 | - */ |
|
| 136 | - public function isFinal() : bool { |
|
| 137 | - return (bool) ($this->flags & Class_::MODIFIER_FINAL); |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - /** |
|
| 141 | - * Whether the method is static. |
|
| 142 | - * |
|
| 143 | - * @return bool |
|
| 144 | - */ |
|
| 145 | - public function isStatic() : bool { |
|
| 146 | - return (bool) ($this->flags & Class_::MODIFIER_STATIC); |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * Whether the method is magic. |
|
| 151 | - * |
|
| 152 | - * @return bool |
|
| 153 | - */ |
|
| 154 | - public function isMagic() : bool { |
|
| 155 | - return isset(self::$magicNames[$this->name->toLowerString()]); |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - public function getType() : string { |
|
| 159 | - return 'Stmt_ClassMethod'; |
|
| 160 | - } |
|
| 10 | + /** @var int Flags */ |
|
| 11 | + public $flags; |
|
| 12 | + /** @var bool Whether to return by reference */ |
|
| 13 | + public $byRef; |
|
| 14 | + /** @var Node\Identifier Name */ |
|
| 15 | + public $name; |
|
| 16 | + /** @var Node\Param[] Parameters */ |
|
| 17 | + public $params; |
|
| 18 | + /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ |
|
| 19 | + public $returnType; |
|
| 20 | + /** @var Node\Stmt[]|null Statements */ |
|
| 21 | + public $stmts; |
|
| 22 | + /** @var Node\AttributeGroup[] PHP attribute groups */ |
|
| 23 | + public $attrGroups; |
|
| 24 | + |
|
| 25 | + private static $magicNames = [ |
|
| 26 | + '__construct' => true, |
|
| 27 | + '__destruct' => true, |
|
| 28 | + '__call' => true, |
|
| 29 | + '__callstatic' => true, |
|
| 30 | + '__get' => true, |
|
| 31 | + '__set' => true, |
|
| 32 | + '__isset' => true, |
|
| 33 | + '__unset' => true, |
|
| 34 | + '__sleep' => true, |
|
| 35 | + '__wakeup' => true, |
|
| 36 | + '__tostring' => true, |
|
| 37 | + '__set_state' => true, |
|
| 38 | + '__clone' => true, |
|
| 39 | + '__invoke' => true, |
|
| 40 | + '__debuginfo' => true, |
|
| 41 | + '__serialize' => true, |
|
| 42 | + '__unserialize' => true, |
|
| 43 | + ]; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * Constructs a class method node. |
|
| 47 | + * |
|
| 48 | + * @param string|Node\Identifier $name Name |
|
| 49 | + * @param array $subNodes Array of the following optional subnodes: |
|
| 50 | + * 'flags => MODIFIER_PUBLIC: Flags |
|
| 51 | + * 'byRef' => false : Whether to return by reference |
|
| 52 | + * 'params' => array() : Parameters |
|
| 53 | + * 'returnType' => null : Return type |
|
| 54 | + * 'stmts' => array() : Statements |
|
| 55 | + * 'attrGroups' => array() : PHP attribute groups |
|
| 56 | + * @param array $attributes Additional attributes |
|
| 57 | + */ |
|
| 58 | + public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 59 | + $this->attributes = $attributes; |
|
| 60 | + $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0; |
|
| 61 | + $this->byRef = $subNodes['byRef'] ?? false; |
|
| 62 | + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 63 | + $this->params = $subNodes['params'] ?? []; |
|
| 64 | + $returnType = $subNodes['returnType'] ?? null; |
|
| 65 | + $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; |
|
| 66 | + $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; |
|
| 67 | + $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + public function getSubNodeNames() : array { |
|
| 71 | + return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + public function returnsByRef() : bool { |
|
| 75 | + return $this->byRef; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + public function getParams() : array { |
|
| 79 | + return $this->params; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + public function getReturnType() { |
|
| 83 | + return $this->returnType; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + public function getStmts() { |
|
| 87 | + return $this->stmts; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + public function getAttrGroups() : array { |
|
| 91 | + return $this->attrGroups; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + /** |
|
| 95 | + * Whether the method is explicitly or implicitly public. |
|
| 96 | + * |
|
| 97 | + * @return bool |
|
| 98 | + */ |
|
| 99 | + public function isPublic() : bool { |
|
| 100 | + return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 |
|
| 101 | + || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * Whether the method is protected. |
|
| 106 | + * |
|
| 107 | + * @return bool |
|
| 108 | + */ |
|
| 109 | + public function isProtected() : bool { |
|
| 110 | + return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * Whether the method is private. |
|
| 115 | + * |
|
| 116 | + * @return bool |
|
| 117 | + */ |
|
| 118 | + public function isPrivate() : bool { |
|
| 119 | + return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * Whether the method is abstract. |
|
| 124 | + * |
|
| 125 | + * @return bool |
|
| 126 | + */ |
|
| 127 | + public function isAbstract() : bool { |
|
| 128 | + return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * Whether the method is final. |
|
| 133 | + * |
|
| 134 | + * @return bool |
|
| 135 | + */ |
|
| 136 | + public function isFinal() : bool { |
|
| 137 | + return (bool) ($this->flags & Class_::MODIFIER_FINAL); |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + /** |
|
| 141 | + * Whether the method is static. |
|
| 142 | + * |
|
| 143 | + * @return bool |
|
| 144 | + */ |
|
| 145 | + public function isStatic() : bool { |
|
| 146 | + return (bool) ($this->flags & Class_::MODIFIER_STATIC); |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * Whether the method is magic. |
|
| 151 | + * |
|
| 152 | + * @return bool |
|
| 153 | + */ |
|
| 154 | + public function isMagic() : bool { |
|
| 155 | + return isset(self::$magicNames[$this->name->toLowerString()]); |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + public function getType() : string { |
|
| 159 | + return 'Stmt_ClassMethod'; |
|
| 160 | + } |
|
| 161 | 161 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @return bool |
| 108 | 108 | */ |
| 109 | 109 | public function isProtected() : bool { |
| 110 | - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); |
|
| 110 | + return (bool)($this->flags & Class_::MODIFIER_PROTECTED); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @return bool |
| 117 | 117 | */ |
| 118 | 118 | public function isPrivate() : bool { |
| 119 | - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); |
|
| 119 | + return (bool)($this->flags & Class_::MODIFIER_PRIVATE); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return bool |
| 126 | 126 | */ |
| 127 | 127 | public function isAbstract() : bool { |
| 128 | - return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); |
|
| 128 | + return (bool)($this->flags & Class_::MODIFIER_ABSTRACT); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return bool |
| 135 | 135 | */ |
| 136 | 136 | public function isFinal() : bool { |
| 137 | - return (bool) ($this->flags & Class_::MODIFIER_FINAL); |
|
| 137 | + return (bool)($this->flags & Class_::MODIFIER_FINAL); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @return bool |
| 144 | 144 | */ |
| 145 | 145 | public function isStatic() : bool { |
| 146 | - return (bool) ($this->flags & Class_::MODIFIER_STATIC); |
|
| 146 | + return (bool)($this->flags & Class_::MODIFIER_STATIC); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Return_ extends Node\Stmt |
| 8 | 8 | { |
| 9 | - /** @var null|Node\Expr Expression */ |
|
| 10 | - public $expr; |
|
| 9 | + /** @var null|Node\Expr Expression */ |
|
| 10 | + public $expr; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Constructs a return node. |
|
| 14 | - * |
|
| 15 | - * @param null|Node\Expr $expr Expression |
|
| 16 | - * @param array $attributes Additional attributes |
|
| 17 | - */ |
|
| 18 | - public function __construct(?Node\Expr $expr = null, array $attributes = []) { |
|
| 19 | - $this->attributes = $attributes; |
|
| 20 | - $this->expr = $expr; |
|
| 21 | - } |
|
| 12 | + /** |
|
| 13 | + * Constructs a return node. |
|
| 14 | + * |
|
| 15 | + * @param null|Node\Expr $expr Expression |
|
| 16 | + * @param array $attributes Additional attributes |
|
| 17 | + */ |
|
| 18 | + public function __construct(?Node\Expr $expr = null, array $attributes = []) { |
|
| 19 | + $this->attributes = $attributes; |
|
| 20 | + $this->expr = $expr; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public function getSubNodeNames() : array { |
|
| 24 | - return ['expr']; |
|
| 25 | - } |
|
| 23 | + public function getSubNodeNames() : array { |
|
| 24 | + return ['expr']; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function getType() : string { |
|
| 28 | - return 'Stmt_Return'; |
|
| 29 | - } |
|
| 27 | + public function getType() : string { |
|
| 28 | + return 'Stmt_Return'; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -6,29 +6,29 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ElseIf_ extends Node\Stmt |
| 8 | 8 | { |
| 9 | - /** @var Node\Expr Condition */ |
|
| 10 | - public $cond; |
|
| 11 | - /** @var Node\Stmt[] Statements */ |
|
| 12 | - public $stmts; |
|
| 9 | + /** @var Node\Expr Condition */ |
|
| 10 | + public $cond; |
|
| 11 | + /** @var Node\Stmt[] Statements */ |
|
| 12 | + public $stmts; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Constructs an elseif node. |
|
| 16 | - * |
|
| 17 | - * @param Node\Expr $cond Condition |
|
| 18 | - * @param Node\Stmt[] $stmts Statements |
|
| 19 | - * @param array $attributes Additional attributes |
|
| 20 | - */ |
|
| 21 | - public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { |
|
| 22 | - $this->attributes = $attributes; |
|
| 23 | - $this->cond = $cond; |
|
| 24 | - $this->stmts = $stmts; |
|
| 25 | - } |
|
| 14 | + /** |
|
| 15 | + * Constructs an elseif node. |
|
| 16 | + * |
|
| 17 | + * @param Node\Expr $cond Condition |
|
| 18 | + * @param Node\Stmt[] $stmts Statements |
|
| 19 | + * @param array $attributes Additional attributes |
|
| 20 | + */ |
|
| 21 | + public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { |
|
| 22 | + $this->attributes = $attributes; |
|
| 23 | + $this->cond = $cond; |
|
| 24 | + $this->stmts = $stmts; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function getSubNodeNames() : array { |
|
| 28 | - return ['cond', 'stmts']; |
|
| 29 | - } |
|
| 27 | + public function getSubNodeNames() : array { |
|
| 28 | + return ['cond', 'stmts']; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - public function getType() : string { |
|
| 32 | - return 'Stmt_ElseIf'; |
|
| 33 | - } |
|
| 31 | + public function getType() : string { |
|
| 32 | + return 'Stmt_ElseIf'; |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | |
| 7 | 7 | abstract class TraitUseAdaptation extends Node\Stmt |
| 8 | 8 | { |
| 9 | - /** @var Node\Name|null Trait name */ |
|
| 10 | - public $trait; |
|
| 11 | - /** @var Node\Identifier Method name */ |
|
| 12 | - public $method; |
|
| 9 | + /** @var Node\Name|null Trait name */ |
|
| 10 | + public $trait; |
|
| 11 | + /** @var Node\Identifier Method name */ |
|
| 12 | + public $method; |
|
| 13 | 13 | } |
@@ -6,35 +6,35 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Enum_ extends ClassLike |
| 8 | 8 | { |
| 9 | - /** @var null|Node\Identifier Scalar Type */ |
|
| 10 | - public $scalarType; |
|
| 11 | - /** @var Node\Name[] Names of implemented interfaces */ |
|
| 12 | - public $implements; |
|
| 9 | + /** @var null|Node\Identifier Scalar Type */ |
|
| 10 | + public $scalarType; |
|
| 11 | + /** @var Node\Name[] Names of implemented interfaces */ |
|
| 12 | + public $implements; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * @param string|Node\Identifier|null $name Name |
|
| 16 | - * @param array $subNodes Array of the following optional subnodes: |
|
| 17 | - * 'scalarType' => null : Scalar type |
|
| 18 | - * 'implements' => array() : Names of implemented interfaces |
|
| 19 | - * 'stmts' => array() : Statements |
|
| 20 | - * 'attrGroups' => array() : PHP attribute groups |
|
| 21 | - * @param array $attributes Additional attributes |
|
| 22 | - */ |
|
| 23 | - public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 24 | - $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 25 | - $this->scalarType = $subNodes['scalarType'] ?? null; |
|
| 26 | - $this->implements = $subNodes['implements'] ?? []; |
|
| 27 | - $this->stmts = $subNodes['stmts'] ?? []; |
|
| 28 | - $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 14 | + /** |
|
| 15 | + * @param string|Node\Identifier|null $name Name |
|
| 16 | + * @param array $subNodes Array of the following optional subnodes: |
|
| 17 | + * 'scalarType' => null : Scalar type |
|
| 18 | + * 'implements' => array() : Names of implemented interfaces |
|
| 19 | + * 'stmts' => array() : Statements |
|
| 20 | + * 'attrGroups' => array() : PHP attribute groups |
|
| 21 | + * @param array $attributes Additional attributes |
|
| 22 | + */ |
|
| 23 | + public function __construct($name, array $subNodes = [], array $attributes = []) { |
|
| 24 | + $this->name = \is_string($name) ? new Node\Identifier($name) : $name; |
|
| 25 | + $this->scalarType = $subNodes['scalarType'] ?? null; |
|
| 26 | + $this->implements = $subNodes['implements'] ?? []; |
|
| 27 | + $this->stmts = $subNodes['stmts'] ?? []; |
|
| 28 | + $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
| 29 | 29 | |
| 30 | - parent::__construct($attributes); |
|
| 31 | - } |
|
| 30 | + parent::__construct($attributes); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - public function getSubNodeNames() : array { |
|
| 34 | - return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; |
|
| 35 | - } |
|
| 33 | + public function getSubNodeNames() : array { |
|
| 34 | + return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - public function getType() : string { |
|
| 38 | - return 'Stmt_Enum'; |
|
| 39 | - } |
|
| 37 | + public function getType() : string { |
|
| 38 | + return 'Stmt_Enum'; |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -4,8 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PhpParser\Node; |
| 6 | 6 | |
| 7 | -class Enum_ extends ClassLike |
|
| 8 | -{ |
|
| 7 | +class Enum_ extends ClassLike { |
|
| 9 | 8 | /** @var null|Node\Identifier Scalar Type */ |
| 10 | 9 | public $scalarType; |
| 11 | 10 | /** @var Node\Name[] Names of implemented interfaces */ |