| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 31 | protected function middlewareExists(string $m) |
||
| 32 | { |
||
| 33 | if(class_exists(str_replace('::class','',$m))){ |
||
| 34 | $m = str_replace('::class','',$m); |
||
| 35 | return new $m(); |
||
| 36 | } |
||
| 37 | |||
| 38 | if(array_key_exists($m,$this->middlewares)){ |
||
| 39 | return new $this->middlewares[$m](); |
||
| 40 | } |
||
| 41 | |||
| 42 | throw new Exception("Middleware {$m} not found."); |
||
| 43 | } |
||
| 46 |