| Total Complexity | 10 |
| Total Lines | 89 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Curl implements HttpRequest |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var null |
||
| 14 | */ |
||
| 15 | private $handle = null; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return $this |
||
| 19 | */ |
||
| 20 | public function init() |
||
| 21 | { |
||
| 22 | if (is_null($this->handle)) { |
||
| 23 | $this->handle = curl_init(); |
||
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | return $this; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param $url |
||
| 31 | * @return $this|Curl |
||
| 32 | */ |
||
| 33 | public function setUrl($url) |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param $name |
||
| 40 | * @param $value |
||
| 41 | * @return $this |
||
| 42 | */ |
||
| 43 | public function setOption($name, $value) |
||
| 44 | { |
||
| 45 | curl_setopt($this->handle, $name, $value); |
||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * @return null |
||
| 53 | */ |
||
| 54 | public function getHandle() |
||
| 55 | { |
||
| 56 | return $this->handle; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | public function execute() |
||
| 63 | { |
||
| 64 | return curl_exec($this->handle); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param $name |
||
| 69 | * @return mixed |
||
| 70 | */ |
||
| 71 | public function getInfo($name) |
||
| 72 | { |
||
| 73 | return curl_getinfo($this->handle, $name); |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return int|mixed |
||
| 78 | */ |
||
| 79 | public function getErrorNumber() { |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @return mixed|string |
||
| 85 | */ |
||
| 86 | public function getErrorMessage() { |
||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @return $this |
||
| 92 | */ |
||
| 93 | public function close() |
||
| 99 | } |
||
| 100 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..