Skip to content

Commit 64803ee

Browse files
committed
Add test
1 parent 3428bff commit 64803ee

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,40 +1321,48 @@ public function testCurlSetOpt(): void
13211321
18,
13221322
],
13231323
[
1324-
'Parameter #3 $value of function curl_setopt expects bool, int given.',
1324+
'Parameter #3 $value of function curl_setopt expects string, int given.',
1325+
19,
1326+
],
1327+
[
1328+
'Parameter #3 $value of function curl_setopt expects string, int given.',
13251329
20,
13261330
],
1331+
[
1332+
'Parameter #3 $value of function curl_setopt expects bool, int given.',
1333+
22,
1334+
],
13271335
[
13281336
'Parameter #3 $value of function curl_setopt expects bool, string given.',
1329-
21,
1337+
23,
13301338
],
13311339
[
13321340
'Parameter #3 $value of function curl_setopt expects int, string given.',
1333-
23,
1341+
25,
13341342
],
13351343
[
13361344
'Parameter #3 $value of function curl_setopt expects array, string given.',
1337-
25,
1345+
27,
13381346
],
13391347
[
13401348
'Parameter #3 $value of function curl_setopt expects resource, string given.',
1341-
27,
1349+
29,
13421350
],
13431351
[
13441352
'Parameter #3 $value of function curl_setopt expects array|string, int given.',
1345-
29,
1353+
31,
13461354
],
13471355
[
13481356
'Parameter #3 $value of function curl_setopt expects non-empty-string, \'\' given.',
1349-
31,
1357+
33,
13501358
],
13511359
[
13521360
'Parameter #3 $value of function curl_setopt expects non-empty-string|null, \'\' given.',
1353-
32,
1361+
34,
13541362
],
13551363
[
13561364
'Parameter #3 $value of function curl_setopt expects array<int, string>, array<string, string> given.',
1357-
75,
1365+
77,
13581366
],
13591367
]);
13601368
}

tests/PHPStan/Rules/Functions/data/curl_setopt.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public function errors(int $i, string $s) {
1616
curl_setopt($curl, CURLOPT_URL, $i);
1717
curl_setopt($curl, CURLOPT_HTTPHEADER, $i);
1818
curl_setopt($curl, CURLOPT_ABSTRACT_UNIX_SOCKET, null);
19+
curl_setopt($curl, CURLOPT_ENCODING, $i);
20+
curl_setopt($curl, CURLOPT_ACCEPT_ENCODING, $i);
1921
// expecting bool
2022
curl_setopt($curl, CURLOPT_AUTOREFERER, $i);
2123
curl_setopt($curl, CURLOPT_RETURNTRANSFER, $s);

0 commit comments

Comments
 (0)