clientCreator = $clientCreator; $this->requestSender = $requestSender; $this->responseHandler = $responseHandler; } /** * Creates HTTP client for API call. * * @param string $url * @param string $method * @param array $params * @param int|null $storeId * @return array */ public function doRequest($url, $method, array $params = [], $storeId = null): array { $client = $this->clientCreator->create($url, $method, $params, $storeId); $response = $this->requestSender->send($client, $storeId); $result = $this->responseHandler->handle($response); return $result; } }