Skip to content

Commit 481a805

Browse files
committed
[TypeResolver] Updated Lexer PREG pattern to ignore whitespaces
1 parent be44eb6 commit 481a805

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function resolve($type, Context $context = null)
115115
}
116116

117117
// split the type string into tokens `|`, `?`, `(`, `)[]`, '<', '>' and type names
118-
$tokens = preg_split('/(\\||\\?|<|>|,|\\(|\\)(?:\\[\\])+)/', $type, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
118+
$tokens = preg_split('/\s*(\\||\\?|<|>|,|\\(|\\)(?:\\[\\])+)\s*/', $type, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
119119
$tokenIterator = new \ArrayIterator($tokens);
120120

121121
return $this->parseTypes($tokenIterator, $context, self::PARSER_IN_COMPOUND);

0 commit comments

Comments
 (0)