Skip to content

Commit 232f827

Browse files
committed
Run the native union type fixture of too-wide fixes only on PHP 8.0+
Amp-Thread-ID: https://ampcode.com/threads/T-01a22c96-9e21-771f-9a29-4627539ba301
1 parent 4b06462 commit 232f827

5 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎tests/PHPStan/Rules/TooWideTypehints/TooWideReturnTypeFixTestCase.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\CompositeRule;
77
use PHPStan\Testing\RuleTestCase;
8+
use PHPUnit\Framework\Attributes\RequiresPhp;
89

910
/**
1011
* Fixes of too-wide return types for the PHP version set by the configuration file of each subclass.
@@ -39,6 +40,7 @@ public function testFunctions(): void
3940
$this->fix(__DIR__ . '/data/fix-too-wide-return-type/functions.php', $this->getFixedFile('functions'));
4041
}
4142

43+
#[RequiresPhp('>= 8.0.0')]
4244
public function testFunctionsWithNativeUnionTypes(): void
4345
{
4446
$this->fix(__DIR__ . '/data/fix-too-wide-return-type/functions-native-union.php', $this->getFixedFile('functions-native-union'));

‎tests/PHPStan/Rules/TooWideTypehints/data/fix-too-wide-return-type/functions-native-union-php73.php.fixed‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace FixTooWideReturnTypeFunctionNativeUnion;
44

‎tests/PHPStan/Rules/TooWideTypehints/data/fix-too-wide-return-type/functions-native-union-php74.php.fixed‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace FixTooWideReturnTypeFunctionNativeUnion;
44

‎tests/PHPStan/Rules/TooWideTypehints/data/fix-too-wide-return-type/functions-native-union-php82.php.fixed‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace FixTooWideReturnTypeFunctionNativeUnion;
44

‎tests/PHPStan/Rules/TooWideTypehints/data/fix-too-wide-return-type/functions-native-union.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint >= 8.0
22

33
namespace FixTooWideReturnTypeFunctionNativeUnion;
44

0 commit comments

Comments
 (0)