@@ -126,6 +126,10 @@ public function provideHashedSignature(): iterable
126
126
yield [true , 0 , '#[Foo] ' ];
127
127
}
128
128
129
+ if (\PHP_VERSION_ID >= 80100 ) {
130
+ yield [true , 0 , '#[Foo(new MissingClass)] ' ];
131
+ }
132
+
129
133
yield [true , 1 , 'abstract class %s ' ];
130
134
yield [true , 1 , 'final class %s ' ];
131
135
yield [true , 1 , 'class %s extends Exception ' ];
@@ -135,6 +139,11 @@ public function provideHashedSignature(): iterable
135
139
yield [true , 4 , '/** pub docblock */ ' ];
136
140
yield [true , 5 , 'protected $pub = []; ' ];
137
141
yield [true , 5 , 'public $pub = [123]; ' ];
142
+
143
+ if (\PHP_VERSION_ID >= 80100 ) {
144
+ yield [true , 5 , '#[Foo(new MissingClass)] public $pub = []; ' ];
145
+ }
146
+
138
147
yield [true , 6 , '/** prot docblock */ ' ];
139
148
yield [true , 7 , 'private $prot; ' ];
140
149
yield [false , 8 , '/** priv docblock */ ' ];
@@ -151,6 +160,11 @@ public function provideHashedSignature(): iterable
151
160
yield [true , 13 , 'protected function prot(#[Foo] $a = []) {} ' ];
152
161
}
153
162
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
+
154
168
yield [false , 14 , '/** priv docblock */ ' ];
155
169
yield [false , 15 , '' ];
156
170
@@ -162,10 +176,16 @@ public function provideHashedSignature(): iterable
162
176
yield [false , 9 , 'private string $priv; ' ];
163
177
}
164
178
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
+
165
185
yield [true , 17 , 'public function ccc($bar = 187) {} ' ];
166
186
yield [true , 17 , 'public function ccc($bar = ANOTHER_ONE_THAT_WILL_NEVER_BE_DEFINED_CCCCCCCCC) {} ' ];
167
187
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 ' ); }];
169
189
}
170
190
171
191
public function testEventSubscriber ()
0 commit comments