protected function deriveTimeoutFromHeader($headerValue)
    {
        // The timeout will either be a number or a HTTP-formatted date,
        // or seconds (integer)
        if ((string) (int) trim($headerValue) === $headerValue) {
            return (int) trim($headerValue);
        } elseif ($date = \DateTime::createFromFormat(self::DATE_FORMAT, trim($headerValue))) {
            return (int) $date->format('U') - time();
        }

        return null;
    }
protected function deriveTimeoutFromHeader($headerValue)
    {
        // The timeout will either be a number or a HTTP-formatted date,
        // or seconds (integer)
        if ((string) (int) trim($headerValue) === $headerValue) {
            return (int) trim($headerValue);
        } elseif ($date = \DateTime::createFromFormat(self::DATE_FORMAT, trim($headerValue))) {
            return (int) $date->format('U') - time();
        }

        return null;
    }
protected function deriveTimeoutFromHeader ( $ headerValue ) { // The timeout will either be a number or a HTTP-formatted date, // or seconds (integer) if ( ( string ) ( int ) trim ( $ headerValue ) === $ headerValue ) { return ( int ) trim ( $ headerValue ) ; } elseif ( $ date = \ DateTime :: createFromFormat ( self :: DATE_FORMAT , trim ( $ headerValue ) ) ) { return ( int ) $ date -> format ( 'U' ) - time ( ) ; } return null ; }
Attempt to derive the timeout from the HTTP `Retry-After` header

The spec allows the header value to either be a number of seconds or a datetime.

@param string $headerValue
@return float|null  The number of seconds to wait, or NULL if unsuccessful (invalid header)
Attempt to derive the timeout from the HTTP Retry - After header