mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fix #818 - prevent class of 0
This commit is contained in:
parent
dc02ca8a7a
commit
d56dd6bed6
@ -649,10 +649,14 @@ abstract class Type
|
||||
*/
|
||||
public static function getFQCLNFromString($class, Aliases $aliases)
|
||||
{
|
||||
if (empty($class)) {
|
||||
if ($class === '') {
|
||||
throw new \InvalidArgumentException('$class cannot be empty');
|
||||
}
|
||||
|
||||
if ($class === '0') {
|
||||
throw new TypeParseTreeException('Unrecognised class 0');
|
||||
}
|
||||
|
||||
if ($class[0] === '\\') {
|
||||
return substr($class, 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user