| Conditions | 5 |
| Paths | 5 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public static function throwException($statusCode, $message) |
||
| 10 | { |
||
| 11 | switch ($statusCode) { |
||
| 12 | case APIException::FORBIDDEN: |
||
| 13 | throw new ForbiddenException($message, APIException::FORBIDDEN); |
||
| 14 | case APIException::UNAUTHORIZED: |
||
| 15 | throw new UnauthorizedException($message, APIException::UNAUTHORIZED); |
||
| 16 | case APIException::NOT_FOUND: |
||
| 17 | throw new NotFoundException($message, APIException::NOT_FOUND); |
||
| 18 | case APIException::BAD_REQUEST: |
||
| 19 | throw new BadRequestException($message, APIException::BAD_REQUEST); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | } |
||
| 23 |