ch)) { curl_close($this->ch); } } /** * @return \CurlHandle */ private function getCurlHandle() { if (empty($this->ch)) { $this->ch = curl_init(); } return $this->ch; } public function request(string $url, array $options): Request { $options['curlHandle'] = $this->getCurlHandle(); return new CurlRequest($url, $options); } }