src/TimeoutConnector.php
private static function handler($uri)
    {
        return function (\Exception $e) use ($uri) {
            if ($e instanceof TimeoutException) {
                throw new \RuntimeException(
                    'Connection to ' . $uri . ' timed out after ' . $e->getTimeout() . ' seconds',
                    \defined('SOCKET_ETIMEDOUT') ? \SOCKET_ETIMEDOUT : 0
                );
            }

            throw $e;
        };
    }
private static function handler($uri)
    {
        return function (\Exception $e) use ($uri) {
            if ($e instanceof TimeoutException) {
                throw new \RuntimeException(
                    'Connection to ' . $uri . ' timed out after ' . $e->getTimeout() . ' seconds',
                    \defined('SOCKET_ETIMEDOUT') ? \SOCKET_ETIMEDOUT : 0
                );
            }

            throw $e;
        };
    }
private static function handler ( $ uri ) { return function ( \ Exception $ e ) use ( $ uri ) { if ( $ e instanceof TimeoutException ) { throw new \ RuntimeException ( 'Connection to ' . $ uri . ' timed out after ' . $ e -> getTimeout ( ) . ' seconds' , \ defined ( 'SOCKET_ETIMEDOUT' ) ? \ SOCKET_ETIMEDOUT : 0 ) ; } throw $ e ; } ; }
Creates a static rejection handler that reports a proper error message in case of a timeout.

This uses a private static helper method to ensure this closure is not
bound to this instance and the exception trace does not include a
reference to this instance and its connector stack as a result.

@param string $uri
@return callable
Creates a static rejection handler that reports a proper error message in case of a timeout .