StatusCode   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 62
c 2
b 0
f 0
dl 0
loc 71
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getSupported() 0 66 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Http;
6
7
final class StatusCode
8
{
9
    /**
10
    * @return array<int,string>
11
    */
12
    public static function getSupported(): array
13
    {
14
        return [
15
            100 => 'Continue',
16
            101 => 'Switching Protocols',
17
            102 => 'Processing',
18
            200 => 'OK',
19
            201 => 'Created',
20
            202 => 'Accepted',
21
            203 => 'Non-Authoritative Information',
22
            204 => 'No Content',
23
            205 => 'Reset Content',
24
            206 => 'Partial Content',
25
            207 => 'Multi-Status',
26
            208 => 'Already Reported',
27
            226 => 'IM Used',
28
            300 => 'Multiple Choices',
29
            301 => 'Moved Permanently',
30
            302 => 'Moved Temporarily',
31
            303 => 'See Other',
32
            304 => 'Not Modified',
33
            305 => 'Use Proxy',
34
            307 => 'Temporary Redirect',
35
            308 => 'Permanent Redirect',
36
            400 => 'Bad Request',
37
            401 => 'Unauthorized',
38
            402 => 'Payment Required',
39
            403 => 'Forbidden',
40
            404 => 'Not Found',
41
            405 => 'Method Not Allowed',
42
            406 => 'Not Acceptable',
43
            407 => 'Proxy Authentication Required',
44
            408 => 'Request Time-out',
45
            409 => 'Conflict',
46
            410 => 'Gone',
47
            411 => 'Length Required',
48
            412 => 'Precondition Failed',
49
            413 => 'Request Entity Too Large',
50
            414 => 'Request-URI Too Large',
51
            415 => 'Unsupported Media Type',
52
            416 => 'Requested Range Not Satisfiable',
53
            417 => 'Expectation Failed',
54
            421 => 'Misdirected Request',
55
            422 => 'Unprocessable Entity',
56
            423 => 'Locked',
57
            424 => 'Failed Dependency',
58
            426 => 'Upgrade Required',
59
            428 => 'Precondition Required',
60
            429 => 'Too Many Requests',
61
            431 => 'Request Header Fields Too Large',
62
            451 => 'Unavailable For Legal Reasons',
63
            500 => 'Internal Server Error',
64
            501 => 'Not Implemented',
65
            502 => 'Bad Gateway',
66
            503 => 'Service Unavailable',
67
            504 => 'Gateway Time-out',
68
            505 => 'HTTP Version not supported',
69
            506 => 'Variant Also Negotiates',
70
            507 => 'Insufficient Storage',
71
            508 => 'Loop Detected',
72
            510 => 'Not Extended',
73
            511 => 'Network Authentication Required',
74
            // Unofficial codes
75
            // "Cloudflare's reverse proxy service expands the 5xx series of errors space
76
            // to signal issues with the origin server"
77
            525 => 'SSL Handshake Failed', // Cloudflare could not negotiate a SSL/TLS handshake with the origin server.
78
79
        ];
80
    }
81
}
82