Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 2 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php namespace Comodojo\Dispatcher\Request; |
||
37 | 5 | private static function getParameters() { |
|
|
|||
38 | |||
39 | 5 | return isset($_GET) ? $_GET : []; |
|
40 | |||
41 | // switch( $_SERVER['REQUEST_METHOD'] ) { |
||
42 | // |
||
43 | // case 'GET': |
||
44 | // |
||
45 | // $parameters = $_GET; |
||
46 | // |
||
47 | // break; |
||
48 | // |
||
49 | // default: |
||
50 | // |
||
51 | // $parameters = []; |
||
52 | // |
||
53 | // break; |
||
54 | // |
||
55 | // } |
||
56 | |||
57 | // return $parameters; |
||
58 | |||
59 | } |
||
60 | |||
62 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: