1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

Return getCurlErrorMessage() method as it can be used outside

This commit is contained in:
Alies Lapatsin 2023-01-15 00:43:13 +01:00
parent 8e5715875a
commit 291484df44

View File

@ -127,10 +127,32 @@ final class Shepherd implements AfterAnalysisInterface
}
}
/**
* @param mixed $ch
* @psalm-pure
* @deprecated Will be removed in Psalm 6
*/
public static function getCurlErrorMessage($ch): string
{
/**
* @psalm-suppress MixedArgument
* @var array
*/
$curl_info = curl_getinfo($ch);
/** @psalm-suppress MixedAssignment */
$ssl_verify_result = $curl_info['ssl_verify_result'] ?? null;
if (is_int($ssl_verify_result) && $ssl_verify_result > 1) {
return self::getCurlSslErrorMessage($ssl_verify_result);
}
return '';
}
/**
* @psalm-pure
*/
public static function getCurlSslErrorMessage(int $ssl_verify_result): string
private static function getCurlSslErrorMessage(int $ssl_verify_result): string
{
switch ($ssl_verify_result) {
case 1: