Skip to content

Commit 48502f5

Browse files
Fix
1 parent d49c5f9 commit 48502f5

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
@@ -2224,39 +2224,47 @@ public function testBug3506(): void
22242224

22252225
public function testBug5760(): void
22262226
{
2227+
if (PHP_VERSION_ID < 80000) {
2228+
$param1Name = '$glue';
2229+
$param2Name = '$pieces';
2230+
} else {
2231+
$param1Name = '$separator';
2232+
$param2Name = '$array';
2233+
}
2234+
22272235
$this->checkExplicitMixed = true;
22282236
$this->checkImplicitMixed = true;
22292237
$this->analyse([__DIR__ . '/data/bug-5760.php'], [
22302238
[
2231-
'Parameter #2 $pieces of function join expects array, list<int>|null given.',
2239+
sprintf('Parameter #2 %s of function join expects array, list<int>|null given.', $param2Name),
22322240
10,
22332241
],
22342242
[
2235-
'Parameter #1 $glue of function join expects array, list<int>|null given.',
2243+
sprintf('Parameter #1 %s of function join expects array, list<int>|null given.', $param1Name),
22362244
11,
22372245
],
22382246
[
2239-
'Parameter #2 $array of function implode expects array, list<int>|null given.',
2247+
sprintf('Parameter #2 %s of function implode expects array, list<int>|null given.', $param2Name),
22402248
13,
22412249
],
22422250
[
2243-
'Parameter #1 $separator of function implode expects array, list<int>|null given.',
2251+
sprintf('Parameter #1 %s of function implode expects array, list<int>|null given.', $param1Name),
22442252
14,
22452253
],
22462254
[
2247-
'Parameter #2 $pieces of function join expects array, array<string>|string given.',
2255+
sprintf('Parameter #2 %s of function join expects array, array<string>|string given.', $param2Name),
22482256
22,
22492257
],
22502258
[
2251-
'Parameter #1 $glue of function join expects array, array<string>|string given.',
2259+
sprintf('Parameter #1 %s of function join expects array, array<string>|string given.', $param1Name),
22522260
23,
22532261
],
22542262
[
2255-
'Parameter #2 $array of function implode expects array, array<string>|string given.',
2263+
sprintf('Parameter #2 %s of function implode expects array, array<string>|string given.', $param2Name),
22562264
25,
22572265
],
22582266
[
2259-
'Parameter #1 $separator of function implode expects array, array<string>|string given.',
2267+
sprintf('Parameter #1 %s of function implode expects array, array<string>|string given.', $param1Name),
22602268
26,
22612269
],
22622270
]);

0 commit comments

Comments
 (0)