src/RetrySubscriber.php
public static function createCurlFilter($errorCodes = null)
    {
        // Only use the cURL filter if cURL is loaded.
        if (!extension_loaded('curl')) {
            return function () { return false; };
        }

        $errorCodes = $errorCodes ?: [
            CURLE_OPERATION_TIMEOUTED,
            CURLE_COULDNT_RESOLVE_HOST,
            CURLE_COULDNT_CONNECT,
            CURLE_SSL_CONNECT_ERROR,
            CURLE_GOT_NOTHING
        ];

        $errorCodes = array_fill_keys($errorCodes, 1);

        return function ($retries, AbstractTransferEvent $e) use ($errorCodes) {
            return isset($errorCodes[(int) $e->getTransferInfo('errno')]);
        };
    }
public static function createCurlFilter($errorCodes = null)
    {
        // Only use the cURL filter if cURL is loaded.
        if (!extension_loaded('curl')) {
            return function () { return false; };
        }

        $errorCodes = $errorCodes ?: [
            CURLE_OPERATION_TIMEOUTED,
            CURLE_COULDNT_RESOLVE_HOST,
            CURLE_COULDNT_CONNECT,
            CURLE_SSL_CONNECT_ERROR,
            CURLE_GOT_NOTHING
        ];

        $errorCodes = array_fill_keys($errorCodes, 1);

        return function ($retries, AbstractTransferEvent $e) use ($errorCodes) {
            return isset($errorCodes[(int) $e->getTransferInfo('errno')]);
        };
    }
public static function createCurlFilter ( $ errorCodes = null ) { // Only use the cURL filter if cURL is loaded. if ( ! extension_loaded ( 'curl' ) ) { return function ( ) { return false ; } ; } $ errorCodes = $ errorCodes ? : [ CURLE_OPERATION_TIMEOUTED , CURLE_COULDNT_RESOLVE_HOST , CURLE_COULDNT_CONNECT , CURLE_SSL_CONNECT_ERROR , CURLE_GOT_NOTHING ] ; $ errorCodes = array_fill_keys ( $ errorCodes , 1 ) ; return function ( $ retries , AbstractTransferEvent $ e ) use ( $ errorCodes ) { return isset ( $ errorCodes [ ( int ) $ e -> getTransferInfo ( 'errno' ) ] ) ; } ; }
Creates a retry filter based on cURL error codes.

@param array $errorCodes Pass an array of curl error codes to override
the default list of error codes.
@return callable
Creates a retry filter based on cURL error codes .