@@ -6,29 +6,29 @@ |
||
6 | 6 | |
7 | 7 | class TraitUse extends Node\Stmt |
8 | 8 | { |
9 | - /** @var Node\Name[] Traits */ |
|
10 | - public $traits; |
|
11 | - /** @var TraitUseAdaptation[] Adaptations */ |
|
12 | - public $adaptations; |
|
9 | + /** @var Node\Name[] Traits */ |
|
10 | + public $traits; |
|
11 | + /** @var TraitUseAdaptation[] Adaptations */ |
|
12 | + public $adaptations; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Constructs a trait use node. |
|
16 | - * |
|
17 | - * @param Node\Name[] $traits Traits |
|
18 | - * @param TraitUseAdaptation[] $adaptations Adaptations |
|
19 | - * @param array $attributes Additional attributes |
|
20 | - */ |
|
21 | - public function __construct(array $traits, array $adaptations = [], array $attributes = []) { |
|
22 | - $this->attributes = $attributes; |
|
23 | - $this->traits = $traits; |
|
24 | - $this->adaptations = $adaptations; |
|
25 | - } |
|
14 | + /** |
|
15 | + * Constructs a trait use node. |
|
16 | + * |
|
17 | + * @param Node\Name[] $traits Traits |
|
18 | + * @param TraitUseAdaptation[] $adaptations Adaptations |
|
19 | + * @param array $attributes Additional attributes |
|
20 | + */ |
|
21 | + public function __construct(array $traits, array $adaptations = [], array $attributes = []) { |
|
22 | + $this->attributes = $attributes; |
|
23 | + $this->traits = $traits; |
|
24 | + $this->adaptations = $adaptations; |
|
25 | + } |
|
26 | 26 | |
27 | - public function getSubNodeNames() : array { |
|
28 | - return ['traits', 'adaptations']; |
|
29 | - } |
|
27 | + public function getSubNodeNames() : array { |
|
28 | + return ['traits', 'adaptations']; |
|
29 | + } |
|
30 | 30 | |
31 | - public function getType() : string { |
|
32 | - return 'Stmt_TraitUse'; |
|
33 | - } |
|
31 | + public function getType() : string { |
|
32 | + return 'Stmt_TraitUse'; |
|
33 | + } |
|
34 | 34 | } |
@@ -7,31 +7,31 @@ |
||
7 | 7 | |
8 | 8 | class StaticVar extends Node\Stmt |
9 | 9 | { |
10 | - /** @var Expr\Variable Variable */ |
|
11 | - public $var; |
|
12 | - /** @var null|Node\Expr Default value */ |
|
13 | - public $default; |
|
10 | + /** @var Expr\Variable Variable */ |
|
11 | + public $var; |
|
12 | + /** @var null|Node\Expr Default value */ |
|
13 | + public $default; |
|
14 | 14 | |
15 | - /** |
|
16 | - * Constructs a static variable node. |
|
17 | - * |
|
18 | - * @param Expr\Variable $var Name |
|
19 | - * @param null|Node\Expr $default Default value |
|
20 | - * @param array $attributes Additional attributes |
|
21 | - */ |
|
22 | - public function __construct( |
|
23 | - Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] |
|
24 | - ) { |
|
25 | - $this->attributes = $attributes; |
|
26 | - $this->var = $var; |
|
27 | - $this->default = $default; |
|
28 | - } |
|
15 | + /** |
|
16 | + * Constructs a static variable node. |
|
17 | + * |
|
18 | + * @param Expr\Variable $var Name |
|
19 | + * @param null|Node\Expr $default Default value |
|
20 | + * @param array $attributes Additional attributes |
|
21 | + */ |
|
22 | + public function __construct( |
|
23 | + Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] |
|
24 | + ) { |
|
25 | + $this->attributes = $attributes; |
|
26 | + $this->var = $var; |
|
27 | + $this->default = $default; |
|
28 | + } |
|
29 | 29 | |
30 | - public function getSubNodeNames() : array { |
|
31 | - return ['var', 'default']; |
|
32 | - } |
|
30 | + public function getSubNodeNames() : array { |
|
31 | + return ['var', 'default']; |
|
32 | + } |
|
33 | 33 | |
34 | - public function getType() : string { |
|
35 | - return 'Stmt_StaticVar'; |
|
36 | - } |
|
34 | + public function getType() : string { |
|
35 | + return 'Stmt_StaticVar'; |
|
36 | + } |
|
37 | 37 | } |
@@ -6,38 +6,38 @@ |
||
6 | 6 | |
7 | 7 | interface FunctionLike extends Node |
8 | 8 | { |
9 | - /** |
|
10 | - * Whether to return by reference |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function returnsByRef() : bool; |
|
9 | + /** |
|
10 | + * Whether to return by reference |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function returnsByRef() : bool; |
|
15 | 15 | |
16 | - /** |
|
17 | - * List of parameters |
|
18 | - * |
|
19 | - * @return Param[] |
|
20 | - */ |
|
21 | - public function getParams() : array; |
|
16 | + /** |
|
17 | + * List of parameters |
|
18 | + * |
|
19 | + * @return Param[] |
|
20 | + */ |
|
21 | + public function getParams() : array; |
|
22 | 22 | |
23 | - /** |
|
24 | - * Get the declared return type or null |
|
25 | - * |
|
26 | - * @return null|Identifier|Name|ComplexType |
|
27 | - */ |
|
28 | - public function getReturnType(); |
|
23 | + /** |
|
24 | + * Get the declared return type or null |
|
25 | + * |
|
26 | + * @return null|Identifier|Name|ComplexType |
|
27 | + */ |
|
28 | + public function getReturnType(); |
|
29 | 29 | |
30 | - /** |
|
31 | - * The function body |
|
32 | - * |
|
33 | - * @return Stmt[]|null |
|
34 | - */ |
|
35 | - public function getStmts(); |
|
30 | + /** |
|
31 | + * The function body |
|
32 | + * |
|
33 | + * @return Stmt[]|null |
|
34 | + */ |
|
35 | + public function getStmts(); |
|
36 | 36 | |
37 | - /** |
|
38 | - * Get PHP attribute groups. |
|
39 | - * |
|
40 | - * @return AttributeGroup[] |
|
41 | - */ |
|
42 | - public function getAttrGroups() : array; |
|
37 | + /** |
|
38 | + * Get PHP attribute groups. |
|
39 | + * |
|
40 | + * @return AttributeGroup[] |
|
41 | + */ |
|
42 | + public function getAttrGroups() : array; |
|
43 | 43 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\Node; |
6 | 6 | |
7 | -interface FunctionLike extends Node |
|
8 | -{ |
|
7 | +interface FunctionLike extends Node { |
|
9 | 8 | /** |
10 | 9 | * Whether to return by reference |
11 | 10 | * |
@@ -6,55 +6,55 @@ |
||
6 | 6 | |
7 | 7 | class Param extends NodeAbstract |
8 | 8 | { |
9 | - /** @var null|Identifier|Name|ComplexType Type declaration */ |
|
10 | - public $type; |
|
11 | - /** @var bool Whether parameter is passed by reference */ |
|
12 | - public $byRef; |
|
13 | - /** @var bool Whether this is a variadic argument */ |
|
14 | - public $variadic; |
|
15 | - /** @var Expr\Variable|Expr\Error Parameter variable */ |
|
16 | - public $var; |
|
17 | - /** @var null|Expr Default value */ |
|
18 | - public $default; |
|
19 | - /** @var int */ |
|
20 | - public $flags; |
|
21 | - /** @var AttributeGroup[] PHP attribute groups */ |
|
22 | - public $attrGroups; |
|
9 | + /** @var null|Identifier|Name|ComplexType Type declaration */ |
|
10 | + public $type; |
|
11 | + /** @var bool Whether parameter is passed by reference */ |
|
12 | + public $byRef; |
|
13 | + /** @var bool Whether this is a variadic argument */ |
|
14 | + public $variadic; |
|
15 | + /** @var Expr\Variable|Expr\Error Parameter variable */ |
|
16 | + public $var; |
|
17 | + /** @var null|Expr Default value */ |
|
18 | + public $default; |
|
19 | + /** @var int */ |
|
20 | + public $flags; |
|
21 | + /** @var AttributeGroup[] PHP attribute groups */ |
|
22 | + public $attrGroups; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Constructs a parameter node. |
|
26 | - * |
|
27 | - * @param Expr\Variable|Expr\Error $var Parameter variable |
|
28 | - * @param null|Expr $default Default value |
|
29 | - * @param null|string|Identifier|Name|ComplexType $type Type declaration |
|
30 | - * @param bool $byRef Whether is passed by reference |
|
31 | - * @param bool $variadic Whether this is a variadic argument |
|
32 | - * @param array $attributes Additional attributes |
|
33 | - * @param int $flags Optional visibility flags |
|
34 | - * @param AttributeGroup[] $attrGroups PHP attribute groups |
|
35 | - */ |
|
36 | - public function __construct( |
|
37 | - $var, ?Expr $default = null, $type = null, |
|
38 | - bool $byRef = false, bool $variadic = false, |
|
39 | - array $attributes = [], |
|
40 | - int $flags = 0, |
|
41 | - array $attrGroups = [] |
|
42 | - ) { |
|
43 | - $this->attributes = $attributes; |
|
44 | - $this->type = \is_string($type) ? new Identifier($type) : $type; |
|
45 | - $this->byRef = $byRef; |
|
46 | - $this->variadic = $variadic; |
|
47 | - $this->var = $var; |
|
48 | - $this->default = $default; |
|
49 | - $this->flags = $flags; |
|
50 | - $this->attrGroups = $attrGroups; |
|
51 | - } |
|
24 | + /** |
|
25 | + * Constructs a parameter node. |
|
26 | + * |
|
27 | + * @param Expr\Variable|Expr\Error $var Parameter variable |
|
28 | + * @param null|Expr $default Default value |
|
29 | + * @param null|string|Identifier|Name|ComplexType $type Type declaration |
|
30 | + * @param bool $byRef Whether is passed by reference |
|
31 | + * @param bool $variadic Whether this is a variadic argument |
|
32 | + * @param array $attributes Additional attributes |
|
33 | + * @param int $flags Optional visibility flags |
|
34 | + * @param AttributeGroup[] $attrGroups PHP attribute groups |
|
35 | + */ |
|
36 | + public function __construct( |
|
37 | + $var, ?Expr $default = null, $type = null, |
|
38 | + bool $byRef = false, bool $variadic = false, |
|
39 | + array $attributes = [], |
|
40 | + int $flags = 0, |
|
41 | + array $attrGroups = [] |
|
42 | + ) { |
|
43 | + $this->attributes = $attributes; |
|
44 | + $this->type = \is_string($type) ? new Identifier($type) : $type; |
|
45 | + $this->byRef = $byRef; |
|
46 | + $this->variadic = $variadic; |
|
47 | + $this->var = $var; |
|
48 | + $this->default = $default; |
|
49 | + $this->flags = $flags; |
|
50 | + $this->attrGroups = $attrGroups; |
|
51 | + } |
|
52 | 52 | |
53 | - public function getSubNodeNames() : array { |
|
54 | - return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; |
|
55 | - } |
|
53 | + public function getSubNodeNames() : array { |
|
54 | + return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; |
|
55 | + } |
|
56 | 56 | |
57 | - public function getType() : string { |
|
58 | - return 'Param'; |
|
59 | - } |
|
57 | + public function getType() : string { |
|
58 | + return 'Param'; |
|
59 | + } |
|
60 | 60 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\NodeAbstract; |
6 | 6 | |
7 | -class Param extends NodeAbstract |
|
8 | -{ |
|
7 | +class Param extends NodeAbstract { |
|
9 | 8 | /** @var null|Identifier|Name|ComplexType Type declaration */ |
10 | 9 | public $type; |
11 | 10 | /** @var bool Whether parameter is passed by reference */ |
@@ -4,6 +4,5 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\NodeAbstract; |
6 | 6 | |
7 | -abstract class Stmt extends NodeAbstract |
|
8 | -{ |
|
7 | +abstract class Stmt extends NodeAbstract { |
|
9 | 8 | } |
@@ -7,25 +7,25 @@ |
||
7 | 7 | |
8 | 8 | class MatchArm extends NodeAbstract |
9 | 9 | { |
10 | - /** @var null|Node\Expr[] */ |
|
11 | - public $conds; |
|
12 | - /** @var Node\Expr */ |
|
13 | - public $body; |
|
10 | + /** @var null|Node\Expr[] */ |
|
11 | + public $conds; |
|
12 | + /** @var Node\Expr */ |
|
13 | + public $body; |
|
14 | 14 | |
15 | - /** |
|
16 | - * @param null|Node\Expr[] $conds |
|
17 | - */ |
|
18 | - public function __construct($conds, Node\Expr $body, array $attributes = []) { |
|
19 | - $this->conds = $conds; |
|
20 | - $this->body = $body; |
|
21 | - $this->attributes = $attributes; |
|
22 | - } |
|
15 | + /** |
|
16 | + * @param null|Node\Expr[] $conds |
|
17 | + */ |
|
18 | + public function __construct($conds, Node\Expr $body, array $attributes = []) { |
|
19 | + $this->conds = $conds; |
|
20 | + $this->body = $body; |
|
21 | + $this->attributes = $attributes; |
|
22 | + } |
|
23 | 23 | |
24 | - public function getSubNodeNames() : array { |
|
25 | - return ['conds', 'body']; |
|
26 | - } |
|
24 | + public function getSubNodeNames() : array { |
|
25 | + return ['conds', 'body']; |
|
26 | + } |
|
27 | 27 | |
28 | - public function getType() : string { |
|
29 | - return 'MatchArm'; |
|
30 | - } |
|
28 | + public function getType() : string { |
|
29 | + return 'MatchArm'; |
|
30 | + } |
|
31 | 31 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use PhpParser\Node; |
6 | 6 | use PhpParser\NodeAbstract; |
7 | 7 | |
8 | -class MatchArm extends NodeAbstract |
|
9 | -{ |
|
8 | +class MatchArm extends NodeAbstract { |
|
10 | 9 | /** @var null|Node\Expr[] */ |
11 | 10 | public $conds; |
12 | 11 | /** @var Node\Expr */ |
@@ -4,6 +4,5 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\NodeAbstract; |
6 | 6 | |
7 | -abstract class Expr extends NodeAbstract |
|
8 | -{ |
|
7 | +abstract class Expr extends NodeAbstract { |
|
9 | 8 | } |
@@ -7,28 +7,28 @@ |
||
7 | 7 | |
8 | 8 | class Attribute extends NodeAbstract |
9 | 9 | { |
10 | - /** @var Name Attribute name */ |
|
11 | - public $name; |
|
10 | + /** @var Name Attribute name */ |
|
11 | + public $name; |
|
12 | 12 | |
13 | - /** @var Arg[] Attribute arguments */ |
|
14 | - public $args; |
|
13 | + /** @var Arg[] Attribute arguments */ |
|
14 | + public $args; |
|
15 | 15 | |
16 | - /** |
|
17 | - * @param Node\Name $name Attribute name |
|
18 | - * @param Arg[] $args Attribute arguments |
|
19 | - * @param array $attributes Additional node attributes |
|
20 | - */ |
|
21 | - public function __construct(Name $name, array $args = [], array $attributes = []) { |
|
22 | - $this->attributes = $attributes; |
|
23 | - $this->name = $name; |
|
24 | - $this->args = $args; |
|
25 | - } |
|
16 | + /** |
|
17 | + * @param Node\Name $name Attribute name |
|
18 | + * @param Arg[] $args Attribute arguments |
|
19 | + * @param array $attributes Additional node attributes |
|
20 | + */ |
|
21 | + public function __construct(Name $name, array $args = [], array $attributes = []) { |
|
22 | + $this->attributes = $attributes; |
|
23 | + $this->name = $name; |
|
24 | + $this->args = $args; |
|
25 | + } |
|
26 | 26 | |
27 | - public function getSubNodeNames() : array { |
|
28 | - return ['name', 'args']; |
|
29 | - } |
|
27 | + public function getSubNodeNames() : array { |
|
28 | + return ['name', 'args']; |
|
29 | + } |
|
30 | 30 | |
31 | - public function getType() : string { |
|
32 | - return 'Attribute'; |
|
33 | - } |
|
31 | + public function getType() : string { |
|
32 | + return 'Attribute'; |
|
33 | + } |
|
34 | 34 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use PhpParser\Node; |
6 | 6 | use PhpParser\NodeAbstract; |
7 | 7 | |
8 | -class Attribute extends NodeAbstract |
|
9 | -{ |
|
8 | +class Attribute extends NodeAbstract { |
|
10 | 9 | /** @var Name Attribute name */ |
11 | 10 | public $name; |
12 | 11 |
@@ -4,25 +4,25 @@ |
||
4 | 4 | |
5 | 5 | class UnionType extends ComplexType |
6 | 6 | { |
7 | - /** @var (Identifier|Name|IntersectionType)[] Types */ |
|
8 | - public $types; |
|
7 | + /** @var (Identifier|Name|IntersectionType)[] Types */ |
|
8 | + public $types; |
|
9 | 9 | |
10 | - /** |
|
11 | - * Constructs a union type. |
|
12 | - * |
|
13 | - * @param (Identifier|Name|IntersectionType)[] $types Types |
|
14 | - * @param array $attributes Additional attributes |
|
15 | - */ |
|
16 | - public function __construct(array $types, array $attributes = []) { |
|
17 | - $this->attributes = $attributes; |
|
18 | - $this->types = $types; |
|
19 | - } |
|
10 | + /** |
|
11 | + * Constructs a union type. |
|
12 | + * |
|
13 | + * @param (Identifier|Name|IntersectionType)[] $types Types |
|
14 | + * @param array $attributes Additional attributes |
|
15 | + */ |
|
16 | + public function __construct(array $types, array $attributes = []) { |
|
17 | + $this->attributes = $attributes; |
|
18 | + $this->types = $types; |
|
19 | + } |
|
20 | 20 | |
21 | - public function getSubNodeNames() : array { |
|
22 | - return ['types']; |
|
23 | - } |
|
21 | + public function getSubNodeNames() : array { |
|
22 | + return ['types']; |
|
23 | + } |
|
24 | 24 | |
25 | - public function getType() : string { |
|
26 | - return 'UnionType'; |
|
27 | - } |
|
25 | + public function getType() : string { |
|
26 | + return 'UnionType'; |
|
27 | + } |
|
28 | 28 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace PhpParser\Node; |
4 | 4 | |
5 | -class UnionType extends ComplexType |
|
6 | -{ |
|
5 | +class UnionType extends ComplexType { |
|
7 | 6 | /** @var (Identifier|Name|IntersectionType)[] Types */ |
8 | 7 | public $types; |
9 | 8 |