Response
Class to handle OAuth2 Responses in a graceful way. Use this interface to output the proper OAuth2 responses.
- Full name:
\OAuth2\Response
- This class implements:
\OAuth2\ResponseInterface
See Also:
- \OAuth2\OAuth2\ResponseInterface - This class borrows heavily from the Symfony2 Framework and is part of the symfony package
- \OAuth2\Symfony\Component\HttpFoundation\Request - (https://github.com/symfony/symfony)
Properties
version
statusCode
statusText
parameters
httpHeaders
statusTexts
- This property is static.
Methods
__construct
public __construct(array $parameters = array(), int $statusCode = 200, array $headers = array()): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$parameters |
array | |
$statusCode |
int | |
$headers |
array |
__toString
Converts the response object to string containing all headers and the response content.
Return Value:
The response with headers and content
buildHeader
Returns the build header line.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | The header name |
$value |
string | The header value |
Return Value:
The built header line
getStatusCode
setStatusCode
Parameters:
Parameter | Type | Description |
---|---|---|
$statusCode |
int | |
$text |
string |
Throws:
getStatusText
getParameters
setParameters
Parameters:
Parameter | Type | Description |
---|---|---|
$parameters |
array |
addParameters
Parameters:
Parameter | Type | Description |
---|---|---|
$parameters |
array |
getParameter
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | |
$default |
mixed |
setParameter
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | |
$value |
mixed |
setHttpHeaders
Parameters:
Parameter | Type | Description |
---|---|---|
$httpHeaders |
array |
setHttpHeader
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | |
$value |
mixed |
addHttpHeaders
Parameters:
Parameter | Type | Description |
---|---|---|
$httpHeaders |
array |
getHttpHeaders
getHttpHeader
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | |
$default |
mixed |
getResponseBody
Parameters:
Parameter | Type | Description |
---|---|---|
$format |
string |
Throws:
send
Parameters:
Parameter | Type | Description |
---|---|---|
$format |
string |
setError
public setError(int $statusCode, string $error, string $errorDescription = null, string $errorUri = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$statusCode |
int | |
$error |
string | |
$errorDescription |
string | |
$errorUri |
string |
Throws:
setRedirect
public setRedirect(int $statusCode, string $url, string $state = null, string $error = null, string $errorDescription = null, string $errorUri = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$statusCode |
int | |
$url |
string | |
$state |
string | |
$error |
string | |
$errorDescription |
string | |
$errorUri |
string |
Throws:
isInvalid
See Also:
- http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html -
isInformational
isSuccessful
isRedirection
isClientError
isServerError
getHttpHeadersAsString
Function from Symfony2 HttpFoundation - output pretty header
Parameters:
Parameter | Type | Description |
---|---|---|
$headers |
array |
beautifyHeaderName
Function from Symfony2 HttpFoundation - output pretty header
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string |
beautifyCallback
Function from Symfony2 HttpFoundation - output pretty header
Parameters:
Parameter | Type | Description |
---|---|---|
$match |
array |
Automatically generated on 2025-03-18