| 1 | <?php |
||
| 7 | class CurlRequest implements HttpRequestInterface |
||
| 8 | { |
||
| 9 | |||
| 10 | private $handle = null; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Set the url to cUrl call |
||
| 14 | * @param string $url |
||
| 15 | * @throws Exception |
||
| 16 | */ |
||
| 17 | public function setUrl(string $url): void |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Close cUrl handle |
||
| 24 | */ |
||
| 25 | public function close(): void |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Execute cUrl call |
||
| 32 | * @return mixed |
||
| 33 | * @throws \Exception |
||
| 34 | */ |
||
| 35 | public function execute() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get cUrl infos |
||
| 47 | * @param string $name |
||
| 48 | * @return mixed |
||
| 49 | * @throws Exception |
||
| 50 | */ |
||
| 51 | public function getInfo(string $name = '') |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Set cUrl option |
||
| 65 | * @param string $name |
||
| 66 | * @param mixed $value |
||
| 67 | * @throws \Exception |
||
| 68 | */ |
||
| 69 | public function setOption(string $name, $value): HttpRequestInterface |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Magical getter |
||
| 77 | * @param string $name |
||
| 78 | * @return mixed |
||
| 79 | */ |
||
| 80 | public function __get(string $name) |
||
| 91 | } |
||
| 92 |