1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Allow better handling of questionmark type annotations

This commit is contained in:
Matthew Brown 2016-08-04 14:43:33 -04:00
parent 944a8c24eb
commit 9d4271f023

View File

@ -11,7 +11,7 @@ abstract class Type
{
/**
* Parses a string type representation
* @param string $string
* @param string $type_string
* @return Union
*/
public static function parseString($type_string)
@ -20,6 +20,8 @@ abstract class Type
$type_string = self::convertSquareBrackets($type_string);
}
$type_string = str_replace('?', 'null|', $type_string);
$type_tokens = self::tokenize($type_string);
if (count($type_tokens) === 1) {