Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
move code from http client interface to response
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Zogg committed Nov 4, 2014
1 parent 370afbd commit 4ecf38b
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/HttpClientInterface.php
Expand Up @@ -4,74 +4,139 @@

interface HttpClientInterface
{
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_100 = 'Continue';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_101 = 'Switching Protocols';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_102 = 'Processing';

/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_200 = 'OK';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_201 = 'Created';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_202 = 'Accepted';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_203 = 'Non-Authoritative Information';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_204 = 'No Content';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_205 = 'Reset Content';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_206 = 'Partial Content';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_207 = 'Multi-Status';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_208 = 'Already Reported';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_226 = 'IM Used';

/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_300 = 'Multiple Choices';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_301 = 'Moved Permanently';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_302 = 'Found';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_303 = 'See Other';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_304 = 'Not Modified';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_305 = 'Use Proxy';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_306 = '(reserviert)';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_307 = 'Temporary Redirect';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_308 = 'Permanent Redirect';

/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_400 = 'Bad Request';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_401 = 'Unauthorized';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_402 = 'Payment Required';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_403 = 'Forbidden';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_404 = 'Not Found';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_405 = 'Method Not Allowed';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_406 = 'Not Acceptable';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_407 = 'Proxy Authentication Required';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_408 = 'Request Time-out';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_409 = 'Conflict';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_410 = 'Gone';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_411 = 'Length Required';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_412 = 'Precondition Failed';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_413 = 'Request Entity Too Large';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_414 = 'Request-URL Too Long';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_415 = 'Unsupported Media Type';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_416 = 'Requested range not satisfiable';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_417 = 'Expectation Failed';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_418 = 'I’m a teapot';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_420 = 'Policy Not Fulfilled';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_421 = 'There are too many connections from your internet address';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_422 = 'Unprocessable Entity';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_423 = 'Locked';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_424 = 'Failed Dependency';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_425 = 'Unordered Collection';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_426 = 'Upgrade Required';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_428 = 'Precondition Required';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_429 = 'Too Many Requests';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_431 = 'Request Header Fields Too Large';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_444 = 'No Response';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_449 = 'The request should be retried after doing the appropriate action';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_451 = 'Unavailable For Legal Reasons';

/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_500 = 'Internal Server Error';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_501 = 'Not Implemented';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_502 = 'Bad Gateway';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_503 = 'Service Unavailable';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_504 = 'Gateway Time-out';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_505 = 'HTTP Version not supported';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_506 = 'Variant Also Negotiates';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_507 = 'Insufficient Storage';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_508 = 'Loop Detected';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_509 = 'Bandwidth Limit Exceeded';
/** @deprecated use Response::STATUS_MESSAGE_ */
const CODE_510 = 'Not Extended';

/**
Expand Down
70 changes: 70 additions & 0 deletions src/Response.php
Expand Up @@ -14,6 +14,76 @@ class Response extends AbstractMessage
*/
protected $statusMessage;

const STATUS_MESSAGE_100 = 'Continue';
const STATUS_MESSAGE_101 = 'Switching Protocols';
const STATUS_MESSAGE_102 = 'Processing';

const STATUS_MESSAGE_200 = 'OK';
const STATUS_MESSAGE_201 = 'Created';
const STATUS_MESSAGE_202 = 'Accepted';
const STATUS_MESSAGE_203 = 'Non-Authoritative Information';
const STATUS_MESSAGE_204 = 'No Content';
const STATUS_MESSAGE_205 = 'Reset Content';
const STATUS_MESSAGE_206 = 'Partial Content';
const STATUS_MESSAGE_207 = 'Multi-Status';
const STATUS_MESSAGE_208 = 'Already Reported';
const STATUS_MESSAGE_226 = 'IM Used';

const STATUS_MESSAGE_300 = 'Multiple Choices';
const STATUS_MESSAGE_301 = 'Moved Permanently';
const STATUS_MESSAGE_302 = 'Found';
const STATUS_MESSAGE_303 = 'See Other';
const STATUS_MESSAGE_304 = 'Not Modified';
const STATUS_MESSAGE_305 = 'Use Proxy';
const STATUS_MESSAGE_306 = '(reserved)';
const STATUS_MESSAGE_307 = 'Temporary Redirect';
const STATUS_MESSAGE_308 = 'Permanent Redirect';

const STATUS_MESSAGE_400 = 'Bad Request';
const STATUS_MESSAGE_401 = 'Unauthorized';
const STATUS_MESSAGE_402 = 'Payment Required';
const STATUS_MESSAGE_403 = 'Forbidden';
const STATUS_MESSAGE_404 = 'Not Found';
const STATUS_MESSAGE_405 = 'Method Not Allowed';
const STATUS_MESSAGE_406 = 'Not Acceptable';
const STATUS_MESSAGE_407 = 'Proxy Authentication Required';
const STATUS_MESSAGE_408 = 'Request Time-out';
const STATUS_MESSAGE_409 = 'Conflict';
const STATUS_MESSAGE_410 = 'Gone';
const STATUS_MESSAGE_411 = 'Length Required';
const STATUS_MESSAGE_412 = 'Precondition Failed';
const STATUS_MESSAGE_413 = 'Request Entity Too Large';
const STATUS_MESSAGE_414 = 'Request-URL Too Long';
const STATUS_MESSAGE_415 = 'Unsupported Media Type';
const STATUS_MESSAGE_416 = 'Requested range not satisfiable';
const STATUS_MESSAGE_417 = 'Expectation Failed';
const STATUS_MESSAGE_418 = 'I’m a teapot';
const STATUS_MESSAGE_420 = 'Policy Not Fulfilled';
const STATUS_MESSAGE_421 = 'There are too many connections from your internet address';
const STATUS_MESSAGE_422 = 'Unprocessable Entity';
const STATUS_MESSAGE_423 = 'Locked';
const STATUS_MESSAGE_424 = 'Failed Dependency';
const STATUS_MESSAGE_425 = 'Unordered Collection';
const STATUS_MESSAGE_426 = 'Upgrade Required';
const STATUS_MESSAGE_428 = 'Precondition Required';
const STATUS_MESSAGE_429 = 'Too Many Requests';
const STATUS_MESSAGE_431 = 'Request Header Fields Too Large';
const STATUS_MESSAGE_444 = 'No Response';
const STATUS_MESSAGE_449 = 'The request should be retried after doing the appropriate action';
const STATUS_MESSAGE_451 = 'Unavailable For Legal Reasons';

const STATUS_MESSAGE_500 = 'Internal Server Error';
const STATUS_MESSAGE_501 = 'Not Implemented';
const STATUS_MESSAGE_502 = 'Bad Gateway';
const STATUS_MESSAGE_503 = 'Service Unavailable';
const STATUS_MESSAGE_504 = 'Gateway Time-out';
const STATUS_MESSAGE_505 = 'HTTP Version not supported';
const STATUS_MESSAGE_506 = 'Variant Also Negotiates';
const STATUS_MESSAGE_507 = 'Insufficient Storage';
const STATUS_MESSAGE_508 = 'Loop Detected';
const STATUS_MESSAGE_509 = 'Bandwidth Limit Exceeded';
const STATUS_MESSAGE_510 = 'Not Extended';

/**
* @param string $protocolVersion
* @param int $statusCode
Expand Down

0 comments on commit 4ecf38b

Please sign in to comment.