Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function guard( |
||
26 | \ReflectionObject|\ReflectionMethod $subject, |
||
27 | ServerRequestInterface $request, |
||
28 | ResponseInterface $response, |
||
29 | ): ?ResponseInterface { |
||
30 | $attributes = $subject->getAttributes(Guard::class, \ReflectionAttribute::IS_INSTANCEOF); |
||
31 | |||
32 | foreach ($attributes as $attribute) { |
||
33 | $guard = $this->instantiate($attribute); |
||
34 | $result = $guard($request, $response); |
||
35 | |||
36 | if ($result !== null) { |
||
37 | return $result; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | return null; |
||
42 | } |
||
44 |