| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handle( $request, Closure $next ) { |
||
| 18 | if ( ! $request->isReadVerb() ) { |
||
| 19 | $token = CsrfService::getTokenFromRequest( $request ); |
||
|
|
|||
| 20 | if ( ! CsrfService::isValidToken( $token ) ) { |
||
| 21 | throw new InvalidCsrfTokenException(); |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | CsrfService::generateToken(); |
||
| 26 | |||
| 27 | return $next( $request ); |
||
| 28 | } |
||
| 30 |