1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2025-01-22 13:51:12 +01:00

Fix pretty-printing of nullable types

This commit is contained in:
Nikita Popov 2016-12-06 12:26:21 +01:00
parent a485ecd7ba
commit 5219f75719
3 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ class Standard extends PrettyPrinterAbstract
}
protected function pNullableType(Node\NullableType $node) {
return '?' . $node->type;
return '?' . $this->pType($node->type);
}
// Names

View File

@ -244,7 +244,7 @@ function fn2(array $a) : array
}
function (\NS\A $a) : \NS\A {
};
function fn3(?NS\A $a) : ?NS\A
function fn3(?\NS\A $a) : ?\NS\A
{
}
function fn4(?array $a) : ?array

View File

@ -1,11 +1,11 @@
Nullable types
-----
<?php
function test(?Foo $bar, ?string $foo) : ?Baz
function test(?Foo $bar, ?string $foo, ?\Xyz $zyx) : ?Baz
{
}
-----
!!php7
function test(?Foo $bar, ?string $foo) : ?Baz
function test(?Foo $bar, ?string $foo, ?\Xyz $zyx) : ?Baz
{
}