File tree 3 files changed +13
-14
lines changed
3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Conditional
20
20
= 1 * ByteHorizontalWs TokenIs [TokenNot ] Atomic TokenNullable Atomic TokenColon Atomic
21
21
22
22
Nullable
23
- = TokenNullable TokenIdentifier [ Generic ]
23
+ = TokenNullable Atomic
24
24
25
25
Atomic
26
26
= 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
282
282
{
283
283
$ tokens ->consumeTokenType (Lexer::TOKEN_NULLABLE );
284
284
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 );
298
286
299
287
return new Ast \Type \NullableTypeNode ($ type );
300
288
}
Original file line number Diff line number Diff line change @@ -1255,6 +1255,17 @@ public function provideParseData(): array
1255
1255
false
1256
1256
),
1257
1257
],
1258
+ [
1259
+ '?Currency::CURRENCY_* ' ,
1260
+ new NullableTypeNode (
1261
+ new ConstTypeNode (
1262
+ new ConstFetchNode (
1263
+ 'Currency ' ,
1264
+ 'CURRENCY_* '
1265
+ )
1266
+ )
1267
+ ),
1268
+ ],
1258
1269
];
1259
1270
}
1260
1271
You can’t perform that action at this time.
0 commit comments