StatusCodes
in package
Contains definition of StatusCodes class
Table of Contents
- ERRORCODESBEGINAT = 400
- HTTP_ACCEPTED = 202
- HTTP_BAD_GATEWAY = 502
- HTTP_BAD_REQUEST = 400
- HTTP_CONFLICT = 409
- HTTP_CONTINUE = 100
- HTTP_CREATED = 201
- HTTP_EXPECTATION_FAILED = 417
- HTTP_FORBIDDEN = 403
- HTTP_FOUND = 302
- HTTP_GATEWAY_TIMEOUT = 504
- HTTP_GONE = 410
- HTTP_INTERNAL_SERVER_ERROR = 500
- HTTP_LENGTH_REQUIRED = 411
- HTTP_METHOD_NOT_ALLOWED = 405
- HTTP_MOVED_PERMANENTLY = 301
- HTTP_MULTIPLE_CHOICES = 300
- HTTP_NO_CONTENT = 204
- HTTP_NONAUTHORITATIVE_INFORMATION = 203
- HTTP_NOT_ACCEPTABLE = 406
- HTTP_NOT_FOUND = 404
- HTTP_NOT_IMPLEMENTED = 501
- HTTP_NOT_MODIFIED = 304
- HTTP_OK = 200
- HTTP_PARTIAL_CONTENT = 206
- HTTP_PAYMENT_REQUIRED = 402
- HTTP_PERMANENT_REDIRECT = 308
- HTTP_PRECONDITION_FAILED = 412
- HTTP_PROXY_AUTHENTICATION_REQUIRED = 407
- HTTP_REQUEST_ENTITY_TOO_LARGE = 413
- HTTP_REQUEST_TIMEOUT = 408
- HTTP_REQUEST_URI_TOO_LONG = 414
- HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416
- HTTP_RESET_CONTENT = 205
- HTTP_SEE_OTHER = 303
- HTTP_SERVICE_UNAVAILABLE = 503
- HTTP_SWITCHING_PROTOCOLS = 101
- HTTP_TEMPORARY_REDIRECT = 307
- HTTP_UNAUTHORIZED = 401
- HTTP_UNSUPPORTED_MEDIA_TYPE = 415
- HTTP_UNUSED = 306
- HTTP_USE_PROXY = 305
- HTTP_VERSION_NOT_SUPPORTED = 505
- $messages : array<, string>
- canHaveBody() : bool
- Can there be a body sent with this return code?
- getMessage() : string
- Return the message part for a code
- getMessageForCode() : string
- return code and message
- httpHeaderFor() : string
- Generate a header
- isError() : bool
- Is this an error code?
- isValid() : bool
- Is this a valid code?
Constants
ERRORCODESBEGINAT
public
mixed
ERRORCODESBEGINAT
= 400
HTTP_ACCEPTED
public
mixed
HTTP_ACCEPTED
= 202
HTTP_BAD_GATEWAY
public
mixed
HTTP_BAD_GATEWAY
= 502
HTTP_BAD_REQUEST
public
mixed
HTTP_BAD_REQUEST
= 400
HTTP_CONFLICT
public
mixed
HTTP_CONFLICT
= 409
HTTP_CONTINUE
public
mixed
HTTP_CONTINUE
= 100
HTTP_CREATED
public
mixed
HTTP_CREATED
= 201
HTTP_EXPECTATION_FAILED
public
mixed
HTTP_EXPECTATION_FAILED
= 417
HTTP_FORBIDDEN
public
mixed
HTTP_FORBIDDEN
= 403
HTTP_FOUND
public
mixed
HTTP_FOUND
= 302
HTTP_GATEWAY_TIMEOUT
public
mixed
HTTP_GATEWAY_TIMEOUT
= 504
HTTP_GONE
public
mixed
HTTP_GONE
= 410
HTTP_INTERNAL_SERVER_ERROR
public
mixed
HTTP_INTERNAL_SERVER_ERROR
= 500
HTTP_LENGTH_REQUIRED
public
mixed
HTTP_LENGTH_REQUIRED
= 411
HTTP_METHOD_NOT_ALLOWED
public
mixed
HTTP_METHOD_NOT_ALLOWED
= 405
HTTP_MOVED_PERMANENTLY
public
mixed
HTTP_MOVED_PERMANENTLY
= 301
HTTP_MULTIPLE_CHOICES
public
mixed
HTTP_MULTIPLE_CHOICES
= 300
HTTP_NO_CONTENT
public
mixed
HTTP_NO_CONTENT
= 204
HTTP_NONAUTHORITATIVE_INFORMATION
public
mixed
HTTP_NONAUTHORITATIVE_INFORMATION
= 203
HTTP_NOT_ACCEPTABLE
public
mixed
HTTP_NOT_ACCEPTABLE
= 406
HTTP_NOT_FOUND
public
mixed
HTTP_NOT_FOUND
= 404
HTTP_NOT_IMPLEMENTED
public
mixed
HTTP_NOT_IMPLEMENTED
= 501
HTTP_NOT_MODIFIED
public
mixed
HTTP_NOT_MODIFIED
= 304
HTTP_OK
public
mixed
HTTP_OK
= 200
HTTP_PARTIAL_CONTENT
public
mixed
HTTP_PARTIAL_CONTENT
= 206
HTTP_PAYMENT_REQUIRED
public
mixed
HTTP_PAYMENT_REQUIRED
= 402
HTTP_PERMANENT_REDIRECT
public
mixed
HTTP_PERMANENT_REDIRECT
= 308
HTTP_PRECONDITION_FAILED
public
mixed
HTTP_PRECONDITION_FAILED
= 412
HTTP_PROXY_AUTHENTICATION_REQUIRED
public
mixed
HTTP_PROXY_AUTHENTICATION_REQUIRED
= 407
HTTP_REQUEST_ENTITY_TOO_LARGE
public
mixed
HTTP_REQUEST_ENTITY_TOO_LARGE
= 413
HTTP_REQUEST_TIMEOUT
public
mixed
HTTP_REQUEST_TIMEOUT
= 408
HTTP_REQUEST_URI_TOO_LONG
public
mixed
HTTP_REQUEST_URI_TOO_LONG
= 414
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
public
mixed
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
= 416
HTTP_RESET_CONTENT
public
mixed
HTTP_RESET_CONTENT
= 205
HTTP_SEE_OTHER
public
mixed
HTTP_SEE_OTHER
= 303
HTTP_SERVICE_UNAVAILABLE
public
mixed
HTTP_SERVICE_UNAVAILABLE
= 503
HTTP_SWITCHING_PROTOCOLS
public
mixed
HTTP_SWITCHING_PROTOCOLS
= 101
HTTP_TEMPORARY_REDIRECT
public
mixed
HTTP_TEMPORARY_REDIRECT
= 307
HTTP_UNAUTHORIZED
public
mixed
HTTP_UNAUTHORIZED
= 401
HTTP_UNSUPPORTED_MEDIA_TYPE
public
mixed
HTTP_UNSUPPORTED_MEDIA_TYPE
= 415
HTTP_UNUSED
public
mixed
HTTP_UNUSED
= 306
HTTP_USE_PROXY
public
mixed
HTTP_USE_PROXY
= 305
HTTP_VERSION_NOT_SUPPORTED
public
mixed
HTTP_VERSION_NOT_SUPPORTED
= 505
Properties
$messages
private
static array<, string>
$messages
= [
// [Informational 1xx]
100 => 'Continue',
101 => 'Switching Protocols',
// [Successful 2xx]
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
// [Redirection 3xx]
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
306 => '(Unused)',
307 => 'Temporary Redirect',
// [Client Error 4xx]
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
// [Server Error 5xx]
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
]
The messages for each code.
Methods
canHaveBody()
Can there be a body sent with this return code?
public
static canHaveBody(int $code) : bool
Parameters
- $code : int
-
The code number
Tags
Return values
bool —getMessage()
Return the message part for a code
public
static getMessage(int $code) : string
Parameters
- $code : int
-
The code number
Return values
string —getMessageForCode()
return code and message
public
static getMessageForCode(int $code) : string
Parameters
- $code : int
-
The code number
Return values
string —httpHeaderFor()
Generate a header
public
static httpHeaderFor(int $code) : string
Parameters
- $code : int
-
The code number
Return values
string —isError()
Is this an error code?
public
static isError(int $code) : bool
Parameters
- $code : int
-
The code number
Tags
Return values
bool —isValid()
Is this a valid code?
public
static isValid(int $code) : bool
Parameters
- $code : int
-
The code number