@@ -21,8 +21,6 @@ class ClassConstantRuleTest extends RuleTestCase
2121
2222 private int $ phpVersion ;
2323
24- private bool $ checkNonStringableDynamicAccess ;
25-
2624 protected function getRule (): Rule
2725 {
2826 $ reflectionProvider = self ::createReflectionProvider ();
@@ -36,14 +34,13 @@ protected function getRule(): Rule
3634 self ::getContainer (),
3735 ),
3836 new PhpVersion ($ this ->phpVersion ),
39- $ this -> checkNonStringableDynamicAccess ,
37+ true ,
4038 );
4139 }
4240
4341 public function testClassConstant (): void
4442 {
4543 $ this ->phpVersion = PHP_VERSION_ID ;
46- $ this ->checkNonStringableDynamicAccess = true ;
4744 $ this ->analyse (
4845 [
4946 __DIR__ . '/data/class-constant.php ' ,
@@ -107,7 +104,6 @@ public function testClassConstant(): void
107104 public function testClassConstantVisibility (): void
108105 {
109106 $ this ->phpVersion = PHP_VERSION_ID ;
110- $ this ->checkNonStringableDynamicAccess = true ;
111107 $ this ->analyse ([__DIR__ . '/data/class-constant-visibility.php ' ], [
112108 [
113109 'Access to private constant PRIVATE_BAR of class ClassConstantVisibility\Bar. ' ,
@@ -177,7 +173,6 @@ public function testClassConstantVisibility(): void
177173 public function testClassExists (): void
178174 {
179175 $ this ->phpVersion = PHP_VERSION_ID ;
180- $ this ->checkNonStringableDynamicAccess = true ;
181176 $ this ->analyse ([__DIR__ . '/data/class-exists.php ' ], [
182177 [
183178 'Class UnknownClass\Bar not found. ' ,
@@ -252,14 +247,12 @@ public static function dataClassConstantOnExpression(): array
252247 public function testClassConstantOnExpression (int $ phpVersion , array $ errors ): void
253248 {
254249 $ this ->phpVersion = $ phpVersion ;
255- $ this ->checkNonStringableDynamicAccess = true ;
256250 $ this ->analyse ([__DIR__ . '/data/class-constant-on-expr.php ' ], $ errors );
257251 }
258252
259253 public function testAttributes (): void
260254 {
261255 $ this ->phpVersion = PHP_VERSION_ID ;
262- $ this ->checkNonStringableDynamicAccess = true ;
263256 $ this ->analyse ([__DIR__ . '/data/class-constant-attribute.php ' ], [
264257 [
265258 'Access to undefined constant ClassConstantAttribute\Foo::BAR. ' ,
@@ -296,21 +289,18 @@ public function testAttributes(): void
296289 public function testRuleWithNullsafeVariant (): void
297290 {
298291 $ this ->phpVersion = PHP_VERSION_ID ;
299- $ this ->checkNonStringableDynamicAccess = true ;
300292 $ this ->analyse ([__DIR__ . '/data/class-constant-nullsafe.php ' ], []);
301293 }
302294
303295 public function testBug7675 (): void
304296 {
305297 $ this ->phpVersion = PHP_VERSION_ID ;
306- $ this ->checkNonStringableDynamicAccess = true ;
307298 $ this ->analyse ([__DIR__ . '/data/bug-7675.php ' ], []);
308299 }
309300
310301 public function testBug8034 (): void
311302 {
312303 $ this ->phpVersion = PHP_VERSION_ID ;
313- $ this ->checkNonStringableDynamicAccess = true ;
314304 $ this ->analyse ([__DIR__ . '/data/bug-8034.php ' ], [
315305 [
316306 'Access to undefined constant static(Bug8034\HelloWorld)::FIELDS. ' ,
@@ -322,7 +312,6 @@ public function testBug8034(): void
322312 public function testClassConstFetchDefined (): void
323313 {
324314 $ this ->phpVersion = PHP_VERSION_ID ;
325- $ this ->checkNonStringableDynamicAccess = true ;
326315 $ this ->analyse ([__DIR__ . '/data/class-const-fetch-defined.php ' ], [
327316 [
328317 'Access to undefined constant ClassConstFetchDefined\Foo::TEST. ' ,
@@ -424,7 +413,6 @@ public function testPhpstanInternalClass(): void
424413 $ tip = 'This is most likely unintentional. Did you mean to type \AClass? ' ;
425414
426415 $ this ->phpVersion = PHP_VERSION_ID ;
427- $ this ->checkNonStringableDynamicAccess = true ;
428416 $ this ->analyse ([__DIR__ . '/data/phpstan-internal-class.php ' ], [
429417 [
430418 'Referencing prefixed PHPStan class: _PHPStan_156ee64ba\AClass. ' ,
@@ -438,7 +426,6 @@ public function testPhpstanInternalClass(): void
438426 public function testClassConstantAccessedOnTrait (): void
439427 {
440428 $ this ->phpVersion = PHP_VERSION_ID ;
441- $ this ->checkNonStringableDynamicAccess = true ;
442429 $ this ->analyse ([__DIR__ . '/data/class-constant-accessed-on-trait.php ' ], [
443430 [
444431 'Cannot access constant TEST on trait ClassConstantAccessedOnTrait\Foo. ' ,
@@ -451,7 +438,6 @@ public function testClassConstantAccessedOnTrait(): void
451438 public function testDynamicAccess (): void
452439 {
453440 $ this ->phpVersion = PHP_VERSION_ID ;
454- $ this ->checkNonStringableDynamicAccess = true ;
455441
456442 $ this ->analyse ([__DIR__ . '/data/dynamic-constant-access.php ' ], [
457443 [
@@ -504,7 +490,6 @@ public function testStringableDynamicAccess(): void
504490 }
505491
506492 $ this ->phpVersion = PHP_VERSION_ID ;
507- $ this ->checkNonStringableDynamicAccess = true ;
508493
509494 $ this ->analyse ([__DIR__ . '/data/dynamic-constant-stringable-access.php ' ], [
510495 [
0 commit comments