Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
45 | public function handle( RequestInterface $request, Closure $next, $action = -1 ) { |
||
46 | if ( ! $request->isReadVerb() ) { |
||
47 | $token = $this->csrf->getTokenFromRequest( $request ); |
||
48 | if ( ! $this->csrf->isValidToken( $token, $action ) ) { |
||
49 | throw new InvalidCsrfTokenException(); |
||
50 | } |
||
51 | } |
||
52 | |||
53 | $this->csrf->generateToken( $action ); |
||
54 | |||
55 | return $next( $request ); |
||
56 | } |
||
58 |