| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | class CsrfMiddleware { |
||
| 20 | /** |
||
| 21 | * CSRF service. |
||
| 22 | * |
||
| 23 | * @var Csrf |
||
| 24 | */ |
||
| 25 | protected $csrf = null; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor. |
||
| 29 | * |
||
| 30 | * @param Csrf $csrf |
||
| 31 | */ |
||
| 32 | public function __construct( $csrf ) { |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Reject requests that fail nonce validation. |
||
| 38 | * |
||
| 39 | * @param RequestInterface $request |
||
| 40 | * @param Closure $next |
||
| 41 | * @param mixed $action |
||
| 42 | * @return ResponseInterface |
||
| 43 | * @throws InvalidCsrfTokenException |
||
| 44 | */ |
||
| 45 | public function handle( RequestInterface $request, Closure $next, $action = -1 ) { |
||
| 58 |