Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 4 | public function authenticate(ServerRequestInterface $request): ?IdentityInterface |
|
25 | { |
||
26 | 4 | foreach ($this->methods as $method) { |
|
27 | 3 | if (!$method instanceof AuthenticationMethodInterface) { |
|
28 | 1 | throw new \RuntimeException('Authentication method must be an instance of ' . AuthenticationMethodInterface::class . '.'); |
|
29 | } |
||
30 | |||
31 | 2 | $identity = $method->authenticate($request); |
|
32 | 2 | if ($identity !== null) { |
|
33 | 2 | return $identity; |
|
34 | } |
||
35 | } |
||
36 | |||
37 | 2 | return null; |
|
38 | } |
||
48 |