diff --git a/src/Http/CurlDispatcher.php b/src/Http/CurlDispatcher.php index 5b1f60c6..ac989973 100644 --- a/src/Http/CurlDispatcher.php +++ b/src/Http/CurlDispatcher.php @@ -34,7 +34,8 @@ public static function fetch(array $settings, ResponseFactoryInterface $response { if (count($requests) === 1) { $connection = new static($settings, $requests[0]); - return [$connection->exec($responseFactory)]; + curl_exec($connection->curl); + return [$connection->getResponse($responseFactory)]; } //Init connections @@ -77,7 +78,7 @@ public static function fetch(array $settings, ResponseFactoryInterface $response curl_multi_close($multi); return array_map( - fn ($connection) => $connection->exec($responseFactory), + fn ($connection) => $connection->getResponse($responseFactory), $connections ); } @@ -113,10 +114,8 @@ private function __construct(array $settings, RequestInterface $request, StreamF ]); } - private function exec(ResponseFactoryInterface $responseFactory): ResponseInterface + private function getResponse(ResponseFactoryInterface $responseFactory): ResponseInterface { - curl_exec($this->curl); - $info = curl_getinfo($this->curl); if ($this->error) {