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:
parent
a485ecd7ba
commit
5219f75719
@ -34,7 +34,7 @@ class Standard extends PrettyPrinterAbstract
|
||||
}
|
||||
|
||||
protected function pNullableType(Node\NullableType $node) {
|
||||
return '?' . $node->type;
|
||||
return '?' . $this->pType($node->type);
|
||||
}
|
||||
|
||||
// Names
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user