| Conditions | 3 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function handle(Request $request, Closure $next) |
||
| 21 | { |
||
| 22 | try { |
||
| 23 | // Create a message from the post data and validate its signature |
||
| 24 | $message = Message::fromRawPostData(); |
||
| 25 | |||
| 26 | // Validate the message |
||
| 27 | $validator = new MessageValidator(); |
||
| 28 | |||
| 29 | if ($validator->isValid($message)) { |
||
| 30 | return $next($request); |
||
| 31 | } |
||
| 32 | } catch (\Exception $e) { |
||
| 33 | throw new NotFoundHttpException($e->getMessage()); |
||
| 34 | } |
||
| 35 | |||
| 36 | // If you get this far it means the request is not found |
||
| 37 | throw new NotFoundHttpException(); |
||
| 38 | } |
||
| 40 |