src/RetrySubscriber.php
public static function createStatusFilter(
        array $failureStatuses = [500, 503]
    ) {
        // Convert the array of values into a set for hash lookups
        $failureStatuses = array_fill_keys($failureStatuses, true);

        return function (
            $retries,
            AbstractTransferEvent $event
        ) use ($failureStatuses) {
            if (!($response = $event->getResponse())) {
                return false;
            }
            return isset($failureStatuses[$response->getStatusCode()]);
        };
    }
public static function createStatusFilter(
        array $failureStatuses = [500, 503]
    ) {
        // Convert the array of values into a set for hash lookups
        $failureStatuses = array_fill_keys($failureStatuses, true);

        return function (
            $retries,
            AbstractTransferEvent $event
        ) use ($failureStatuses) {
            if (!($response = $event->getResponse())) {
                return false;
            }
            return isset($failureStatuses[$response->getStatusCode()]);
        };
    }
public static function createStatusFilter ( array $ failureStatuses = [ 500 , 503 ] ) { // Convert the array of values into a set for hash lookups $ failureStatuses = array_fill_keys ( $ failureStatuses , true ) ; return function ( $ retries , AbstractTransferEvent $ event ) use ( $ failureStatuses ) { if ( ! ( $ response = $ event -> getResponse ( ) ) ) { return false ; } return isset ( $ failureStatuses [ $ response -> getStatusCode ( ) ] ) ; } ; }
Creates a retry filter based on HTTP status codes

@param array $failureStatuses Pass an array of status codes to override
the default of [500, 503].
@return callable
Creates a retry filter based on HTTP status codes