Skip to content

Commit b833073

Browse files
authored
fix build on php 7.4
1 parent 82e98da commit b833073

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,10 @@ public function dataFileAsserts(): iterable
683683
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6308.php');
684684
}
685685

686+
if (PHP_VERSION_ID >= 70400) {
687+
yield from $this->gatherAssertTypes(__DIR__ . '/../Rules/Comparison/data/bug-6473.php');
688+
}
686689
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6500.php');
687-
yield from $this->gatherAssertTypes(__DIR__ . '/../Rules/Comparison/data/bug-6473.php');
688690
}
689691

690692
/**

tests/PHPStan/Rules/Comparison/BooleanNotConstantConditionRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PHPStan\Rules\Rule;
66
use PHPStan\Testing\RuleTestCase;
7+
use const PHP_VERSION_ID;
78

89
/**
910
* @extends RuleTestCase<BooleanNotConstantConditionRule>
@@ -115,6 +116,10 @@ public function testTreatPhpDocTypesAsCertainRegression(bool $treatPhpDocTypesAs
115116

116117
public function testBug6473(): void
117118
{
119+
if (PHP_VERSION_ID < 70400) {
120+
$this->markTestSkipped('Test requires PHP 7.4.');
121+
}
122+
118123
$this->treatPhpDocTypesAsCertain = true;
119124
$this->analyse([__DIR__ . '/data/bug-6473.php'], []);
120125
}

tests/PHPStan/Rules/Comparison/data/bug-6473.php

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

33
namespace Bug6473;
44

0 commit comments

Comments
 (0)