@@ -126,6 +126,10 @@ public function provideHashedSignature(): iterable
126126 yield [true , 0 , '#[Foo] ' ];
127127 }
128128
129+ if (\PHP_VERSION_ID >= 80100 ) {
130+ yield [true , 0 , '#[Foo(new MissingClass)] ' ];
131+ }
132+
129133 yield [true , 1 , 'abstract class %s ' ];
130134 yield [true , 1 , 'final class %s ' ];
131135 yield [true , 1 , 'class %s extends Exception ' ];
@@ -135,6 +139,11 @@ public function provideHashedSignature(): iterable
135139 yield [true , 4 , '/** pub docblock */ ' ];
136140 yield [true , 5 , 'protected $pub = []; ' ];
137141 yield [true , 5 , 'public $pub = [123]; ' ];
142+
143+ if (\PHP_VERSION_ID >= 80100 ) {
144+ yield [true , 5 , '#[Foo(new MissingClass)] public $pub = []; ' ];
145+ }
146+
138147 yield [true , 6 , '/** prot docblock */ ' ];
139148 yield [true , 7 , 'private $prot; ' ];
140149 yield [false , 8 , '/** priv docblock */ ' ];
@@ -151,6 +160,11 @@ public function provideHashedSignature(): iterable
151160 yield [true , 13 , 'protected function prot(#[Foo] $a = []) {} ' ];
152161 }
153162
163+ if (\PHP_VERSION_ID >= 80100 ) {
164+ yield [true , 13 , '#[Foo(new MissingClass)] protected function prot($a = []) {} ' ];
165+ yield [true , 13 , 'protected function prot(#[Foo(new MissingClass)] $a = []) {} ' ];
166+ }
167+
154168 yield [false , 14 , '/** priv docblock */ ' ];
155169 yield [false , 15 , '' ];
156170
@@ -162,10 +176,16 @@ public function provideHashedSignature(): iterable
162176 yield [false , 9 , 'private string $priv; ' ];
163177 }
164178
179+ if (\PHP_VERSION_ID >= 80100 ) {
180+ yield [true , 17 , 'public function __construct(private $bar = new \stdClass()) {} ' ];
181+ yield [true , 17 , 'public function ccc($bar = new \stdClass()) {} ' ];
182+ yield [true , 17 , 'public function ccc($bar = new MissingClass()) {} ' ];
183+ }
184+
165185 yield [true , 17 , 'public function ccc($bar = 187) {} ' ];
166186 yield [true , 17 , 'public function ccc($bar = ANOTHER_ONE_THAT_WILL_NEVER_BE_DEFINED_CCCCCCCCC) {} ' ];
167187 yield [true , 17 , 'public function ccc($bar = parent::BOOM) {} ' ];
168- yield [true , 17 , null , static function () { \define ('A_CONSTANT_THAT_FOR_SURE_WILL_NEVER_BE_DEFINED_CCCCCC ' , 'foo ' ); }];
188+ yield [\ PHP_VERSION_ID < 80100 , 17 , null , static function () { \define ('A_CONSTANT_THAT_FOR_SURE_WILL_NEVER_BE_DEFINED_CCCCCC ' , 'foo ' ); }];
169189 }
170190
171191 public function testEventSubscriber ()
0 commit comments