Issues (182)

src/Code.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource;
6
7
/**
8
 * Resource object code
9
 *
10
 * @psalm-import-type StatusMessageMap from Types
11
 */
12
final class Code
13
{
14
    // 20X Success
15
    public const OK = 200;
16
    public const CREATED = 201;
17
    public const ACCEPTED = 202;
18
    public const NO_CONTENT = 204;
19
20
    // 30X Redirection
21
    public const MOVED_PERMANENTLY = 301;
22
    public const FOUND = 302;
23
    public const SEE_OTHER = 303;
24
    public const NOT_MODIFIED = 304;
25
    public const TEMPORARY_REDIRECT = 307;
26
    public const PERMANENT_REDIRECT = 308;
27
28
    // 40X Client Error
29
    public const BAD_REQUEST = 400;
30
    public const UNAUTHORIZED = 401;
31
    public const FORBIDDEN = 403;
32
    public const NOT_FOUND = 404;
33
34
    // 50X Service Error
35
    public const ERROR = 500;
36
    public const SERVICE_UNAVAILABLE = 503;
37
38
    /**
39
     * Hypertext Transfer Protocol (HTTP) Status Code Registry
40
     *
41
     * <pre>
42
     * - 1xx: Informational - Request received, continuing process
43
     * - 2xx: Success - The action was successfully received, understood, and accepted
44
     * - 3xx: Redirection - Further action must be taken in order to complete the request
45
     * - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled
46
     * - 5xx: Server Error - The server failed to fulfill an apparently valid request
47
     * </pre>
48
     *
49
     * @see http://www.iana.org/assignments/http-status-codes
50
     * @var StatusMessageMap
0 ignored issues
show
The type BEAR\Resource\StatusMessageMap was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
51
     */
52
    public $statusText = [
53
        100 => 'Continue',
54
        101 => 'Switching Protocols',
55
        102 => 'Processing',
56
        // 103-199   Unassigned
57
        200 => 'OK',
58
        201 => 'Created',
59
        202 => 'Accepted',
60
        203 => 'Non-Authoritative Information',
61
        204 => 'No Content',
62
        205 => 'Reset Content',
63
        206 => 'Partial Content',
64
        207 => 'Multi-Status',
65
        208 => 'Already Reported',
66
        // 209-225   Unassigned
67
        226 => 'IM Used',
68
        // 227-299   Unassigned
69
        300 => 'Multiple Choices',
70
        301 => 'Moved Permanently',
71
        302 => 'Found',
72
        303 => 'See Other',
73
        304 => 'Not Modified',
74
        305 => 'Use Proxy',
75
        306 => 'Switch Proxy',
76
        307 => 'Temporary Redirect',
77
        308 => 'Permanent Redirect',
78
        // 309-399   Unassigned
79
        400 => 'Bad Request',
80
        401 => 'Unauthorized',
81
        402 => 'Payment Required',
82
        403 => 'Forbidden',
83
        404 => 'Not Found',
84
        405 => 'Method Not Allowed',
85
        406 => 'Not Acceptable',
86
        407 => 'Proxy Authentication Required',
87
        408 => 'Request Timeout',
88
        409 => 'Conflict',
89
        410 => 'Gone',
90
        411 => 'Length Required',
91
        412 => 'Precondition Failed',
92
        413 => 'Request Entity Too Large',
93
        414 => 'Request Uri Too Long',
94
        415 => 'Unsupported Media Type',
95
        416 => 'Requested Range Not Satisfiable',
96
        417 => 'Expectation Failed',
97
        422 => 'Unprocessable Entity',
98
        423 => 'Locked',
99
        424 => 'Failed Dependency',
100
        // 427-499   Unassigned
101
        500 => 'Internal Server Error',
102
        501 => 'Not Implemented',
103
        502 => 'Bad Gateway',
104
        503 => 'Service Unavailable',
105
        504 => 'Gateway Timeout',
106
        505 => 'HTTP Version Not Supported',
107
        507 => 'Insufficient Storage',
108
        508 => 'Loop Detected',
109
        // 509       Unassigned
110
        510 => 'Not Extended',
111
        // 511-599   Unassigned
112
    ];
113
}
114