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