@@ -54,7 +54,7 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode
54
54
} elseif ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_SQUARE_BRACKET )) {
55
55
$ type = $ this ->tryParseArray ($ tokens , $ type );
56
56
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 () ) {
58
58
$ type = $ this ->parseArrayShape ($ tokens , $ type );
59
59
}
60
60
}
@@ -97,7 +97,7 @@ private function parseNullable(TokenIterator $tokens): Ast\Type\TypeNode
97
97
if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )) {
98
98
$ type = $ this ->parseGeneric ($ tokens , $ type );
99
99
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 () ) {
101
101
$ type = $ this ->parseArrayShape ($ tokens , $ type );
102
102
}
103
103
@@ -174,7 +174,7 @@ private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNo
174
174
if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )) {
175
175
$ type = $ this ->parseGeneric ($ tokens , $ type );
176
176
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 () ) {
178
178
$ type = $ this ->parseArrayShape ($ tokens , $ type );
179
179
}
180
180
}
0 commit comments