@@ -8,72 +8,72 @@ |
||
8 | 8 | |
9 | 9 | class ArrowFunction extends Expr implements FunctionLike |
10 | 10 | { |
11 | - /** @var bool */ |
|
12 | - public $static; |
|
11 | + /** @var bool */ |
|
12 | + public $static; |
|
13 | 13 | |
14 | - /** @var bool */ |
|
15 | - public $byRef; |
|
14 | + /** @var bool */ |
|
15 | + public $byRef; |
|
16 | 16 | |
17 | - /** @var Node\Param[] */ |
|
18 | - public $params = []; |
|
17 | + /** @var Node\Param[] */ |
|
18 | + public $params = []; |
|
19 | 19 | |
20 | - /** @var null|Node\Identifier|Node\Name|Node\ComplexType */ |
|
21 | - public $returnType; |
|
20 | + /** @var null|Node\Identifier|Node\Name|Node\ComplexType */ |
|
21 | + public $returnType; |
|
22 | 22 | |
23 | - /** @var Expr */ |
|
24 | - public $expr; |
|
25 | - /** @var Node\AttributeGroup[] */ |
|
26 | - public $attrGroups; |
|
23 | + /** @var Expr */ |
|
24 | + public $expr; |
|
25 | + /** @var Node\AttributeGroup[] */ |
|
26 | + public $attrGroups; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @param array $subNodes Array of the following optional subnodes: |
|
30 | - * 'static' => false : Whether the closure is static |
|
31 | - * 'byRef' => false : Whether to return by reference |
|
32 | - * 'params' => array() : Parameters |
|
33 | - * 'returnType' => null : Return type |
|
34 | - * 'expr' => Expr : Expression body |
|
35 | - * 'attrGroups' => array() : PHP attribute groups |
|
36 | - * @param array $attributes Additional attributes |
|
37 | - */ |
|
38 | - public function __construct(array $subNodes = [], array $attributes = []) { |
|
39 | - $this->attributes = $attributes; |
|
40 | - $this->static = $subNodes['static'] ?? false; |
|
41 | - $this->byRef = $subNodes['byRef'] ?? false; |
|
42 | - $this->params = $subNodes['params'] ?? []; |
|
43 | - $returnType = $subNodes['returnType'] ?? null; |
|
44 | - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; |
|
45 | - $this->expr = $subNodes['expr']; |
|
46 | - $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
47 | - } |
|
28 | + /** |
|
29 | + * @param array $subNodes Array of the following optional subnodes: |
|
30 | + * 'static' => false : Whether the closure is static |
|
31 | + * 'byRef' => false : Whether to return by reference |
|
32 | + * 'params' => array() : Parameters |
|
33 | + * 'returnType' => null : Return type |
|
34 | + * 'expr' => Expr : Expression body |
|
35 | + * 'attrGroups' => array() : PHP attribute groups |
|
36 | + * @param array $attributes Additional attributes |
|
37 | + */ |
|
38 | + public function __construct(array $subNodes = [], array $attributes = []) { |
|
39 | + $this->attributes = $attributes; |
|
40 | + $this->static = $subNodes['static'] ?? false; |
|
41 | + $this->byRef = $subNodes['byRef'] ?? false; |
|
42 | + $this->params = $subNodes['params'] ?? []; |
|
43 | + $returnType = $subNodes['returnType'] ?? null; |
|
44 | + $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; |
|
45 | + $this->expr = $subNodes['expr']; |
|
46 | + $this->attrGroups = $subNodes['attrGroups'] ?? []; |
|
47 | + } |
|
48 | 48 | |
49 | - public function getSubNodeNames() : array { |
|
50 | - return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; |
|
51 | - } |
|
49 | + public function getSubNodeNames() : array { |
|
50 | + return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; |
|
51 | + } |
|
52 | 52 | |
53 | - public function returnsByRef() : bool { |
|
54 | - return $this->byRef; |
|
55 | - } |
|
53 | + public function returnsByRef() : bool { |
|
54 | + return $this->byRef; |
|
55 | + } |
|
56 | 56 | |
57 | - public function getParams() : array { |
|
58 | - return $this->params; |
|
59 | - } |
|
57 | + public function getParams() : array { |
|
58 | + return $this->params; |
|
59 | + } |
|
60 | 60 | |
61 | - public function getReturnType() { |
|
62 | - return $this->returnType; |
|
63 | - } |
|
61 | + public function getReturnType() { |
|
62 | + return $this->returnType; |
|
63 | + } |
|
64 | 64 | |
65 | - public function getAttrGroups() : array { |
|
66 | - return $this->attrGroups; |
|
67 | - } |
|
65 | + public function getAttrGroups() : array { |
|
66 | + return $this->attrGroups; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @return Node\Stmt\Return_[] |
|
71 | - */ |
|
72 | - public function getStmts() : array { |
|
73 | - return [new Node\Stmt\Return_($this->expr)]; |
|
74 | - } |
|
69 | + /** |
|
70 | + * @return Node\Stmt\Return_[] |
|
71 | + */ |
|
72 | + public function getStmts() : array { |
|
73 | + return [new Node\Stmt\Return_($this->expr)]; |
|
74 | + } |
|
75 | 75 | |
76 | - public function getType() : string { |
|
77 | - return 'Expr_ArrowFunction'; |
|
78 | - } |
|
76 | + public function getType() : string { |
|
77 | + return 'Expr_ArrowFunction'; |
|
78 | + } |
|
79 | 79 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | use PhpParser\Node\Expr; |
7 | 7 | use PhpParser\Node\FunctionLike; |
8 | 8 | |
9 | -class ArrowFunction extends Expr implements FunctionLike |
|
10 | -{ |
|
9 | +class ArrowFunction extends Expr implements FunctionLike { |
|
11 | 10 | /** @var bool */ |
12 | 11 | public $static; |
13 | 12 |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | abstract class BinaryOp extends Expr |
8 | 8 | { |
9 | - /** @var Expr The left hand side expression */ |
|
10 | - public $left; |
|
11 | - /** @var Expr The right hand side expression */ |
|
12 | - public $right; |
|
9 | + /** @var Expr The left hand side expression */ |
|
10 | + public $left; |
|
11 | + /** @var Expr The right hand side expression */ |
|
12 | + public $right; |
|
13 | 13 | |
14 | - /** |
|
15 | - * Constructs a binary operator node. |
|
16 | - * |
|
17 | - * @param Expr $left The left hand side expression |
|
18 | - * @param Expr $right The right hand side expression |
|
19 | - * @param array $attributes Additional attributes |
|
20 | - */ |
|
21 | - public function __construct(Expr $left, Expr $right, array $attributes = []) { |
|
22 | - $this->attributes = $attributes; |
|
23 | - $this->left = $left; |
|
24 | - $this->right = $right; |
|
25 | - } |
|
14 | + /** |
|
15 | + * Constructs a binary operator node. |
|
16 | + * |
|
17 | + * @param Expr $left The left hand side expression |
|
18 | + * @param Expr $right The right hand side expression |
|
19 | + * @param array $attributes Additional attributes |
|
20 | + */ |
|
21 | + public function __construct(Expr $left, Expr $right, array $attributes = []) { |
|
22 | + $this->attributes = $attributes; |
|
23 | + $this->left = $left; |
|
24 | + $this->right = $right; |
|
25 | + } |
|
26 | 26 | |
27 | - public function getSubNodeNames() : array { |
|
28 | - return ['left', 'right']; |
|
29 | - } |
|
27 | + public function getSubNodeNames() : array { |
|
28 | + return ['left', 'right']; |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Get the operator sigil for this binary operation. |
|
33 | - * |
|
34 | - * In the case there are multiple possible sigils for an operator, this method does not |
|
35 | - * necessarily return the one used in the parsed code. |
|
36 | - * |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - abstract public function getOperatorSigil() : string; |
|
31 | + /** |
|
32 | + * Get the operator sigil for this binary operation. |
|
33 | + * |
|
34 | + * In the case there are multiple possible sigils for an operator, this method does not |
|
35 | + * necessarily return the one used in the parsed code. |
|
36 | + * |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + abstract public function getOperatorSigil() : string; |
|
40 | 40 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\Node\Expr; |
6 | 6 | |
7 | -abstract class BinaryOp extends Expr |
|
8 | -{ |
|
7 | +abstract class BinaryOp extends Expr { |
|
9 | 8 | /** @var Expr The left hand side expression */ |
10 | 9 | public $left; |
11 | 10 | /** @var Expr The right hand side expression */ |
@@ -6,25 +6,25 @@ |
||
6 | 6 | |
7 | 7 | class ErrorSuppress extends Expr |
8 | 8 | { |
9 | - /** @var Expr Expression */ |
|
10 | - public $expr; |
|
9 | + /** @var Expr Expression */ |
|
10 | + public $expr; |
|
11 | 11 | |
12 | - /** |
|
13 | - * Constructs an error suppress node. |
|
14 | - * |
|
15 | - * @param Expr $expr Expression |
|
16 | - * @param array $attributes Additional attributes |
|
17 | - */ |
|
18 | - public function __construct(Expr $expr, array $attributes = []) { |
|
19 | - $this->attributes = $attributes; |
|
20 | - $this->expr = $expr; |
|
21 | - } |
|
12 | + /** |
|
13 | + * Constructs an error suppress node. |
|
14 | + * |
|
15 | + * @param Expr $expr Expression |
|
16 | + * @param array $attributes Additional attributes |
|
17 | + */ |
|
18 | + public function __construct(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 'Expr_ErrorSuppress'; |
|
29 | - } |
|
27 | + public function getType() : string { |
|
28 | + return 'Expr_ErrorSuppress'; |
|
29 | + } |
|
30 | 30 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\Node\Expr; |
6 | 6 | |
7 | -class ErrorSuppress extends Expr |
|
8 | -{ |
|
7 | +class ErrorSuppress extends Expr { |
|
9 | 8 | /** @var Expr Expression */ |
10 | 9 | public $expr; |
11 | 10 |
@@ -9,37 +9,37 @@ |
||
9 | 9 | |
10 | 10 | class NullsafeMethodCall extends CallLike |
11 | 11 | { |
12 | - /** @var Expr Variable holding object */ |
|
13 | - public $var; |
|
14 | - /** @var Identifier|Expr Method name */ |
|
15 | - public $name; |
|
16 | - /** @var array<Arg|VariadicPlaceholder> Arguments */ |
|
17 | - public $args; |
|
12 | + /** @var Expr Variable holding object */ |
|
13 | + public $var; |
|
14 | + /** @var Identifier|Expr Method name */ |
|
15 | + public $name; |
|
16 | + /** @var array<Arg|VariadicPlaceholder> Arguments */ |
|
17 | + public $args; |
|
18 | 18 | |
19 | - /** |
|
20 | - * Constructs a nullsafe method call node. |
|
21 | - * |
|
22 | - * @param Expr $var Variable holding object |
|
23 | - * @param string|Identifier|Expr $name Method name |
|
24 | - * @param array<Arg|VariadicPlaceholder> $args Arguments |
|
25 | - * @param array $attributes Additional attributes |
|
26 | - */ |
|
27 | - public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { |
|
28 | - $this->attributes = $attributes; |
|
29 | - $this->var = $var; |
|
30 | - $this->name = \is_string($name) ? new Identifier($name) : $name; |
|
31 | - $this->args = $args; |
|
32 | - } |
|
19 | + /** |
|
20 | + * Constructs a nullsafe method call node. |
|
21 | + * |
|
22 | + * @param Expr $var Variable holding object |
|
23 | + * @param string|Identifier|Expr $name Method name |
|
24 | + * @param array<Arg|VariadicPlaceholder> $args Arguments |
|
25 | + * @param array $attributes Additional attributes |
|
26 | + */ |
|
27 | + public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { |
|
28 | + $this->attributes = $attributes; |
|
29 | + $this->var = $var; |
|
30 | + $this->name = \is_string($name) ? new Identifier($name) : $name; |
|
31 | + $this->args = $args; |
|
32 | + } |
|
33 | 33 | |
34 | - public function getSubNodeNames() : array { |
|
35 | - return ['var', 'name', 'args']; |
|
36 | - } |
|
34 | + public function getSubNodeNames() : array { |
|
35 | + return ['var', 'name', 'args']; |
|
36 | + } |
|
37 | 37 | |
38 | - public function getType() : string { |
|
39 | - return 'Expr_NullsafeMethodCall'; |
|
40 | - } |
|
38 | + public function getType() : string { |
|
39 | + return 'Expr_NullsafeMethodCall'; |
|
40 | + } |
|
41 | 41 | |
42 | - public function getRawArgs(): array { |
|
43 | - return $this->args; |
|
44 | - } |
|
42 | + public function getRawArgs(): array { |
|
43 | + return $this->args; |
|
44 | + } |
|
45 | 45 | } |
@@ -7,8 +7,7 @@ |
||
7 | 7 | use PhpParser\Node\Identifier; |
8 | 8 | use PhpParser\Node\VariadicPlaceholder; |
9 | 9 | |
10 | -class NullsafeMethodCall extends CallLike |
|
11 | -{ |
|
10 | +class NullsafeMethodCall extends CallLike { |
|
12 | 11 | /** @var Expr Variable holding object */ |
13 | 12 | public $var; |
14 | 13 | /** @var Identifier|Expr Method name */ |
@@ -6,25 +6,25 @@ |
||
6 | 6 | |
7 | 7 | class Isset_ extends Expr |
8 | 8 | { |
9 | - /** @var Expr[] Variables */ |
|
10 | - public $vars; |
|
9 | + /** @var Expr[] Variables */ |
|
10 | + public $vars; |
|
11 | 11 | |
12 | - /** |
|
13 | - * Constructs an array node. |
|
14 | - * |
|
15 | - * @param Expr[] $vars Variables |
|
16 | - * @param array $attributes Additional attributes |
|
17 | - */ |
|
18 | - public function __construct(array $vars, array $attributes = []) { |
|
19 | - $this->attributes = $attributes; |
|
20 | - $this->vars = $vars; |
|
21 | - } |
|
12 | + /** |
|
13 | + * Constructs an array node. |
|
14 | + * |
|
15 | + * @param Expr[] $vars Variables |
|
16 | + * @param array $attributes Additional attributes |
|
17 | + */ |
|
18 | + public function __construct(array $vars, array $attributes = []) { |
|
19 | + $this->attributes = $attributes; |
|
20 | + $this->vars = $vars; |
|
21 | + } |
|
22 | 22 | |
23 | - public function getSubNodeNames() : array { |
|
24 | - return ['vars']; |
|
25 | - } |
|
23 | + public function getSubNodeNames() : array { |
|
24 | + return ['vars']; |
|
25 | + } |
|
26 | 26 | |
27 | - public function getType() : string { |
|
28 | - return 'Expr_Isset'; |
|
29 | - } |
|
27 | + public function getType() : string { |
|
28 | + return 'Expr_Isset'; |
|
29 | + } |
|
30 | 30 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use PhpParser\Node\Expr; |
6 | 6 | |
7 | -class Isset_ extends Expr |
|
8 | -{ |
|
7 | +class Isset_ extends Expr { |
|
9 | 8 | /** @var Expr[] Variables */ |
10 | 9 | public $vars; |
11 | 10 |
@@ -9,67 +9,67 @@ |
||
9 | 9 | */ |
10 | 10 | class Identifier extends NodeAbstract |
11 | 11 | { |
12 | - /** @var string Identifier as string */ |
|
13 | - public $name; |
|
12 | + /** @var string Identifier as string */ |
|
13 | + public $name; |
|
14 | 14 | |
15 | - private static $specialClassNames = [ |
|
16 | - 'self' => true, |
|
17 | - 'parent' => true, |
|
18 | - 'static' => true, |
|
19 | - ]; |
|
15 | + private static $specialClassNames = [ |
|
16 | + 'self' => true, |
|
17 | + 'parent' => true, |
|
18 | + 'static' => true, |
|
19 | + ]; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Constructs an identifier node. |
|
23 | - * |
|
24 | - * @param string $name Identifier as string |
|
25 | - * @param array $attributes Additional attributes |
|
26 | - */ |
|
27 | - public function __construct(string $name, array $attributes = []) { |
|
28 | - $this->attributes = $attributes; |
|
29 | - $this->name = $name; |
|
30 | - } |
|
21 | + /** |
|
22 | + * Constructs an identifier node. |
|
23 | + * |
|
24 | + * @param string $name Identifier as string |
|
25 | + * @param array $attributes Additional attributes |
|
26 | + */ |
|
27 | + public function __construct(string $name, array $attributes = []) { |
|
28 | + $this->attributes = $attributes; |
|
29 | + $this->name = $name; |
|
30 | + } |
|
31 | 31 | |
32 | - public function getSubNodeNames() : array { |
|
33 | - return ['name']; |
|
34 | - } |
|
32 | + public function getSubNodeNames() : array { |
|
33 | + return ['name']; |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Get identifier as string. |
|
38 | - * |
|
39 | - * @return string Identifier as string. |
|
40 | - */ |
|
41 | - public function toString() : string { |
|
42 | - return $this->name; |
|
43 | - } |
|
36 | + /** |
|
37 | + * Get identifier as string. |
|
38 | + * |
|
39 | + * @return string Identifier as string. |
|
40 | + */ |
|
41 | + public function toString() : string { |
|
42 | + return $this->name; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * Get lowercased identifier as string. |
|
47 | - * |
|
48 | - * @return string Lowercased identifier as string |
|
49 | - */ |
|
50 | - public function toLowerString() : string { |
|
51 | - return strtolower($this->name); |
|
52 | - } |
|
45 | + /** |
|
46 | + * Get lowercased identifier as string. |
|
47 | + * |
|
48 | + * @return string Lowercased identifier as string |
|
49 | + */ |
|
50 | + public function toLowerString() : string { |
|
51 | + return strtolower($this->name); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Checks whether the identifier is a special class name (self, parent or static). |
|
56 | - * |
|
57 | - * @return bool Whether identifier is a special class name |
|
58 | - */ |
|
59 | - public function isSpecialClassName() : bool { |
|
60 | - return isset(self::$specialClassNames[strtolower($this->name)]); |
|
61 | - } |
|
54 | + /** |
|
55 | + * Checks whether the identifier is a special class name (self, parent or static). |
|
56 | + * |
|
57 | + * @return bool Whether identifier is a special class name |
|
58 | + */ |
|
59 | + public function isSpecialClassName() : bool { |
|
60 | + return isset(self::$specialClassNames[strtolower($this->name)]); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get identifier as string. |
|
65 | - * |
|
66 | - * @return string Identifier as string |
|
67 | - */ |
|
68 | - public function __toString() : string { |
|
69 | - return $this->name; |
|
70 | - } |
|
63 | + /** |
|
64 | + * Get identifier as string. |
|
65 | + * |
|
66 | + * @return string Identifier as string |
|
67 | + */ |
|
68 | + public function __toString() : string { |
|
69 | + return $this->name; |
|
70 | + } |
|
71 | 71 | |
72 | - public function getType() : string { |
|
73 | - return 'Identifier'; |
|
74 | - } |
|
72 | + public function getType() : string { |
|
73 | + return 'Identifier'; |
|
74 | + } |
|
75 | 75 | } |
@@ -7,8 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Represents a non-namespaced name. Namespaced names are represented using Name nodes. |
9 | 9 | */ |
10 | -class Identifier extends NodeAbstract |
|
11 | -{ |
|
10 | +class Identifier extends NodeAbstract { |
|
12 | 11 | /** @var string Identifier as string */ |
13 | 12 | public $name; |
14 | 13 |
@@ -4,47 +4,47 @@ |
||
4 | 4 | |
5 | 5 | class FullyQualified extends \PhpParser\Node\Name |
6 | 6 | { |
7 | - /** |
|
8 | - * Checks whether the name is unqualified. (E.g. Name) |
|
9 | - * |
|
10 | - * @return bool Whether the name is unqualified |
|
11 | - */ |
|
12 | - public function isUnqualified() : bool { |
|
13 | - return false; |
|
14 | - } |
|
7 | + /** |
|
8 | + * Checks whether the name is unqualified. (E.g. Name) |
|
9 | + * |
|
10 | + * @return bool Whether the name is unqualified |
|
11 | + */ |
|
12 | + public function isUnqualified() : bool { |
|
13 | + return false; |
|
14 | + } |
|
15 | 15 | |
16 | - /** |
|
17 | - * Checks whether the name is qualified. (E.g. Name\Name) |
|
18 | - * |
|
19 | - * @return bool Whether the name is qualified |
|
20 | - */ |
|
21 | - public function isQualified() : bool { |
|
22 | - return false; |
|
23 | - } |
|
16 | + /** |
|
17 | + * Checks whether the name is qualified. (E.g. Name\Name) |
|
18 | + * |
|
19 | + * @return bool Whether the name is qualified |
|
20 | + */ |
|
21 | + public function isQualified() : bool { |
|
22 | + return false; |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Checks whether the name is fully qualified. (E.g. \Name) |
|
27 | - * |
|
28 | - * @return bool Whether the name is fully qualified |
|
29 | - */ |
|
30 | - public function isFullyQualified() : bool { |
|
31 | - return true; |
|
32 | - } |
|
25 | + /** |
|
26 | + * Checks whether the name is fully qualified. (E.g. \Name) |
|
27 | + * |
|
28 | + * @return bool Whether the name is fully qualified |
|
29 | + */ |
|
30 | + public function isFullyQualified() : bool { |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) |
|
36 | - * |
|
37 | - * @return bool Whether the name is relative |
|
38 | - */ |
|
39 | - public function isRelative() : bool { |
|
40 | - return false; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) |
|
36 | + * |
|
37 | + * @return bool Whether the name is relative |
|
38 | + */ |
|
39 | + public function isRelative() : bool { |
|
40 | + return false; |
|
41 | + } |
|
42 | 42 | |
43 | - public function toCodeString() : string { |
|
44 | - return '\\' . $this->toString(); |
|
45 | - } |
|
43 | + public function toCodeString() : string { |
|
44 | + return '\\' . $this->toString(); |
|
45 | + } |
|
46 | 46 | |
47 | - public function getType() : string { |
|
48 | - return 'Name_FullyQualified'; |
|
49 | - } |
|
47 | + public function getType() : string { |
|
48 | + return 'Name_FullyQualified'; |
|
49 | + } |
|
50 | 50 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function toCodeString() : string { |
44 | - return '\\' . $this->toString(); |
|
44 | + return '\\'.$this->toString(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getType() : string { |
@@ -4,47 +4,47 @@ |
||
4 | 4 | |
5 | 5 | class Relative extends \PhpParser\Node\Name |
6 | 6 | { |
7 | - /** |
|
8 | - * Checks whether the name is unqualified. (E.g. Name) |
|
9 | - * |
|
10 | - * @return bool Whether the name is unqualified |
|
11 | - */ |
|
12 | - public function isUnqualified() : bool { |
|
13 | - return false; |
|
14 | - } |
|
7 | + /** |
|
8 | + * Checks whether the name is unqualified. (E.g. Name) |
|
9 | + * |
|
10 | + * @return bool Whether the name is unqualified |
|
11 | + */ |
|
12 | + public function isUnqualified() : bool { |
|
13 | + return false; |
|
14 | + } |
|
15 | 15 | |
16 | - /** |
|
17 | - * Checks whether the name is qualified. (E.g. Name\Name) |
|
18 | - * |
|
19 | - * @return bool Whether the name is qualified |
|
20 | - */ |
|
21 | - public function isQualified() : bool { |
|
22 | - return false; |
|
23 | - } |
|
16 | + /** |
|
17 | + * Checks whether the name is qualified. (E.g. Name\Name) |
|
18 | + * |
|
19 | + * @return bool Whether the name is qualified |
|
20 | + */ |
|
21 | + public function isQualified() : bool { |
|
22 | + return false; |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Checks whether the name is fully qualified. (E.g. \Name) |
|
27 | - * |
|
28 | - * @return bool Whether the name is fully qualified |
|
29 | - */ |
|
30 | - public function isFullyQualified() : bool { |
|
31 | - return false; |
|
32 | - } |
|
25 | + /** |
|
26 | + * Checks whether the name is fully qualified. (E.g. \Name) |
|
27 | + * |
|
28 | + * @return bool Whether the name is fully qualified |
|
29 | + */ |
|
30 | + public function isFullyQualified() : bool { |
|
31 | + return false; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) |
|
36 | - * |
|
37 | - * @return bool Whether the name is relative |
|
38 | - */ |
|
39 | - public function isRelative() : bool { |
|
40 | - return true; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name) |
|
36 | + * |
|
37 | + * @return bool Whether the name is relative |
|
38 | + */ |
|
39 | + public function isRelative() : bool { |
|
40 | + return true; |
|
41 | + } |
|
42 | 42 | |
43 | - public function toCodeString() : string { |
|
44 | - return 'namespace\\' . $this->toString(); |
|
45 | - } |
|
43 | + public function toCodeString() : string { |
|
44 | + return 'namespace\\' . $this->toString(); |
|
45 | + } |
|
46 | 46 | |
47 | - public function getType() : string { |
|
48 | - return 'Name_Relative'; |
|
49 | - } |
|
47 | + public function getType() : string { |
|
48 | + return 'Name_Relative'; |
|
49 | + } |
|
50 | 50 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function toCodeString() : string { |
44 | - return 'namespace\\' . $this->toString(); |
|
44 | + return 'namespace\\'.$this->toString(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getType() : string { |
@@ -7,23 +7,23 @@ |
||
7 | 7 | |
8 | 8 | class AttributeGroup extends NodeAbstract |
9 | 9 | { |
10 | - /** @var Attribute[] Attributes */ |
|
11 | - public $attrs; |
|
10 | + /** @var Attribute[] Attributes */ |
|
11 | + public $attrs; |
|
12 | 12 | |
13 | - /** |
|
14 | - * @param Attribute[] $attrs PHP attributes |
|
15 | - * @param array $attributes Additional node attributes |
|
16 | - */ |
|
17 | - public function __construct(array $attrs, array $attributes = []) { |
|
18 | - $this->attributes = $attributes; |
|
19 | - $this->attrs = $attrs; |
|
20 | - } |
|
13 | + /** |
|
14 | + * @param Attribute[] $attrs PHP attributes |
|
15 | + * @param array $attributes Additional node attributes |
|
16 | + */ |
|
17 | + public function __construct(array $attrs, array $attributes = []) { |
|
18 | + $this->attributes = $attributes; |
|
19 | + $this->attrs = $attrs; |
|
20 | + } |
|
21 | 21 | |
22 | - public function getSubNodeNames() : array { |
|
23 | - return ['attrs']; |
|
24 | - } |
|
22 | + public function getSubNodeNames() : array { |
|
23 | + return ['attrs']; |
|
24 | + } |
|
25 | 25 | |
26 | - public function getType() : string { |
|
27 | - return 'AttributeGroup'; |
|
28 | - } |
|
26 | + public function getType() : string { |
|
27 | + return 'AttributeGroup'; |
|
28 | + } |
|
29 | 29 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use PhpParser\Node; |
6 | 6 | use PhpParser\NodeAbstract; |
7 | 7 | |
8 | -class AttributeGroup extends NodeAbstract |
|
9 | -{ |
|
8 | +class AttributeGroup extends NodeAbstract { |
|
10 | 9 | /** @var Attribute[] Attributes */ |
11 | 10 | public $attrs; |
12 | 11 |