| Conditions | 4 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function __construct(Request $request) |
||
| 16 | { |
||
| 17 | $res = explode('::', $request->target()); |
||
| 18 | |||
| 19 | // if explode() returned false |
||
| 20 | // or if the array doesn't have a second element (the method) |
||
| 21 | // or if the array has more than 2 elements |
||
| 22 | if ($res === false || !isset($res[1]) || isset($res[2])) { |
||
| 23 | throw new RouterException('INVALID_TARGET_FORMAT'); |
||
| 24 | } |
||
| 25 | |||
| 26 | $this->controller = $res[0]; |
||
| 27 | $this->method = $res[1]; |
||
| 28 | } |
||
| 40 |