Skip to content

Commit 529d436

Browse files
committed
cs
1 parent 501995f commit 529d436

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+122
-86
lines changed

Diff for: src/Ast/AbstractNode.php renamed to src/Ast/BaseNode.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace PHPStan\PhpDocParser\Ast;
44

5-
abstract class AbstractNode implements Node
5+
abstract class BaseNode implements Node
66
{
77

8-
/**
9-
* @var array<string, mixed>
10-
*/
11-
protected $attributes = [];
8+
/** @var array<string, mixed> */
9+
private $attributes = [];
1210

11+
/**
12+
* @param mixed $value
13+
*/
1314
public function setAttribute(string $key, $value): void
1415
{
1516
$this->attributes[$key] = $value;
@@ -20,6 +21,10 @@ public function hasAttribute(string $key): bool
2021
return array_key_exists($key, $this->attributes);
2122
}
2223

24+
/**
25+
* @param mixed|null $default
26+
* @return mixed|null
27+
*/
2328
public function getAttribute(string $key, $default = null)
2429
{
2530
if ($this->hasAttribute($key)) {

Diff for: src/Ast/ConstExpr/ConstExprArrayItemNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprArrayItemNode extends AbstractNode implements ConstExprNode
7+
class ConstExprArrayItemNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var ConstExprNode|null */

Diff for: src/Ast/ConstExpr/ConstExprArrayNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprArrayNode extends AbstractNode implements ConstExprNode
7+
class ConstExprArrayNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var ConstExprArrayItemNode[] */

Diff for: src/Ast/ConstExpr/ConstExprFalseNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprFalseNode extends AbstractNode implements ConstExprNode
7+
class ConstExprFalseNode extends BaseNode implements ConstExprNode
88
{
99

1010
public function __toString(): string

Diff for: src/Ast/ConstExpr/ConstExprFloatNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprFloatNode extends AbstractNode implements ConstExprNode
7+
class ConstExprFloatNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var string */

Diff for: src/Ast/ConstExpr/ConstExprIntegerNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprIntegerNode extends AbstractNode implements ConstExprNode
7+
class ConstExprIntegerNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var string */

Diff for: src/Ast/ConstExpr/ConstExprNullNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprNullNode extends AbstractNode implements ConstExprNode
7+
class ConstExprNullNode extends BaseNode implements ConstExprNode
88
{
99

1010
public function __toString(): string

Diff for: src/Ast/ConstExpr/ConstExprStringNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprStringNode extends AbstractNode implements ConstExprNode
7+
class ConstExprStringNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var string */

Diff for: src/Ast/ConstExpr/ConstExprTrueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstExprTrueNode extends AbstractNode implements ConstExprNode
7+
class ConstExprTrueNode extends BaseNode implements ConstExprNode
88
{
99

1010
public function __toString(): string

Diff for: src/Ast/ConstExpr/ConstFetchNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\ConstExpr;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class ConstFetchNode extends AbstractNode implements ConstExprNode
7+
class ConstFetchNode extends BaseNode implements ConstExprNode
88
{
99

1010
/** @var string class name for class constants or empty string for non-class constants */

Diff for: src/Ast/PhpDoc/DeprecatedTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class DeprecatedTagValueNode extends AbstractNode implements PhpDocTagValueNode
7+
class DeprecatedTagValueNode extends BaseNode implements PhpDocTagValueNode
88
{
99

1010
/** @var string (may be empty) */

Diff for: src/Ast/PhpDoc/ExtendsTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
77

8-
class ExtendsTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class ExtendsTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var GenericTypeNode */

Diff for: src/Ast/PhpDoc/GenericTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class GenericTagValueNode extends AbstractNode implements PhpDocTagValueNode
7+
class GenericTagValueNode extends BaseNode implements PhpDocTagValueNode
88
{
99

1010
/** @var string (may be empty) */

Diff for: src/Ast/PhpDoc/ImplementsTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
77

8-
class ImplementsTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class ImplementsTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var GenericTypeNode */

Diff for: src/Ast/PhpDoc/InvalidTagValueNode.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
6-
use PHPStan\PhpDocParser\Parser\ParserException;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
76

8-
class InvalidTagValueNode extends AbstractNode implements PhpDocTagValueNode
7+
class InvalidTagValueNode extends BaseNode implements PhpDocTagValueNode
98
{
109

1110
/** @var string (may be empty) */
1211
public $value;
1312

14-
/** @var ParserException */
13+
/** @var \PHPStan\PhpDocParser\Parser\ParserException */
1514
public $exception;
1615

17-
public function __construct(string $value, ParserException $exception)
16+
public function __construct(string $value, \PHPStan\PhpDocParser\Parser\ParserException $exception)
1817
{
1918
$this->value = $value;
2019
$this->exception = $exception;

Diff for: src/Ast/PhpDoc/MethodTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class MethodTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class MethodTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var bool */

Diff for: src/Ast/PhpDoc/MethodTagValueParameterNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprNode;
77
use PHPStan\PhpDocParser\Ast\Node;
88
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
99

10-
class MethodTagValueParameterNode extends AbstractNode implements Node
10+
class MethodTagValueParameterNode extends BaseNode implements Node
1111
{
1212

1313
/** @var TypeNode|null */

Diff for: src/Ast/PhpDoc/MixinTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class MixinTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class MixinTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/PhpDoc/ParamTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class ParamTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class ParamTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/PhpDoc/PhpDocNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Node;
77

8-
class PhpDocNode extends AbstractNode implements Node
8+
class PhpDocNode extends BaseNode implements Node
99
{
1010

1111
/** @var PhpDocChildNode[] */

Diff for: src/Ast/PhpDoc/PhpDocTagNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class PhpDocTagNode extends AbstractNode implements PhpDocChildNode
7+
class PhpDocTagNode extends BaseNode implements PhpDocChildNode
88
{
99

1010
/** @var string */

Diff for: src/Ast/PhpDoc/PhpDocTextNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66

7-
class PhpDocTextNode extends AbstractNode implements PhpDocChildNode
7+
class PhpDocTextNode extends BaseNode implements PhpDocChildNode
88
{
99

1010
/** @var string */

Diff for: src/Ast/PhpDoc/PropertyTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class PropertyTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class PropertyTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/PhpDoc/ReturnTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class ReturnTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class ReturnTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/PhpDoc/TemplateTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class TemplateTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class TemplateTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var string */

Diff for: src/Ast/PhpDoc/ThrowsTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class ThrowsTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class ThrowsTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/PhpDoc/UsesTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
77

8-
class UsesTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class UsesTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var GenericTypeNode */

Diff for: src/Ast/PhpDoc/VarTagValueNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
77

8-
class VarTagValueNode extends AbstractNode implements PhpDocTagValueNode
8+
class VarTagValueNode extends BaseNode implements PhpDocTagValueNode
99
{
1010

1111
/** @var TypeNode */

Diff for: src/Ast/Type/ArrayShapeItemNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace PHPStan\PhpDocParser\Ast\Type;
44

5-
use PHPStan\PhpDocParser\Ast\AbstractNode;
5+
use PHPStan\PhpDocParser\Ast\BaseNode;
66
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprIntegerNode;
77
use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprStringNode;
88

9-
class ArrayShapeItemNode extends AbstractNode implements TypeNode
9+
class ArrayShapeItemNode extends BaseNode implements TypeNode
1010
{
1111

1212
/** @var ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|null */

0 commit comments

Comments
 (0)