| Conditions | 8 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 10.8127 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 2 | public function __invoke(array $error) |
|
| 17 | { |
||
| 18 | 2 | switch ($error['error']) { |
|
| 19 | 2 | case 'authentication_error': |
|
| 20 | throw new AuthenticationErrorException($error['message']); |
||
| 21 | 2 | case 'invalid_request': |
|
| 22 | 1 | throw new InvalidRequestException($error['message'], $error['errors']); |
|
| 23 | 1 | case 'account_banned': |
|
| 24 | throw new AccountBannedException($error['message']); |
||
| 25 | 1 | case 'account_deleted': |
|
| 26 | throw new AccountDeletedException($error['message']); |
||
| 27 | 1 | case 'account_invalid': |
|
| 28 | throw new AccountInvalidException($error['message']); |
||
| 29 | 1 | case 'email_not_confirmed': |
|
| 30 | throw new EmailNotConfirmedException($error['message']); |
||
| 31 | 1 | case 'invalid_client': |
|
| 32 | 1 | throw new InvalidClientException($error['message']); |
|
| 33 | } |
||
| 34 | throw new UnknownException(); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |