url = $url;} public function setHeaders(?array $headers): void{$this->headers = $headers;} public function setRequest(?string $request): void{$this->request = $request;} public function setBody(?array $body): void{$this->body = $body;} public function setIsReturnable(?bool $isReturnable): void{$this->isReturnable = $isReturnable;} private function areMainParametersNotSet(): bool{ return $this->url == NULL || $this->request == NULL || $this->headers == NULL; } /** * @throws InvalidCurlStructureException */ public function getCurlRequestObject(): CurlRequest{ if($this->areMainParametersNotSet()){ throw new InvalidCurlStructureException("Invalid structure for making a request"); } return new CurlRequest($this->url, $this->request, $this->headers, $this->body, $this->isReturnable); } }