| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 3 | public function authenticate(ServerRequestInterface $request): ?IdentityInterface |
|
| 31 | { |
||
| 32 | 3 | foreach ($this->authenticationMethods as $authenticationMethod) { |
|
| 33 | 2 | if (!$authenticationMethod instanceof AuthenticationMethodInterface) { |
|
| 34 | throw new \RuntimeException('Authentication method must be an instance of ' . AuthenticationMethodInterface::class . '.'); |
||
| 35 | } |
||
| 36 | |||
| 37 | 2 | $identity = $authenticationMethod->authenticate($request); |
|
| 38 | 2 | if ($identity !== null) { |
|
| 39 | 2 | return $identity; |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 2 | return null; |
|
| 44 | } |
||
| 54 |