newRetryDecider(), $delay ? $this->getRetryDelay() : $this->getZeroRetryDelay()); } /** * Returns a method that takes the number of retries and returns the number of milliseconds * to wait * * @return callable */ private function getRetryDelay() { return function ($numberOfRetries) { return static::DELAY_INCREASE_MS * $numberOfRetries; }; } /** * Returns a method that returns zero milliseconds to wait * * @return callable */ private function getZeroRetryDelay() { return function ($numberOfRetries) { return 0; }; } /** * @return callable */ private function newRetryDecider() { return function ($retries, \_PhpScoper506056c89102\GuzzleHttp\Psr7\Request $request, ?\_PhpScoper506056c89102\GuzzleHttp\Psr7\Response $response = null, ?\_PhpScoper506056c89102\GuzzleHttp\Exception\TransferException $exception = null) { if ($retries >= static::MAX_RETRIES) { return \false; } if ($exception instanceof \_PhpScoper506056c89102\GuzzleHttp\Exception\ConnectException) { return \true; } return \false; }; } }