Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 2 | public function process(ServerRequestInterface $request, DelegateInterface $delegate) |
|
22 | { |
||
23 | 2 | $path = substr($request->getUri()->getPath(), 1); |
|
24 | 2 | $redirect = RedirectModel::where('hash', $path)->first(); |
|
25 | 2 | if ($redirect) { |
|
26 | 1 | $redirect->increment('count'); |
|
27 | 1 | return new RedirectResponse($redirect->redirect_to, 301); |
|
28 | } |
||
29 | 1 | return new HtmlResponse(view('404.php'), 404); |
|
30 | } |
||
32 |