| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 3 | protected function getErrorBagForStatusCode($statusCode) |
|
| 37 | { |
||
| 38 | $errorMap = [ |
||
| 39 | 3 | SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY => 'google2fa.error_messages.wrong_otp', |
|
| 40 | 3 | SymfonyResponse::HTTP_BAD_REQUEST => 'google2fa.error_messages.cannot_be_empty', |
|
| 41 | ]; |
||
| 42 | |||
| 43 | 3 | return $this->createErrorBagForMessage( |
|
| 44 | 3 | trans( |
|
| 45 | 3 | config( |
|
| 46 | 3 | array_key_exists($statusCode, $errorMap) ? $errorMap[$statusCode] : 'google2fa.error_messages.unknown' |
|
| 47 | ) |
||
| 48 | ) |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |