mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Allow 0 in type
This commit is contained in:
parent
d56dd6bed6
commit
7fb4c4acad
@ -594,6 +594,7 @@ abstract class Type
|
|||||||
|
|
||||||
if ($string_type_token[0] === '"'
|
if ($string_type_token[0] === '"'
|
||||||
|| $string_type_token[0] === '\''
|
|| $string_type_token[0] === '\''
|
||||||
|
|| $string_type_token === '0'
|
||||||
|| preg_match('/[1-9]/', $string_type_token[0])
|
|| preg_match('/[1-9]/', $string_type_token[0])
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
@ -653,10 +654,6 @@ abstract class Type
|
|||||||
throw new \InvalidArgumentException('$class cannot be empty');
|
throw new \InvalidArgumentException('$class cannot be empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($class === '0') {
|
|
||||||
throw new TypeParseTreeException('Unrecognised class 0');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($class[0] === '\\') {
|
if ($class[0] === '\\') {
|
||||||
return substr($class, 1);
|
return substr($class, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user