Total Complexity | 13 |
Total Lines | 69 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | class Fetch implements ContainerInjectableInterface |
||
9 | { |
||
10 | use ContainerInjectableTrait; |
||
11 | |||
12 | private $curl; |
||
13 | private $url; |
||
14 | private $method; |
||
15 | private $data; |
||
16 | |||
17 | 6 | public function __construct(String $method, String $url, Array $data = []) |
|
18 | { |
||
19 | 6 | $this->curl = curl_init(); |
|
20 | 6 | $this->method = $method; |
|
21 | 6 | $this->url = $url; |
|
22 | 6 | $this->data = $data; |
|
23 | 6 | } |
|
24 | |||
25 | 3 | public function setMethod(String $method = "GET") |
|
26 | { |
||
27 | 3 | $this->method = $method; |
|
28 | 3 | } |
|
29 | |||
30 | 3 | public function getMethod() : String |
|
31 | { |
||
32 | 3 | return $this->method; |
|
33 | } |
||
34 | |||
35 | 2 | public function applyMethod(String $method) |
|
55 | } |
||
56 | } |
||
57 | |||
58 | 1 | public function applyParams(Array $data = []) |
|
67 | } |
||
68 | 1 | } |
|
69 | |||
70 | 3 | public function fetch() |
|
77 | } |
||
78 | } |
||
79 |