Total Complexity | 12 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait Helper{ |
||
8 | use CheckTrait; |
||
9 | |||
10 | protected function getProtocol(): string |
||
11 | { |
||
12 | if((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')){ |
||
13 | return 'ajax'; |
||
14 | } |
||
15 | |||
16 | /* ONLY FOR DEBUG CONDITION */ |
||
17 | if(!array_key_exists('REQUEST_METHOD',$_SERVER)){ |
||
18 | return 'get'; |
||
19 | } |
||
20 | |||
21 | return strtolower($_SERVER['REQUEST_METHOD']); |
||
22 | } |
||
23 | |||
24 | protected function getData(): ?array |
||
25 | { |
||
26 | return [ |
||
27 | 'POST' => $_POST, |
||
28 | 'GET' => $_GET, |
||
29 | 'FILES' => $_FILES |
||
30 | ]; |
||
31 | } |
||
32 | |||
33 | protected function import(string $path) |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 | |||
42 | protected function ControllerForm($controller, string $method, array $values){ |
||
53 | } |