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