@@ -54,7 +54,7 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode
5454 } elseif ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_SQUARE_BRACKET )) {
5555 $ type = $ this ->tryParseArray ($ tokens , $ type );
5656
57- } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET )) {
57+ } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET ) && ! $ tokens -> isPrecededByHorizontalWhitespace () ) {
5858 $ type = $ this ->parseArrayShape ($ tokens , $ type );
5959 }
6060 }
@@ -97,7 +97,7 @@ private function parseNullable(TokenIterator $tokens): Ast\Type\TypeNode
9797 if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )) {
9898 $ type = $ this ->parseGeneric ($ tokens , $ type );
9999
100- } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET )) {
100+ } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET ) && ! $ tokens -> isPrecededByHorizontalWhitespace () ) {
101101 $ type = $ this ->parseArrayShape ($ tokens , $ type );
102102 }
103103
@@ -174,7 +174,7 @@ private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNo
174174 if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )) {
175175 $ type = $ this ->parseGeneric ($ tokens , $ type );
176176
177- } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET )) {
177+ } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET ) && ! $ tokens -> isPrecededByHorizontalWhitespace () ) {
178178 $ type = $ this ->parseArrayShape ($ tokens , $ type );
179179 }
180180 }
0 commit comments