Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
35 | 2 | public function applyMethod(String $method) |
|
36 | { |
||
37 | 2 | switch ($method) { |
|
38 | 2 | case "GET": |
|
39 | 1 | $this->setMethod("GET"); |
|
40 | 1 | return "GET"; |
|
41 | 2 | case "POST": |
|
42 | 1 | curl_setopt($this->curl, CURLOPT_POST, true); |
|
|
|||
43 | 1 | $this->setMethod("POST"); |
|
44 | 1 | return "POST"; |
|
45 | 2 | case "PUT": |
|
46 | 2 | curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
47 | 2 | $this->setMethod("PUT"); |
|
48 | 2 | return "PUT"; |
|
49 | 2 | case "DELETE": |
|
50 | 2 | curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
51 | 2 | $this->setMethod("DELETE"); |
|
52 | 2 | return "DELETE"; |
|
53 | default: |
||
54 | 2 | return false; |
|
55 | } |
||
79 |