|
|
@@ -0,0 +1,139 @@
|
|
|
+<?php
|
|
|
+declare(strict_types=1);
|
|
|
+
|
|
|
+namespace App\Enum\Utils;
|
|
|
+
|
|
|
+use MyCLabs\Enum\Enum;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Enums for HTTP status codes.
|
|
|
+ *
|
|
|
+ * @method static int CONTINUE() Returns status code: 100
|
|
|
+ * @method static int SWITCHING_PROTOCOLS() Returns status code: 101
|
|
|
+ * @method static int PROCESSING() Returns status code: 102
|
|
|
+ * @method static int EARLY_HINTS() Returns status code: 103
|
|
|
+ * @method static int OK() Returns status code: 200
|
|
|
+ * @method static int CREATED() Returns status code: 201
|
|
|
+ * @method static int ACCEPTED() Returns status code: 202
|
|
|
+ * @method static int NON_AUTHORITATIVE_INFORMATION() Returns status code: 203
|
|
|
+ * @method static int NO_CONTENT() Returns status code: 204
|
|
|
+ * @method static int RESET_CONTENT() Returns status code: 205
|
|
|
+ * @method static int PARTIAL_CONTENT() Returns status code: 206
|
|
|
+ * @method static int MULTI_STATUS() Returns status code: 207
|
|
|
+ * @method static int ALREADY_REPORTED() Returns status code: 208
|
|
|
+ * @method static int IM_USED() Returns status code: 226
|
|
|
+ * @method static int MULTIPLE_CHOICES() Returns status code: 300
|
|
|
+ * @method static int MOVED_PERMANENTLY() Returns status code: 301
|
|
|
+ * @method static int FOUND() Returns status code: 302
|
|
|
+ * @method static int SEE_OTHER() Returns status code: 303
|
|
|
+ * @method static int NOT_MODIFIED() Returns status code: 304
|
|
|
+ * @method static int USE_PROXY() Returns status code: 305
|
|
|
+ * @method static int RESERVED() Returns status code: 306
|
|
|
+ * @method static int TEMPORARY_REDIRECT() Returns status code: 307
|
|
|
+ * @method static int PERMANENTLY_REDIRECT() Returns status code: 308
|
|
|
+ * @method static int BAD_REQUEST() Returns status code: 400
|
|
|
+ * @method static int UNAUTHORIZED() Returns status code: 401
|
|
|
+ * @method static int PAYMENT_REQUIRED() Returns status code: 402
|
|
|
+ * @method static int FORBIDDEN() Returns status code: 403
|
|
|
+ * @method static int NOT_FOUND() Returns status code: 404
|
|
|
+ * @method static int METHOD_NOT_ALLOWED() Returns status code: 405
|
|
|
+ * @method static int NOT_ACCEPTABLE() Returns status code: 406
|
|
|
+ * @method static int PROXY_AUTHENTICATION_REQUIRED() Returns status code: 407
|
|
|
+ * @method static int REQUEST_TIMEOUT() Returns status code: 408
|
|
|
+ * @method static int CONFLICT() Returns status code: 409
|
|
|
+ * @method static int GONE() Returns status code: 410
|
|
|
+ * @method static int LENGTH_REQUIRED() Returns status code: 411
|
|
|
+ * @method static int PRECONDITION_FAILED() Returns status code: 412
|
|
|
+ * @method static int REQUEST_ENTITY_TOO_LARGE() Returns status code: 413
|
|
|
+ * @method static int REQUEST_URI_TOO_LONG() Returns status code: 414
|
|
|
+ * @method static int UNSUPPORTED_MEDIA_TYPE() Returns status code: 415
|
|
|
+ * @method static int REQUESTED_RANGE_NOT_SATISFIABLE() Returns status code: 416
|
|
|
+ * @method static int EXPECTATION_FAILED() Returns status code: 417
|
|
|
+ * @method static int MISDIRECTED_REQUEST() Returns status code: 421
|
|
|
+ * @method static int UNPROCESSABLE_ENTITY() Returns status code: 422
|
|
|
+ * @method static int LOCKED() Returns status code: 423
|
|
|
+ * @method static int FAILED_DEPENDENCY() Returns status code: 424
|
|
|
+ * @method static int TOO_EARLY() Returns status code: 425
|
|
|
+ * @method static int UPGRADE_REQUIRED() Returns status code: 426
|
|
|
+ * @method static int PRECONDITION_REQUIRED() Returns status code: 428
|
|
|
+ * @method static int TOO_MANY_REQUESTS() Returns status code: 429
|
|
|
+ * @method static int REQUEST_HEADER_FIELDS_TOO_LARGE() Returns status code: 431
|
|
|
+ * @method static int UNAVAILABLE_FOR_LEGAL_REASONS() Returns status code: 451
|
|
|
+ * @method static int INTERNAL_SERVER_ERROR() Returns status code: 500
|
|
|
+ * @method static int NOT_IMPLEMENTED() Returns status code: 501
|
|
|
+ * @method static int BAD_GATEWAY() Returns status code: 502
|
|
|
+ * @method static int SERVICE_UNAVAILABLE() Returns status code: 503
|
|
|
+ * @method static int GATEWAY_TIMEOUT() Returns status code: 504
|
|
|
+ * @method static int VERSION_NOT_SUPPORTED() Returns status code: 505
|
|
|
+ * @method static int VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL() Returns status code: 506
|
|
|
+ * @method static int INSUFFICIENT_STORAGE() Returns status code: 507
|
|
|
+ * @method static int LOOP_DETECTED() Returns status code: 508
|
|
|
+ * @method static int NOT_EXTENDED() Returns status code: 510
|
|
|
+ * @method static int NETWORK_AUTHENTICATION_REQUIRED() Returns status code: 511
|
|
|
+ */
|
|
|
+class HttpCodeEnum extends Enum
|
|
|
+{
|
|
|
+ private const CONTINUE = 100;
|
|
|
+ private const SWITCHING_PROTOCOLS = 101;
|
|
|
+ private const PROCESSING = 102; // RFC2518
|
|
|
+ private const EARLY_HINTS = 103; // RFC8297
|
|
|
+ private const OK = 200;
|
|
|
+ private const CREATED = 201;
|
|
|
+ private const ACCEPTED = 202;
|
|
|
+ private const NON_AUTHORITATIVE_INFORMATION = 203;
|
|
|
+ private const NO_CONTENT = 204;
|
|
|
+ private const RESET_CONTENT = 205;
|
|
|
+ private const PARTIAL_CONTENT = 206;
|
|
|
+ private const MULTI_STATUS = 207; // RFC4918
|
|
|
+ private const ALREADY_REPORTED = 208; // RFC5842
|
|
|
+ private const IM_USED = 226; // RFC3229
|
|
|
+ private const MULTIPLE_CHOICES = 300;
|
|
|
+ private const MOVED_PERMANENTLY = 301;
|
|
|
+ private const FOUND = 302;
|
|
|
+ private const SEE_OTHER = 303;
|
|
|
+ private const NOT_MODIFIED = 304;
|
|
|
+ private const USE_PROXY = 305;
|
|
|
+ private const RESERVED = 306;
|
|
|
+ private const TEMPORARY_REDIRECT = 307;
|
|
|
+ private const PERMANENTLY_REDIRECT = 308; // RFC7238
|
|
|
+ private const BAD_REQUEST = 400;
|
|
|
+ private const UNAUTHORIZED = 401;
|
|
|
+ private const PAYMENT_REQUIRED = 402;
|
|
|
+ private const FORBIDDEN = 403;
|
|
|
+ private const NOT_FOUND = 404;
|
|
|
+ private const METHOD_NOT_ALLOWED = 405;
|
|
|
+ private const NOT_ACCEPTABLE = 406;
|
|
|
+ private const PROXY_AUTHENTICATION_REQUIRED = 407;
|
|
|
+ private const REQUEST_TIMEOUT = 408;
|
|
|
+ private const CONFLICT = 409;
|
|
|
+ private const GONE = 410;
|
|
|
+ private const LENGTH_REQUIRED = 411;
|
|
|
+ private const PRECONDITION_FAILED = 412;
|
|
|
+ private const REQUEST_ENTITY_TOO_LARGE = 413;
|
|
|
+ private const REQUEST_URI_TOO_LONG = 414;
|
|
|
+ private const UNSUPPORTED_MEDIA_TYPE = 415;
|
|
|
+ private const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
|
|
|
+ private const EXPECTATION_FAILED = 417;
|
|
|
+ private const I_AM_A_TEAPOT = 418; // RFC2324
|
|
|
+ private const MISDIRECTED_REQUEST = 421; // RFC7540
|
|
|
+ private const UNPROCESSABLE_ENTITY = 422; // RFC4918
|
|
|
+ private const LOCKED = 423; // RFC4918
|
|
|
+ private const FAILED_DEPENDENCY = 424; // RFC4918
|
|
|
+ private const TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04
|
|
|
+ private const UPGRADE_REQUIRED = 426; // RFC2817
|
|
|
+ private const PRECONDITION_REQUIRED = 428; // RFC6585
|
|
|
+ private const TOO_MANY_REQUESTS = 429; // RFC6585
|
|
|
+ private const REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585
|
|
|
+ private const UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC7725
|
|
|
+ private const INTERNAL_SERVER_ERROR = 500;
|
|
|
+ private const NOT_IMPLEMENTED = 501;
|
|
|
+ private const BAD_GATEWAY = 502;
|
|
|
+ private const SERVICE_UNAVAILABLE = 503;
|
|
|
+ private const GATEWAY_TIMEOUT = 504;
|
|
|
+ private const VERSION_NOT_SUPPORTED = 505;
|
|
|
+ private const VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295
|
|
|
+ private const INSUFFICIENT_STORAGE = 507; // RFC4918
|
|
|
+ private const LOOP_DETECTED = 508; // RFC5842
|
|
|
+ private const NOT_EXTENDED = 510; // RFC2774
|
|
|
+ private const NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585
|
|
|
+}
|