Skip to content

Commit 731ac4c

Browse files
committed
Remove obsolete skips
1 parent df300b9 commit 731ac4c

6 files changed

+21
-46
lines changed

tests/Rules/DeadCode/UnusedPrivatePropertyRuleTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ public static function getAdditionalConfigFiles(): array
2727

2828
public function testRule(): void
2929
{
30-
if (PHP_VERSION_ID < 70400) {
31-
self::markTestSkipped('Test requires PHP 7.4.');
32-
}
33-
3430
$this->analyse([__DIR__ . '/data/unused-private-property.php'], [
3531
[
3632
'Property PHPStan\Rules\Doctrine\ORM\UnusedPrivateProperty\EntityWithAGeneratedId::$unused is never written, only read.',

tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleSlowTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
8-
use const PHP_VERSION_ID;
98

109
/**
1110
* @extends RuleTestCase<QueryBuilderDqlRule>
@@ -23,9 +22,6 @@ protected function getRule(): Rule
2322

2423
public function testRule(): void
2524
{
26-
if (PHP_VERSION_ID < 70300) {
27-
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
28-
}
2925
$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
3026
[
3127
"QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)",

tests/Rules/Doctrine/ORM/QueryBuilderDqlRuleTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
77
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
8-
use const PHP_VERSION_ID;
98

109
/**
1110
* @extends RuleTestCase<QueryBuilderDqlRule>
@@ -23,10 +22,6 @@ protected function getRule(): Rule
2322

2423
public function testRule(): void
2524
{
26-
if (PHP_VERSION_ID < 70300) {
27-
self::markTestSkipped('For some reason PHP 7.2 cannot recover from Trying to get property value of non-object');
28-
}
29-
3025
$this->analyse([__DIR__ . '/data/query-builder-dql.php'], [
3126
[
3227
"QueryBuilder: [Syntax Error] line 0, col 66: Error: Expected end of string, got ')'\nDQL: SELECT e FROM PHPStan\Rules\Doctrine\ORM\MyEntity e WHERE e.id = 1)",

tests/Rules/Properties/MissingGedmoByPhpDocPropertyAssignRuleTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use PHPStan\Rules\Rule;
88
use PHPStan\Testing\RuleTestCase;
99
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
10-
use const PHP_VERSION_ID;
1110

1211
/**
1312
* @extends RuleTestCase<UnusedPrivatePropertyRule>
@@ -34,10 +33,6 @@ public static function getAdditionalConfigFiles(): array
3433

3534
public function testRule(): void
3635
{
37-
if (PHP_VERSION_ID < 70400) {
38-
self::markTestSkipped('Test requires PHP 7.4.');
39-
}
40-
4136
$this->analyse([__DIR__ . '/data/gedmo-property-assign-phpdoc.php'], [
4237
// No errors expected
4338
]);

tests/Rules/Properties/MissingReadOnlyByPhpDocPropertyAssignRuleTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7-
use const PHP_VERSION_ID;
87

98
/**
109
* @extends RuleTestCase<MissingReadOnlyByPhpDocPropertyAssignRule>
@@ -24,10 +23,6 @@ public static function getAdditionalConfigFiles(): array
2423

2524
public function testRule(): void
2625
{
27-
if (PHP_VERSION_ID < 70400) {
28-
self::markTestSkipped('Test requires PHP 7.4.');
29-
}
30-
3126
$this->analyse([__DIR__ . '/data/missing-readonly-property-assign-phpdoc.php'], [
3227
[
3328
'Class MissingReadOnlyPropertyAssignPhpDoc\EntityWithAGeneratedId has an uninitialized @readonly property $unassigned. Assign it in the constructor.',

tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php

+21-23
Original file line numberDiff line numberDiff line change
@@ -1533,35 +1533,33 @@ private function yieldConditionalDataset(): iterable
15331533
];
15341534
}
15351535

1536-
if (PHP_VERSION_ID >= 70400) {
1537-
yield 'locate function' => [
1538-
$this->constantArray([
1539-
[new ConstantIntegerType(1), $this->uintOrStringified()],
1540-
[new ConstantIntegerType(2), TypeCombinator::addNull($this->uintOrStringified())],
1541-
[new ConstantIntegerType(3), TypeCombinator::addNull($this->uintOrStringified())],
1542-
[new ConstantIntegerType(4), $this->uintOrStringified()],
1543-
]),
1544-
'
1536+
yield 'locate function' => [
1537+
$this->constantArray([
1538+
[new ConstantIntegerType(1), $this->uintOrStringified()],
1539+
[new ConstantIntegerType(2), TypeCombinator::addNull($this->uintOrStringified())],
1540+
[new ConstantIntegerType(3), TypeCombinator::addNull($this->uintOrStringified())],
1541+
[new ConstantIntegerType(4), $this->uintOrStringified()],
1542+
]),
1543+
'
15451544
SELECT LOCATE(m.stringColumn, m.stringColumn, 0),
15461545
LOCATE(m.stringNullColumn, m.stringColumn, 0),
15471546
LOCATE(m.stringColumn, m.stringNullColumn, 0),
15481547
LOCATE(\'f\', \'foo\', 0)
15491548
FROM QueryResult\Entities\Many m
15501549
',
1551-
null,
1552-
InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=3.4')
1553-
? null
1554-
: (
1555-
PHP_VERSION_ID >= 80100
1556-
? 'strpos(): Passing null to parameter #2 ($needle) of type string is deprecated'
1557-
: (
1558-
PHP_VERSION_ID < 80000
1559-
? 'strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior'
1560-
: null
1561-
)
1562-
),
1563-
];
1564-
}
1550+
null,
1551+
InstalledVersions::satisfies(new VersionParser(), 'doctrine/dbal', '>=3.4')
1552+
? null
1553+
: (
1554+
PHP_VERSION_ID >= 80100
1555+
? 'strpos(): Passing null to parameter #2 ($needle) of type string is deprecated'
1556+
: (
1557+
PHP_VERSION_ID < 80000
1558+
? 'strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior'
1559+
: null
1560+
)
1561+
),
1562+
];
15651563

15661564
$ormVersion = InstalledVersions::getVersion('doctrine/orm');
15671565
$hasOrm3 = $ormVersion !== null && strpos($ormVersion, '3.') === 0;

0 commit comments

Comments
 (0)