1
0
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:
Matt Brown 2018-06-14 13:49:16 -04:00
parent dc02ca8a7a
commit d56dd6bed6

View File

@ -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);
}