1 | <?php |
||
2 | |||
3 | namespace Soheilrt\AdobeConnectClient\Client\Traits; |
||
4 | |||
5 | /** |
||
6 | * Need exists the statusCode attribute. |
||
7 | */ |
||
8 | trait HttpReasonPhrase |
||
9 | { |
||
10 | private static $phrases = [ |
||
11 | 100 => 'Continue', |
||
12 | 101 => 'Switching Protocols', |
||
13 | 102 => 'Processing', |
||
14 | 200 => 'OK', |
||
15 | 201 => 'Created', |
||
16 | 202 => 'Accepted', |
||
17 | 203 => 'Non-Authoritative Information', |
||
18 | 204 => 'No Content', |
||
19 | 205 => 'Reset Content', |
||
20 | 206 => 'Partial Content', |
||
21 | 207 => 'Multi-status', |
||
22 | 208 => 'Already Reported', |
||
23 | 300 => 'Multiple Choices', |
||
24 | 301 => 'Moved Permanently', |
||
25 | 302 => 'Found', |
||
26 | 303 => 'See Other', |
||
27 | 304 => 'Not Modified', |
||
28 | 305 => 'Use Proxy', |
||
29 | 306 => 'Switch Proxy', |
||
30 | 307 => 'Temporary Redirect', |
||
31 | 400 => 'Bad Request', |
||
32 | 401 => 'Unauthorized', |
||
33 | 402 => 'Payment Required', |
||
34 | 403 => 'Forbidden', |
||
35 | 404 => 'Not Found', |
||
36 | 405 => 'Method Not Allowed', |
||
37 | 406 => 'Not Acceptable', |
||
38 | 407 => 'Proxy Authentication Required', |
||
39 | 408 => 'Request Time-out', |
||
40 | 409 => 'Conflict', |
||
41 | 410 => 'Gone', |
||
42 | 411 => 'Length Required', |
||
43 | 412 => 'Precondition Failed', |
||
44 | 413 => 'Request Entity Too Large', |
||
45 | 414 => 'Request-URI Too Large', |
||
46 | 415 => 'Unsupported Media Type', |
||
47 | 416 => 'Requested range not satisfiable', |
||
48 | 417 => 'Expectation Failed', |
||
49 | 418 => 'I\'m a teapot', |
||
50 | 422 => 'Unprocessable Entity', |
||
51 | 423 => 'Locked', |
||
52 | 424 => 'Failed Dependency', |
||
53 | 425 => 'Unordered Collection', |
||
54 | 426 => 'Upgrade Required', |
||
55 | 428 => 'Precondition Required', |
||
56 | 429 => 'Too Many Requests', |
||
57 | 431 => 'Request Header Fields Too Large', |
||
58 | 451 => 'Unavailable For Legal Reasons', |
||
59 | 500 => 'Internal Server Error', |
||
60 | 501 => 'Not Implemented', |
||
61 | 502 => 'Bad Gateway', |
||
62 | 503 => 'Service Unavailable', |
||
63 | 504 => 'Gateway Time-out', |
||
64 | 505 => 'HTTP Version not supported', |
||
65 | 506 => 'Variant Also Negotiates', |
||
66 | 507 => 'Insufficient Storage', |
||
67 | 508 => 'Loop Detected', |
||
68 | 511 => 'Network Authentication Required', |
||
69 | ]; |
||
70 | |||
71 | /** |
||
72 | * Gets the response reason phrase associated with the status code. |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getReasonPhrase() |
||
77 | { |
||
78 | return isset(static::$phrases[$this->statusCode]) |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
79 | ? static::$phrases[$this->statusCode] |
||
80 | : ''; |
||
81 | } |
||
82 | } |
||
83 |