| 1 | <?php |
||
| 10 | class ResponseCodes |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Http status code to message map. |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $messages = [ |
||
| 18 | 200 => 'All is well.', |
||
| 19 | 400 => 'Your request has missing arguments or is malformed.', |
||
| 20 | 401 => 'Your request is not authenticated.', |
||
| 21 | 403 => 'Your request is authenticated but has insufficient permissions.', |
||
| 22 | 405 => 'You are using an incorrect HTTP verb. Double check whether it should be POST/GET/DELETE/etc.', |
||
| 23 | 404 => 'The endpoint requested does not exist.', |
||
| 24 | 406 => 'Your application does not accept the content format returned according to the Accept headers sent in the request.', |
||
| 25 | 429 => 'Your application is exceeding its rate limit. Back off, buddy. :p', |
||
| 26 | 500 => 'Something is wrong on our end. Whoopsie.', |
||
| 27 | 504 => 'Something has timed out on our end. Whoopsie.', |
||
| 28 | ]; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Message for a given response code. |
||
| 32 | * |
||
| 33 | * @param integer $responseCode HTTP response code. |
||
| 34 | * |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | public function getMessage($responseCode) |
||
| 41 | } |
||
| 42 |