Skip to content

Commit 287d53f

Browse files
committed
Fix build
1 parent bcd9b68 commit 287d53f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php

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

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

89
class OperandsInArithmeticAdditionRuleTest extends \PHPStan\Testing\RuleTestCase
910
{
@@ -19,7 +20,7 @@ protected function getRule(): Rule
1920

2021
public function testRule(): void
2122
{
22-
$this->analyse([__DIR__ . '/data/operators.php'], [
23+
$messages = [
2324
[
2425
'Only numeric types are allowed in +, string given on the right side.',
2526
25,
@@ -36,11 +37,14 @@ public function testRule(): void
3637
'Only numeric types are allowed in +, string given on the right side.',
3738
29,
3839
],
39-
[
40+
];
41+
if (PHP_VERSION_ID < 80000) {
42+
$messages[] = [
4043
'Only numeric types are allowed in +, (array<int, string>|false) given on the left side.',
4144
110,
42-
],
43-
]);
45+
];
46+
}
47+
$this->analyse([__DIR__ . '/data/operators.php'], $messages);
4448
}
4549

4650
}

0 commit comments

Comments
 (0)