File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,12 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode
111111 if ($ constExpr instanceof Ast \ConstExpr \ConstExprArrayNode) {
112112 throw $ exception ;
113113 }
114+ if ($ constExpr instanceof Ast \ConstExpr \ConstFetchNode) {
115+ if ($ tokens ->currentTokenValue () === '* ' ) {
116+ $ tokens ->consumeTokenType ($ tokens ->currentTokenType ());
117+ $ constExpr = new Ast \ConstExpr \ConstFetchNode ($ constExpr ->className , $ constExpr ->name . '* ' );
118+ }
119+ }
114120 return new Ast \Type \ConstTypeNode ($ constExpr );
115121 } catch (\LogicException $ e ) {
116122 throw $ exception ;
Original file line number Diff line number Diff line change @@ -854,6 +854,17 @@ public function provideParseData(): array
854854 '"bar" ' ,
855855 new ConstTypeNode (new ConstExprStringNode ('bar ' )),
856856 ],
857+ [
858+ 'Foo::FOO_* ' ,
859+ new ConstTypeNode (new ConstFetchNode ('Foo ' , 'FOO_* ' )),
860+ ],
861+ [
862+ '( "foo" | Foo::FOO_* ) ' ,
863+ new UnionTypeNode ([
864+ new ConstTypeNode (new ConstExprStringNode ('foo ' )),
865+ new ConstTypeNode (new ConstFetchNode ('Foo ' , 'FOO_* ' )),
866+ ]),
867+ ],
857868 ];
858869 }
859870
You can’t perform that action at this time.
0 commit comments