Skip to content

Commit

Permalink
fix build on php 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Feb 1, 2022
1 parent 82e98da commit b833073
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,10 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6308.php');
}

if (PHP_VERSION_ID >= 70400) {
yield from $this->gatherAssertTypes(__DIR__ . '/../Rules/Comparison/data/bug-6473.php');
}
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6500.php');
yield from $this->gatherAssertTypes(__DIR__ . '/../Rules/Comparison/data/bug-6473.php');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use const PHP_VERSION_ID;

/**
* @extends RuleTestCase<BooleanNotConstantConditionRule>
Expand Down Expand Up @@ -115,6 +116,10 @@ public function testTreatPhpDocTypesAsCertainRegression(bool $treatPhpDocTypesAs

public function testBug6473(): void
{
if (PHP_VERSION_ID < 70400) {
$this->markTestSkipped('Test requires PHP 7.4.');
}

$this->treatPhpDocTypesAsCertain = true;
$this->analyse([__DIR__ . '/data/bug-6473.php'], []);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Rules/Comparison/data/bug-6473.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // lint >= 7.4

namespace Bug6473;

Expand Down

0 comments on commit b833073

Please sign in to comment.