File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Conditional
2020 = 1 * ByteHorizontalWs TokenIs [TokenNot ] Atomic TokenNullable Atomic TokenColon Atomic
2121
2222Nullable
23- = TokenNullable TokenIdentifier [ Generic ]
23+ = TokenNullable Atomic
2424
2525Atomic
2626 = TokenIdentifier [Generic / Callable / Array ]
Original file line number Diff line number Diff line change @@ -282,19 +282,7 @@ private function parseNullable(TokenIterator $tokens): Ast\Type\TypeNode
282282 {
283283 $ tokens ->consumeTokenType (Lexer::TOKEN_NULLABLE );
284284
285- $ type = new Ast \Type \IdentifierTypeNode ($ tokens ->currentTokenValue ());
286- $ tokens ->consumeTokenType (Lexer::TOKEN_IDENTIFIER );
287-
288- if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET )) {
289- $ type = $ this ->parseGeneric ($ tokens , $ type );
290-
291- } elseif ($ type ->name === 'array ' && $ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET ) && !$ tokens ->isPrecededByHorizontalWhitespace ()) {
292- $ type = $ this ->parseArrayShape ($ tokens , $ type );
293- }
294-
295- if ($ tokens ->isCurrentTokenType (Lexer::TOKEN_OPEN_SQUARE_BRACKET )) {
296- $ type = $ this ->tryParseArrayOrOffsetAccess ($ tokens , $ type );
297- }
285+ $ type = $ this ->parseAtomic ($ tokens );
298286
299287 return new Ast \Type \NullableTypeNode ($ type );
300288 }
Original file line number Diff line number Diff line change @@ -1255,6 +1255,17 @@ public function provideParseData(): array
12551255 false
12561256 ),
12571257 ],
1258+ [
1259+ '?Currency::CURRENCY_* ' ,
1260+ new NullableTypeNode (
1261+ new ConstTypeNode (
1262+ new ConstFetchNode (
1263+ 'Currency ' ,
1264+ 'CURRENCY_* '
1265+ )
1266+ )
1267+ ),
1268+ ],
12581269 ];
12591270 }
12601271
You can’t perform that action at this time.
0 commit comments