| Total Complexity | 7 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 7 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | final class CasUserProvider implements CasUserProviderInterface |
||
| 23 | { |
||
| 24 | public function loadUserByIdentifier($identifier): UserInterface |
||
|
|
|||
| 25 | { |
||
| 26 | throw new UnsupportedUserException('Unsupported operation.'); |
||
| 27 | } |
||
| 28 | 6 | ||
| 29 | public function loadUserByResponse(ResponseInterface $response): CasUserInterface |
||
| 30 | 6 | { |
|
| 31 | if ($response instanceof TypeServiceValidate) { |
||
| 32 | return new CasUser($response->getCredentials()); |
||
| 33 | 2 | } |
|
| 34 | |||
| 35 | throw new AuthenticationException('Unable to load user from response.'); |
||
| 36 | 2 | } |
|
| 37 | |||
| 38 | public function loadUserByUsername(string $username): UserInterface |
||
| 39 | { |
||
| 40 | throw new UnsupportedUserException(sprintf('Username "%s" does not exist.', $username)); |
||
| 41 | 2 | } |
|
| 42 | 2 | ||
| 43 | public function refreshUser(UserInterface $user): UserInterface |
||
| 44 | { |
||
| 45 | 2 | if (!$user instanceof CasUserInterface) { |
|
| 46 | throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user))); |
||
| 47 | } |
||
| 48 | 1 | ||
| 49 | return $user; |
||
| 50 | 1 | } |
|
| 51 | |||
| 52 | public function supportsClass(string $class): bool |
||
| 55 | 1 | } |
|
| 56 | } |
||
| 57 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.