From 7fb4c4acad9ee037b45e836c90f5d199e49e38a5 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 14 Jun 2018 15:58:49 -0400 Subject: [PATCH] Allow 0 in type --- src/Psalm/Type.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Psalm/Type.php b/src/Psalm/Type.php index 35eb47530..3fa7fe3a5 100644 --- a/src/Psalm/Type.php +++ b/src/Psalm/Type.php @@ -594,6 +594,7 @@ abstract class Type if ($string_type_token[0] === '"' || $string_type_token[0] === '\'' + || $string_type_token === '0' || preg_match('/[1-9]/', $string_type_token[0]) ) { continue; @@ -653,10 +654,6 @@ abstract class Type throw new \InvalidArgumentException('$class cannot be empty'); } - if ($class === '0') { - throw new TypeParseTreeException('Unrecognised class 0'); - } - if ($class[0] === '\\') { return substr($class, 1); }