diff --git a/src/Ast/FunctionReturnType.php b/src/Ast/FunctionReturnType.php index 19cdf84..d271d07 100644 --- a/src/Ast/FunctionReturnType.php +++ b/src/Ast/FunctionReturnType.php @@ -52,7 +52,7 @@ public function toString() public static function parse(NodeParser $parser) { $indentation = $parser->consumeNodeIndentation(); - $parser->consumeAsUnknowContent(':'); + $parser->consumeAsIndentation(':'); $parser->consumeWhitespace(); $indentation .= $parser->flushIndentation(); $nullable = FALSE; diff --git a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump index f5dc6e3..5d32e03 100644 --- a/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump +++ b/tests/PhpSimpleAst/fixtures/PHP-8.0/80000.union-types.dump @@ -82,7 +82,7 @@ CzProject\PhpSimpleAst\Ast\PhpString | | | | | | | | | defaultValue: null | | | | | | | closer: ')' | | | | | | returnType: CzProject\PhpSimpleAst\Ast\FunctionReturnType - | | | | | | | indentation: ' ' + | | | | | | | indentation: ': ' | | | | | | | nullable: false | | | | | | | type: CzProject\PhpSimpleAst\Ast\Type | | | | | | | | indentation: ''