Skip to content

Commit 675cc7c

Browse files
Fix
1 parent 2fd09a0 commit 675cc7c

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

tests/PHPStan/Levels/data/acceptTypes-5.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
"ignorable": true
186186
},
187187
{
188-
"message": "Parameter #2 $array of function implode expects array|null, int given.",
188+
"message": "Parameter #2 $array of function implode expects array, int given.",
189189
"line": 763,
190190
"ignorable": true
191191
}

tests/PHPStan/Levels/data/acceptTypes-7.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"ignorable": true
166166
},
167167
{
168-
"message": "Parameter #2 $array of function implode expects array|null, array|int|string given.",
168+
"message": "Parameter #2 $array of function implode expects array, array|int|string given.",
169169
"line": 756,
170170
"ignorable": true
171171
}

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,39 +2249,47 @@ public function testBug3506(): void
22492249

22502250
public function testBug5760(): void
22512251
{
2252+
if (PHP_VERSION_ID < 80000) {
2253+
$param1Name = '$glue';
2254+
$param2Name = '$pieces';
2255+
} else {
2256+
$param1Name = '$separator';
2257+
$param2Name = '$array';
2258+
}
2259+
22522260
$this->checkExplicitMixed = true;
22532261
$this->checkImplicitMixed = true;
22542262
$this->analyse([__DIR__ . '/data/bug-5760.php'], [
22552263
[
2256-
'Parameter #2 $pieces of function join expects array, list<int>|null given.',
2264+
sprintf('Parameter #2 %s of function join expects array, list<int>|null given.', $param2Name),
22572265
10,
22582266
],
22592267
[
2260-
'Parameter #1 $glue of function join expects array, list<int>|null given.',
2268+
sprintf('Parameter #1 %s of function join expects array, list<int>|null given.', $param1Name),
22612269
11,
22622270
],
22632271
[
2264-
'Parameter #2 $array of function implode expects array, list<int>|null given.',
2272+
sprintf('Parameter #2 %s of function implode expects array, list<int>|null given.', $param2Name),
22652273
13,
22662274
],
22672275
[
2268-
'Parameter #1 $separator of function implode expects array, list<int>|null given.',
2276+
sprintf('Parameter #1 %s of function implode expects array, list<int>|null given.', $param1Name),
22692277
14,
22702278
],
22712279
[
2272-
'Parameter #2 $pieces of function join expects array, array<string>|string given.',
2280+
sprintf('Parameter #2 %s of function join expects array, array<string>|string given.', $param2Name),
22732281
22,
22742282
],
22752283
[
2276-
'Parameter #1 $glue of function join expects array, array<string>|string given.',
2284+
sprintf('Parameter #1 %s of function join expects array, array<string>|string given.', $param1Name),
22772285
23,
22782286
],
22792287
[
2280-
'Parameter #2 $array of function implode expects array, array<string>|string given.',
2288+
sprintf('Parameter #2 %s of function implode expects array, array<string>|string given.', $param2Name),
22812289
25,
22822290
],
22832291
[
2284-
'Parameter #1 $separator of function implode expects array, array<string>|string given.',
2292+
sprintf('Parameter #1 %s of function implode expects array, array<string>|string given.', $param1Name),
22852293
26,
22862294
],
22872295
]);

0 commit comments

Comments
 (0)