Skip to content

Commit 4112301

Browse files
committed
fix PHP 7.4
1 parent 634372a commit 4112301

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ public function testBug3107(): void
19841984

19851985
public function testBug12676(): void
19861986
{
1987-
$this->analyse([__DIR__ . '/data/bug-12676.php'], [
1987+
$errors = [
19881988
[
19891989
'Parameter #1 $array is passed by reference so it does not accept @readonly property Bug12676\A::$a.',
19901990
15,
@@ -1997,7 +1997,26 @@ public function testBug12676(): void
19971997
'Parameter #1 $array is passed by reference so it does not accept static @readonly property Bug12676\C::$readonlyArr.',
19981998
35,
19991999
],
2000-
]);
2000+
];
2001+
2002+
if (PHP_VERSION_ID < 80000) {
2003+
$errors = [
2004+
[
2005+
'Parameter #1 $array_arg is passed by reference so it does not accept @readonly property Bug12676\A::$a.',
2006+
15,
2007+
],
2008+
[
2009+
'Parameter #1 $array_arg is passed by reference so it does not accept @readonly property Bug12676\B::$readonlyArr.',
2010+
25,
2011+
],
2012+
[
2013+
'Parameter #1 $array_arg is passed by reference so it does not accept static @readonly property Bug12676\C::$readonlyArr.',
2014+
35,
2015+
],
2016+
];
2017+
}
2018+
2019+
$this->analyse([__DIR__ . '/data/bug-12676.php'], $errors);
20012020
}
20022021

20032022
}

0 commit comments

Comments
 (0)