Skip to content

Commit 3428bff

Browse files
committed
Remove incorrect CURLOPT_ACCEPT_ENCODING alias
Fixes phpstan/phpstan#12171
1 parent f8d27d5 commit 3428bff

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Reflection/ParametersAcceptorSelector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,6 @@ private static function getCurlOptValueType(int $curlOpt): ?Type
919919
}
920920

921921
$nullableStringConstants = [
922-
'CURLOPT_ACCEPT_ENCODING',
923922
'CURLOPT_CUSTOMREQUEST',
924923
'CURLOPT_DNS_INTERFACE',
925924
'CURLOPT_DNS_LOCAL_IP4',
@@ -1032,7 +1031,7 @@ private static function getCurlOptValueType(int $curlOpt): ?Type
10321031

10331032
$stringConstants = [
10341033
'CURLOPT_COOKIEFILE',
1035-
'CURLOPT_ENCODING',
1034+
'CURLOPT_ENCODING', // Alias: CURLOPT_ACCEPT_ENCODING
10361035
'CURLOPT_PRE_PROXY',
10371036
'CURLOPT_PRIVATE',
10381037
'CURLOPT_PROXY',

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ public function testCurlSetOpt(): void
13541354
],
13551355
[
13561356
'Parameter #3 $value of function curl_setopt expects array<int, string>, array<string, string> given.',
1357-
73,
1357+
75,
13581358
],
13591359
]);
13601360
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public function allGood(string $url, array $header) {
6262
curl_setopt($curl, CURLOPT_PRE_PROXY, '');
6363
curl_setopt($curl, CURLOPT_PROXY, '');
6464
curl_setopt($curl, CURLOPT_PRIVATE, '');
65+
curl_setopt($curl, CURLOPT_ENCODING, '');
66+
curl_setopt($curl, CURLOPT_ACCEPT_ENCODING, '');
6567
}
6668

6769
public function bug9263() {

0 commit comments

Comments
 (0)