mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
Support false
and null
unions in PHP 8 signatures
This commit is contained in:
parent
4acaf40f26
commit
66e40f1007
@ -194,7 +194,11 @@ abstract class Atomic implements TypeNode
|
|||||||
return $php_version !== null ? new TNamedObject($value) : new TTrue();
|
return $php_version !== null ? new TNamedObject($value) : new TTrue();
|
||||||
|
|
||||||
case 'false':
|
case 'false':
|
||||||
return $php_version !== null ? new TNamedObject($value) : new TFalse();
|
if ($php_version === null || $php_version[0] >= 8) {
|
||||||
|
return new TFalse();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new TNamedObject($value);
|
||||||
|
|
||||||
case 'empty':
|
case 'empty':
|
||||||
return $php_version !== null ? new TNamedObject($value) : new TEmpty();
|
return $php_version !== null ? new TNamedObject($value) : new TEmpty();
|
||||||
@ -203,7 +207,11 @@ abstract class Atomic implements TypeNode
|
|||||||
return $php_version !== null ? new TNamedObject($value) : new TScalar();
|
return $php_version !== null ? new TNamedObject($value) : new TScalar();
|
||||||
|
|
||||||
case 'null':
|
case 'null':
|
||||||
return $php_version !== null ? new TNamedObject($value) : new TNull();
|
if ($php_version === null || $php_version[0] >= 8) {
|
||||||
|
return new TNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new TNamedObject($value);
|
||||||
|
|
||||||
case 'mixed':
|
case 'mixed':
|
||||||
if ($php_version === null || $php_version[0] >= 8) {
|
if ($php_version === null || $php_version[0] >= 8) {
|
||||||
|
Loading…
Reference in New Issue
Block a user