Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Reflection/ParametersAcceptorSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,6 @@ private static function getCurlOptValueType(int $curlOpt): ?Type
}

$nullableStringConstants = [
'CURLOPT_ACCEPT_ENCODING',
'CURLOPT_CUSTOMREQUEST',
'CURLOPT_DNS_INTERFACE',
'CURLOPT_DNS_LOCAL_IP4',
Expand Down Expand Up @@ -1032,7 +1031,7 @@ private static function getCurlOptValueType(int $curlOpt): ?Type

$stringConstants = [
'CURLOPT_COOKIEFILE',
'CURLOPT_ENCODING',
'CURLOPT_ENCODING', // Alias: CURLOPT_ACCEPT_ENCODING
'CURLOPT_PRE_PROXY',
'CURLOPT_PRIVATE',
'CURLOPT_PROXY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ public function testCurlSetOpt(): void
],
[
'Parameter #3 $value of function curl_setopt expects array<int, string>, array<string, string> given.',
73,
75,
],
]);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/PHPStan/Rules/Functions/data/curl_setopt.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public function allGood(string $url, array $header) {
curl_setopt($curl, CURLOPT_PRE_PROXY, '');
curl_setopt($curl, CURLOPT_PROXY, '');
curl_setopt($curl, CURLOPT_PRIVATE, '');
curl_setopt($curl, CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_ACCEPT_ENCODING, '');
}

public function bug9263() {
Expand Down
Loading