| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 4 |
| Ratio | 21.05 % |
| Changes | 8 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function __construct(){ |
||
|
|
|||
| 15 | # Config |
||
| 16 | self::$config = (new Config)->get(); |
||
| 17 | # Url |
||
| 18 | self::$path = explode('/',parse_url(urldecode($_SERVER['REQUEST_URI']))['path']); |
||
| 19 | View Code Duplication | foreach(self::$path as $key=>$value){ |
|
| 20 | $value = trim($value); |
||
| 21 | if(empty($value)) unset(self::$path[$key]); |
||
| 22 | } |
||
| 23 | self::$path = array_values(self::$path); |
||
| 24 | # Application |
||
| 25 | self::$app = new Application; |
||
| 26 | # View |
||
| 27 | self::$view = new View; |
||
| 28 | # Js |
||
| 29 | self::$js = new Js; |
||
| 30 | # Css |
||
| 31 | self::$css = new Css; |
||
| 32 | } |
||
| 33 | |||
| 47 |
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: