@@ -283,8 +283,31 @@ public function testReturnTypeRule(): void
283
283
]);
284
284
}
285
285
286
+ public function testMisleadingMixedType (): void
287
+ {
288
+ if (PHP_VERSION_ID >= 80000 ) {
289
+ $ errors = [];
290
+ } else {
291
+ $ errors = [
292
+ [
293
+ 'Method MethodMisleadingMixedReturn\Foo::misleadingMixedReturnType() should return MethodMisleadingMixedReturn\mixed but returns int. ' ,
294
+ 11 ,
295
+ ],
296
+ [
297
+ 'Method MethodMisleadingMixedReturn\Foo::misleadingMixedReturnType() should return MethodMisleadingMixedReturn\mixed but returns true. ' ,
298
+ 14 ,
299
+ ],
300
+ ];
301
+ }
302
+ $ this ->analyse ([__DIR__ . '/data/method-misleading-mixed-return.php ' ], $ errors );
303
+ }
304
+
286
305
public function testMisleadingTypehintsInClassWithoutNamespace (): void
287
306
{
307
+ if (PHP_VERSION_ID < 80000 ) {
308
+ self ::markTestSkipped ('Test requires PHP 8.0. ' );
309
+ }
310
+
288
311
$ this ->analyse ([__DIR__ . '/data/misleadingTypehints.php ' ], [
289
312
[
290
313
'Method FooWithoutNamespace::misleadingBoolReturnType() should return boolean but returns true. ' ,
@@ -522,6 +545,10 @@ public function testBug2573(): void
522
545
523
546
public function testBug4603 (): void
524
547
{
548
+ if (PHP_VERSION_ID < 80000 ) {
549
+ self ::markTestSkipped ('Test requires PHP 8.0. ' );
550
+ }
551
+
525
552
$ this ->analyse ([__DIR__ . '/data/bug-4603.php ' ], []);
526
553
}
527
554
@@ -774,6 +801,10 @@ public function testBug6358(): void
774
801
775
802
public function testBug8071 (): void
776
803
{
804
+ if (PHP_VERSION_ID < 80000 ) {
805
+ self ::markTestSkipped ('Test requires PHP 8.0. ' );
806
+ }
807
+
777
808
$ this ->checkExplicitMixed = true ;
778
809
$ this ->analyse ([__DIR__ . '/data/bug-8071.php ' ], [
779
810
[
0 commit comments