From 29979bea1bbb7dfee30a3efea49b88b363390e80 Mon Sep 17 00:00:00 2001 From: Jan Pecha Date: Tue, 19 Mar 2024 09:16:29 +0100 Subject: [PATCH] Ast: PropertyNode, Parameter - parse union types --- src/Ast/Parameter.php | 6 +- src/Ast/PropertyNode.php | 8 +- .../PHP-8.0/80000.promoted-properties.dump | 22 ++- .../fixtures/PHP-8.0/80000.union-types.dump | 118 +++++++++++++++ .../fixtures/PHP-8.0/80000.union-types.php | 11 ++ .../PHP-8.1/80100.readonly-properties.dump | 22 ++- tests/PhpSimpleAst/fixtures/Php.method.dump | 143 +++++++++++------- .../Refactoring/PhpDocParamFixer.dump | 22 ++- 8 files changed, 269 insertions(+), 83 deletions(-) create mode 100644 tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump create mode 100644 tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.php diff --git a/src/Ast/Parameter.php b/src/Ast/Parameter.php index f0072e6..55ef91a 100644 --- a/src/Ast/Parameter.php +++ b/src/Ast/Parameter.php @@ -16,7 +16,7 @@ class Parameter implements IFunctionBody /** @var IPropertyModifier[] */ private $promotedPropertyModifiers; - /** @var NamedType|NULL */ + /** @var Type|NULL */ private $type; /** @var VariableName */ @@ -33,7 +33,7 @@ class Parameter implements IFunctionBody public function __construct( $indentation, array $promotedPropertyModifiers, - NamedType $type = NULL, + Type $type = NULL, VariableName $name, DefaultValue $defaultValue = NULL ) @@ -102,7 +102,7 @@ public static function parse(NodeParser $parser) } if (!$parser->isCurrent(T_VARIABLE, T_ELLIPSIS, '&', PhpToken::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG())) { - $type = NamedType::parse($parser->createSubParser()); + $type = Type::parse($parser->createSubParser()); $parser->tryConsumeWhitespaceAndComments(); } diff --git a/src/Ast/PropertyNode.php b/src/Ast/PropertyNode.php index 0af4404..664e9f0 100644 --- a/src/Ast/PropertyNode.php +++ b/src/Ast/PropertyNode.php @@ -15,7 +15,7 @@ class PropertyNode implements INode /** @var IPropertyModifier[] */ private $modifiers; - /** @var NamedType|NULL */ + /** @var Type|NULL */ private $type; /** @var string */ @@ -41,7 +41,7 @@ class PropertyNode implements INode public function __construct( $indentation, array $modifiers, - NamedType $type = NULL, + Type $type = NULL, $namePrefix, $name, DefaultValue $defaultValue = NULL, @@ -95,8 +95,8 @@ public static function parse(Modifiers $modifiers, NodeParser $parser) $type = NULL; if (!$parser->isCurrent(T_VARIABLE)) { - $type = NamedType::parse($parser->createSubParser()); - $parser->consumeWhitespace(); + $type = Type::parse($parser->createSubParser()); + $parser->tryConsumeWhitespace(); } $nodeIndentation = $parser->consumeNodeIndentation() . $parser->flushIndentation(); diff --git a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.promoted-properties.dump b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.promoted-properties.dump index ecc2676..077fb14 100644 --- a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.promoted-properties.dump +++ b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.promoted-properties.dump @@ -38,11 +38,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\Visibility | | | | | | | | | | | indentation: '' | | | | | | | | | | | visibility: 'protected' - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: ' ' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'int' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'int' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -57,11 +60,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\Visibility | | | | | | | | | | | indentation: '' | | | | | | | | | | | visibility: 'protected' - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: ' ' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'int' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'int' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' diff --git a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump new file mode 100644 index 0000000..f5dc6e3 --- /dev/null +++ b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump @@ -0,0 +1,118 @@ +CzProject\PhpSimpleAst\Ast\PhpString + children: array (1) + | 0 => CzProject\PhpSimpleAst\Ast\PhpNode + | | openTag: ' CzProject\PhpSimpleAst\Ast\ClassNode + | | | | indentation: '\n' + | | | | keyword: 'class' + | | | | name: CzProject\PhpSimpleAst\Ast\Name + | | | | | indentation: ' ' + | | | | | name: 'Point' + | | | | constructorValues: null + | | | | extends: null + | | | | implements: null + | | | | blockOpener: ' {' + | | | | children: array (2) + | | | | | 0 => CzProject\PhpSimpleAst\Ast\PropertyNode + | | | | | | indentation: string + | | | | | | | '\n + | | | | | | | \t ' + | | | | | | modifiers: array (1) + | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\Visibility + | | | | | | | | indentation: '' + | | | | | | | | visibility: 'public' + | | | | | | type: CzProject\PhpSimpleAst\Ast\Type + | | | | | | | indentation: ' ' + | | | | | | | types: array (2) + | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | indentation: '' + | | | | | | | | | nullableSign: '' + | | | | | | | | | typeIndentation: '' + | | | | | | | | | type: 'string' + | | | | | | | | 1 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | indentation: '|' + | | | | | | | | | nullableSign: '' + | | | | | | | | | typeIndentation: '' + | | | | | | | | | type: 'bool' + | | | | | | namePrefix: ' ' + | | | | | | name: '$prop' + | | | | | | defaultValue: null + | | | | | | closer: ';' + | | | | | 1 => CzProject\PhpSimpleAst\Ast\MethodNode + | | | | | | phpDocNode: null + | | | | | | indentation: string + | | | | | | | '\n + | | | | | | | \n + | | | | | | | \n + | | | | | | | \t ' + | | | | | | modifiers: array (0) + | | | | | | keywordPrefix: '' + | | | | | | keyword: 'function' + | | | | | | name: CzProject\PhpSimpleAst\Ast\Name + | | | | | | | indentation: ' ' + | | | | | | | name: 'func' + | | | | | | parameters: CzProject\PhpSimpleAst\Ast\Parameters + | | | | | | | indentation: '' + | | | | | | | opener: '(' + | | | | | | | parameters: array (1) + | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\Parameter + | | | | | | | | | indentation: '' + | | | | | | | | | promotedPropertyModifiers: array (0) + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type + | | | | | | | | | | indentation: '' + | | | | | | | | | | types: array (2) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'string' + | | | | | | | | | | | 1 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '|' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'bool' + | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName + | | | | | | | | | | indentation: ' ' + | | | | | | | | | | referenceSign: '' + | | | | | | | | | | variadic: null + | | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\Literal + | | | | | | | | | | | indentation: '' + | | | | | | | | | | | literal: '$x' + | | | | | | | | | defaultValue: null + | | | | | | | closer: ')' + | | | | | | returnType: CzProject\PhpSimpleAst\Ast\FunctionReturnType + | | | | | | | indentation: ' ' + | | | | | | | nullable: false + | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type + | | | | | | | | indentation: '' + | | | | | | | | types: array (2) + | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | indentation: '' + | | | | | | | | | | nullableSign: '' + | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | type: 'string' + | | | | | | | | | 1 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | indentation: '|' + | | | | | | | | | | nullableSign: '' + | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | type: 'bool' + | | | | | | body: CzProject\PhpSimpleAst\Ast\FunctionBody + | | | | | | | indentation: string + | | | | | | | | '\n + | | | | | | | | \t ' + | | | | | | | blockOpener: '{' + | | | | | | | children: array (1) + | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\UnknowNode + | | | | | | | | | content: string + | | | | | | | | | | '\n + | | | | | | | | | | \t \t return FALSE;' + | | | | | | | blockCloser: string + | | | | | | | | '\n + | | | | | | | | \t }' + | | | | blockCloser: string + | | | | | '\n + | | | | | }' + | | | 1 => CzProject\PhpSimpleAst\Ast\UnknowNode + | | | | content: '\n' + | | closeTag: null diff --git a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.php b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.php new file mode 100644 index 0000000..8cb2c8d --- /dev/null +++ b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.php @@ -0,0 +1,11 @@ + CzProject\PhpSimpleAst\Ast\ReadOnlyModifier | | | | | | | | indentation: ' ' | | | | | | | | modifier: 'readonly' - | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | indentation: ' ' - | | | | | | | nullableSign: '' - | | | | | | | typeIndentation: '' - | | | | | | | type: 'Status' + | | | | | | | types: array (1) + | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | indentation: '' + | | | | | | | | | nullableSign: '' + | | | | | | | | | typeIndentation: '' + | | | | | | | | | type: 'Status' | | | | | | namePrefix: ' ' | | | | | | name: '$status' | | | | | | defaultValue: null @@ -58,11 +61,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\Parameter | | | | | | | | | indentation: '' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'Status' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'Status' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' diff --git a/tests/PhpSimpleAst/fixtures/Php.method.dump b/tests/PhpSimpleAst/fixtures/Php.method.dump index 4b7c5a4..e95629e 100644 --- a/tests/PhpSimpleAst/fixtures/Php.method.dump +++ b/tests/PhpSimpleAst/fixtures/Php.method.dump @@ -39,11 +39,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | '\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'namespace\Foo' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'namespace\Foo' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -57,11 +60,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'Person' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'Person' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -75,11 +81,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'array' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'array' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -93,11 +102,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'callable' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'callable' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -111,11 +123,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'object' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'object' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -129,11 +144,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'int' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'int' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -147,11 +165,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'string' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'string' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -165,11 +186,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'float' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'float' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -183,11 +207,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'bool' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'bool' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -201,11 +228,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'self' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'self' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '' @@ -219,11 +249,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | ',\n | | | | | | | | | | \t \t \t ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'int' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'int' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '&' @@ -390,11 +423,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | '/*A2*/,\n | | | | | | | | | | \t \t \t /*B1*/' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'array' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'array' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: '/*B2*/' | | | | | | | | | | referenceSign: '' @@ -448,11 +484,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | 1 => CzProject\PhpSimpleAst\Ast\Parameter | | | | | | | | | indentation: ', ' | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | indentation: '' - | | | | | | | | | | nullableSign: '' - | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | type: 'array' + | | | | | | | | | | types: array (1) + | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | type: 'array' | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | indentation: ' ' | | | | | | | | | | referenceSign: '&' diff --git a/tests/PhpSimpleAst/fixtures/Refactoring/PhpDocParamFixer.dump b/tests/PhpSimpleAst/fixtures/Refactoring/PhpDocParamFixer.dump index c107c70..0ebb392 100644 --- a/tests/PhpSimpleAst/fixtures/Refactoring/PhpDocParamFixer.dump +++ b/tests/PhpSimpleAst/fixtures/Refactoring/PhpDocParamFixer.dump @@ -101,11 +101,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | 3 => CzProject\PhpSimpleAst\Ast\Parameter | | | | | | | | | | | indentation: ', ' | | | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | | | indentation: '' - | | | | | | | | | | | | nullableSign: '' - | | | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | | | type: 'array' + | | | | | | | | | | | | types: array (1) + | | | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | | | type: 'array' | | | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | | | indentation: ' ' | | | | | | | | | | | | referenceSign: '' @@ -117,11 +120,14 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | | 4 => CzProject\PhpSimpleAst\Ast\Parameter | | | | | | | | | | | indentation: ', ' | | | | | | | | | | | promotedPropertyModifiers: array (0) - | | | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | | | | | indentation: '' - | | | | | | | | | | | | nullableSign: '' - | | | | | | | | | | | | typeIndentation: '' - | | | | | | | | | | | | type: 'array' + | | | | | | | | | | | | types: array (1) + | | | | | | | | | | | | | 0 => CzProject\PhpSimpleAst\Ast\NamedType + | | | | | | | | | | | | | | indentation: '' + | | | | | | | | | | | | | | nullableSign: '' + | | | | | | | | | | | | | | typeIndentation: '' + | | | | | | | | | | | | | | type: 'array' | | | | | | | | | | | name: CzProject\PhpSimpleAst\Ast\VariableName | | | | | | | | | | | | indentation: ' ' | | | | | | | | | | | | referenceSign: ''