Total Complexity | 7 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class Sql extends Request |
||
13 | { |
||
14 | /** |
||
15 | * @return mixed|string |
||
16 | */ |
||
17 | protected $mode; |
||
18 | public function getPath() |
||
19 | { |
||
20 | return '/sql'; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return mixed|string |
||
25 | */ |
||
26 | public function getMethod() |
||
27 | { |
||
28 | return 'POST'; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return mixed|string |
||
33 | */ |
||
34 | public function getBody() |
||
35 | { |
||
36 | if ($this->mode === 'raw') { |
||
37 | $return = ['mode=raw']; |
||
38 | foreach ($this->body as $k => $v) { |
||
39 | $return[]= $k.'='.urlencode($v); |
||
40 | } |
||
41 | return implode('&', $return); |
||
42 | } else { |
||
43 | return http_build_query($this->body); |
||
|
|||
44 | } |
||
45 | } |
||
46 | |||
47 | public function getMode() |
||
48 | { |
||
49 | return $this->mode; |
||
50 | } |
||
51 | |||
52 | public function setMode($mode) |
||
55 | } |
||
56 | } |
||
57 |