| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.2098 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 2 | public function loadUserByResponse(ResponseInterface $response): CasUserInterface |
|
| 23 | { |
||
| 24 | try { |
||
| 25 | 2 | $introspect = Introspector::detect($response); |
|
| 26 | } catch (InvalidArgumentException $exception) { |
||
| 27 | throw new AuthenticationException($exception->getMessage()); |
||
| 28 | } |
||
| 29 | |||
| 30 | 2 | if ($introspect instanceof ServiceValidate) { |
|
| 31 | 2 | return new CasUser($introspect->getCredentials()); |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | throw new AuthenticationException('Unable to load user from response.'); |
|
| 35 | } |
||
| 67 |