Total Complexity | 10 |
Total Lines | 90 |
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) |
||
47 | } |
||
48 | |||
49 | |||
50 | /** |
||
51 | * @return null |
||
52 | */ |
||
53 | public function getHandle() |
||
54 | { |
||
55 | return $this->handle; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function execute() |
||
62 | { |
||
63 | return curl_exec($this->handle); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param $name |
||
68 | * @return mixed |
||
69 | */ |
||
70 | public function getInfo($name) |
||
71 | { |
||
72 | return curl_getinfo($this->handle, $name); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return int|mixed |
||
77 | */ |
||
78 | public function getErrorNumber() |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @return mixed|string |
||
85 | */ |
||
86 | public function getErrorMessage() |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function close() |
||
100 | } |
||
101 | } |
||
102 |
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..