| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class SleeperHttpException extends \Exception |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * List of HTTP status codes |
||
| 12 | * |
||
| 13 | * From https://docs.sleeper.app/#errors |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | private $status = array( |
||
| 18 | 400 => 'Bad Request - Your request is invalid.', |
||
| 19 | 404 => 'Not Found - The specified kitten could not be found.', |
||
| 20 | 429 => "Too Many Requests - You're requesting too many kittens! Slow down!", |
||
| 21 | 500 => 'Internal Server Error - We had a problem with our server. Try again later.', |
||
| 22 | 503 => "Service Unavailable - We're temporarily offline for maintenance. Please try again later." |
||
| 23 | ); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param int[optional] $statusCode If NULL will use 500 as default |
||
| 27 | * @param string[optional] $statusMsg If NULL will use the default status phrase |
||
| 28 | */ |
||
| 29 | public function __construct($statusCode = 500, $statusMsg = null) |
||
| 38 |