From 287d53f446acca2644622d178edbbb9b00058624 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Fri, 9 Oct 2020 20:01:50 +0200 Subject: [PATCH] Fix build --- .../OperandsInArithmeticAdditionRuleTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php b/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php index 0c71907e..6bb643a0 100644 --- a/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php +++ b/tests/Rules/Operators/OperandsInArithmeticAdditionRuleTest.php @@ -4,6 +4,7 @@ use PHPStan\Rules\Rule; use PHPStan\Rules\RuleLevelHelper; +use const PHP_VERSION_ID; class OperandsInArithmeticAdditionRuleTest extends \PHPStan\Testing\RuleTestCase { @@ -19,7 +20,7 @@ protected function getRule(): Rule public function testRule(): void { - $this->analyse([__DIR__ . '/data/operators.php'], [ + $messages = [ [ 'Only numeric types are allowed in +, string given on the right side.', 25, @@ -36,11 +37,14 @@ public function testRule(): void 'Only numeric types are allowed in +, string given on the right side.', 29, ], - [ + ]; + if (PHP_VERSION_ID < 80000) { + $messages[] = [ 'Only numeric types are allowed in +, (array|false) given on the left side.', 110, - ], - ]); + ]; + } + $this->analyse([__DIR__ . '/data/operators.php'], $messages); } }