StackFormation\Profile\Manager::getHttpHandler PHP Method

getHttpHandler() private method

private getHttpHandler ( ) : Aws\Handler\GuzzleV6\GuzzleHandler
return Aws\Handler\GuzzleV6\GuzzleHandler
    private function getHttpHandler()
    {
        $guzzleStack = \GuzzleHttp\HandlerStack::create();
        $guzzleStack->push(\GuzzleHttp\Middleware::retry(function ($retries, \GuzzleHttp\Psr7\Request $request, \GuzzleHttp\Psr7\Response $response = null, \GuzzleHttp\Exception\RequestException $exception = null) {
            if ($retries >= 5) {
                return false;
            }
            if ($exception instanceof \GuzzleHttp\Exception\ConnectException) {
                return true;
            }
            if ($response) {
                if ($response->getStatusCode() == 400) {
                    return true;
                }
            }
            return false;
        }));
        if ($this->output && $this->output->isVeryVerbose()) {
            $guzzleStack->push(\GuzzleHttp\Middleware::log(new \Monolog\Logger('main'), new \GuzzleHttp\MessageFormatter('[{code}] {req_body}')));
        }
        return new \Aws\Handler\GuzzleV6\GuzzleHandler(new \GuzzleHttp\Client(['handler' => $guzzleStack]));
    }