Conditions | 4 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function beforeProcess( |
||
34 | $dispatcherStatus, |
||
35 | HttpResponse $response, |
||
36 | HttpRequest $request |
||
37 | ) |
||
38 | { |
||
39 | foreach ($this->ignorePath as $path) { |
||
40 | if (preg_match("~$path~", $request->getRequestPath())) { |
||
41 | return MiddlewareResult::continue(); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | try { |
||
46 | $request->appendVars((array)$this->jwtWrapper->extractData()); |
||
47 | } catch (JwtWrapperException $ex) { |
||
48 | throw new Error401Exception($ex->getMessage()); |
||
49 | } |
||
50 | |||
51 | return MiddlewareResult::continue(); |
||
52 | } |
||
54 |