| Conditions | 4 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 80 | 2 | public function getRequestUri($withQuerySting = false) |
|
|
|
|||
| 81 | { |
||
| 82 | 2 | $return = $this->get('route'); |
|
| 83 | 2 | if (isset($_SERVER['argc']) && $_SERVER['argc'] > 2 && $withQuerySting) { |
|
| 84 | 1 | $args = $_SERVER['argv']; |
|
| 85 | 1 | unset($args[0]); |
|
| 86 | 1 | $return = implode(' ', $args); |
|
| 87 | } |
||
| 88 | 2 | return $return; |
|
| 89 | } |
||
| 90 | } |
||
| 91 |
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: