5 use InvalidArgumentException;
52 throw new InvalidArgumentException(__METHOD__ .
' expects content as a scalar value or array');
70 throw new InvalidArgumentException(__METHOD__ .
' expects a valid HTTP status code');
88 throw new InvalidArgumentException(__METHOD__ .
' expects a valid URL or REFERRER');
120 return $this->status_code >= 100 && $this->status_code <= 199;
127 return $this->status_code >= 200 && $this->status_code <= 299;
134 return $this->status_code === 200;
141 return in_array($this->status_code, [201, 301, 302, 303, 307, 308]);
148 return $this->status_code >= 400 && $this->status_code <= 499;
155 return $this->status_code >= 500 && $this->status_code <= 599;
162 return $this->status_code === 304;
setHeaders(array $headers=[])
{Sets additional response headers.Headers self}
getContent()
{Returns response body.mixed}
isOk()
{Check if response is OK.bool}
isNotModified()
{Check if response has been modified.bool}
getStatusCode()
{Returns status code.int}
getForwardURL()
{Returns redirect URL.string}
isRedirection()
{Check if response is redirection.bool}
isClientError()
{Check if response is client error.bool}
getHeaders()
{Returns additional response headers.array}
isSuccessful()
{Check if response is successful.bool}
setForwardURL($forward_url=REFERRER)
{Sets redirect URL.Forward URL self }
setStatusCode($status_code=ELGG_HTTP_OK)
{Sets response HTTP status code.Status code self }
isInformational()
{Check if response is informational.bool}
__construct($content='', $status_code=ELGG_HTTP_OK, $forward_url=null)
Constructor.
isServerError()
{Check if response is server error.bool}
setContent($content='')
{Sets response body.Content of the response as a scalar value or an array self }
HTTP response builder interface.