Skip to content

Commit 2217bcb

Browse files
committed
Use current PHP version in CallToFunctionParametersRuleTest
1 parent c586014 commit 2217bcb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ class CallToFunctionParametersRuleTest extends RuleTestCase
2323

2424
private bool $checkImplicitMixed = false;
2525

26+
private int $phpVersion = PHP_VERSION_ID;
27+
2628
protected function getRule(): Rule
2729
{
2830
$broker = $this->createReflectionProvider();
2931
return new CallToFunctionParametersRule(
3032
$broker,
31-
new FunctionCallParametersCheck(new RuleLevelHelper($broker, true, false, true, $this->checkExplicitMixed, $this->checkImplicitMixed, true, false), new NullsafeCheck(), new PhpVersion(80000), new UnresolvableTypeHelper(), new PropertyReflectionFinder(), true, true, true, true, true),
33+
new FunctionCallParametersCheck(new RuleLevelHelper($broker, true, false, true, $this->checkExplicitMixed, $this->checkImplicitMixed, true, false), new NullsafeCheck(), new PhpVersion($this->phpVersion), new UnresolvableTypeHelper(), new PropertyReflectionFinder(), true, true, true, true, true),
3234
);
3335
}
3436

@@ -481,6 +483,10 @@ public function testGenericFunction(): void
481483

482484
public function testNamedArguments(): void
483485
{
486+
if (PHP_VERSION_ID < 80000) {
487+
$this->markTestSkipped('Test requires PHP 8.0');
488+
}
489+
484490
$errors = [
485491
[
486492
'Missing parameter $j (int) in call to function FunctionNamedArguments\foo.',
@@ -495,12 +501,6 @@ public function testNamedArguments(): void
495501
14,
496502
],
497503
];
498-
if (PHP_VERSION_ID < 80000) {
499-
$errors[] = [
500-
'Missing parameter $arr1 (array) in call to function array_merge.',
501-
14,
502-
];
503-
}
504504

505505
require_once __DIR__ . '/data/named-arguments-define.php';
506506
$this->analyse([__DIR__ . '/data/named-arguments.php'], $errors);

0 commit comments

Comments
 (0)