Cheetah
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OAuth2\Response Class Reference
Inheritance diagram for OAuth2\Response:
OAuth2\ResponseInterface

Public Member Functions

 __construct ($parameters=array(), $statusCode=200, $headers=array())
 
 __toString ()
 
 getStatusCode ()
 
 setStatusCode ($statusCode, $text=null)
 
 getStatusText ()
 
 getParameters ()
 
 setParameters (array $parameters)
 
 addParameters (array $parameters)
 
 getParameter ($name, $default=null)
 
 setParameter ($name, $value)
 
 setHttpHeaders (array $httpHeaders)
 
 setHttpHeader ($name, $value)
 
 addHttpHeaders (array $httpHeaders)
 
 getHttpHeaders ()
 
 getHttpHeader ($name, $default=null)
 
 getResponseBody ($format='json')
 
 send ($format='json')
 
 setError ($statusCode, $error, $errorDescription=null, $errorUri=null)
 
 setRedirect ($statusCode, $url, $state=null, $error=null, $errorDescription=null, $errorUri=null)
 
 isInvalid ()
 
 isInformational ()
 
 isSuccessful ()
 
 isRedirection ()
 
 isClientError ()
 
 isServerError ()
 
- Public Member Functions inherited from OAuth2\ResponseInterface
 setStatusCode ($statusCode)
 
 getParameter ($name)
 

Public Attributes

 $version
 

Static Public Attributes

static $statusTexts
 

Protected Member Functions

 buildHeader ($name, $value)
 

Protected Attributes

 $statusCode = 200
 
 $statusText
 
 $parameters = array()
 
 $httpHeaders = array()
 

Detailed Description

Class to handle OAuth2 Responses in a graceful way. Use this interface to output the proper OAuth2 responses.

See also
OAuth2\ResponseInterface

This class borrows heavily from the Symfony2 Framework and is part of the symfony package

See also
Symfony\Component\HttpFoundation\Request (https://github.com/symfony/symfony)

Definition at line 14 of file Response.php.

Constructor & Destructor Documentation

◆ __construct()

OAuth2\Response::__construct (   $parameters = array(),
  $statusCode = 200,
  $headers = array() 
)

Definition at line 66 of file Response.php.

Member Function Documentation

◆ __toString()

OAuth2\Response::__toString ( )

Converts the response object to string containing all headers and the response content.

Returns
string The response with headers and content

Definition at line 79 of file Response.php.

◆ addHttpHeaders()

OAuth2\Response::addHttpHeaders ( array  $httpHeaders)

Implements OAuth2\ResponseInterface.

Definition at line 160 of file Response.php.

◆ addParameters()

OAuth2\Response::addParameters ( array  $parameters)

Implements OAuth2\ResponseInterface.

Definition at line 135 of file Response.php.

◆ buildHeader()

OAuth2\Response::buildHeader (   $name,
  $value 
)
protected

Returns the build header line.

Parameters
string$nameThe header name
string$valueThe header value
Returns
string The built header line

Definition at line 100 of file Response.php.

◆ getHttpHeader()

OAuth2\Response::getHttpHeader (   $name,
  $default = null 
)

Definition at line 170 of file Response.php.

◆ getHttpHeaders()

OAuth2\Response::getHttpHeaders ( )

Definition at line 165 of file Response.php.

◆ getParameter()

OAuth2\Response::getParameter (   $name,
  $default = null 
)

Definition at line 140 of file Response.php.

◆ getParameters()

OAuth2\Response::getParameters ( )

Definition at line 125 of file Response.php.

◆ getResponseBody()

OAuth2\Response::getResponseBody (   $format = 'json')

Definition at line 175 of file Response.php.

◆ getStatusCode()

OAuth2\Response::getStatusCode ( )

Definition at line 105 of file Response.php.

◆ getStatusText()

OAuth2\Response::getStatusText ( )

Definition at line 120 of file Response.php.

◆ isClientError()

OAuth2\Response::isClientError ( )
Returns
Boolean

@api

Definition at line 324 of file Response.php.

◆ isInformational()

OAuth2\Response::isInformational ( )
Returns
Boolean

@api

Definition at line 294 of file Response.php.

◆ isInvalid()

OAuth2\Response::isInvalid ( )
Returns
Boolean

@api

Definition at line 284 of file Response.php.

◆ isRedirection()

OAuth2\Response::isRedirection ( )
Returns
Boolean

@api

Definition at line 314 of file Response.php.

◆ isServerError()

OAuth2\Response::isServerError ( )
Returns
Boolean

@api

Definition at line 334 of file Response.php.

◆ isSuccessful()

OAuth2\Response::isSuccessful ( )
Returns
Boolean

@api

Definition at line 304 of file Response.php.

◆ send()

OAuth2\Response::send (   $format = 'json')

Definition at line 194 of file Response.php.

◆ setError()

OAuth2\Response::setError (   $statusCode,
  $error,
  $errorDescription = null,
  $errorUri = null 
)

Implements OAuth2\ResponseInterface.

Definition at line 218 of file Response.php.

◆ setHttpHeader()

OAuth2\Response::setHttpHeader (   $name,
  $value 
)

Definition at line 155 of file Response.php.

◆ setHttpHeaders()

OAuth2\Response::setHttpHeaders ( array  $httpHeaders)

Definition at line 150 of file Response.php.

◆ setParameter()

OAuth2\Response::setParameter (   $name,
  $value 
)

Definition at line 145 of file Response.php.

◆ setParameters()

OAuth2\Response::setParameters ( array  $parameters)

Definition at line 130 of file Response.php.

◆ setRedirect()

OAuth2\Response::setRedirect (   $statusCode,
  $url,
  $state = null,
  $error = null,
  $errorDescription = null,
  $errorUri = null 
)

Implements OAuth2\ResponseInterface.

Definition at line 246 of file Response.php.

◆ setStatusCode()

OAuth2\Response::setStatusCode (   $statusCode,
  $text = null 
)

Definition at line 110 of file Response.php.

Member Data Documentation

◆ $httpHeaders

OAuth2\Response::$httpHeaders = array()
protected

Definition at line 20 of file Response.php.

◆ $parameters

OAuth2\Response::$parameters = array()
protected

Definition at line 19 of file Response.php.

◆ $statusCode

OAuth2\Response::$statusCode = 200
protected

Definition at line 17 of file Response.php.

◆ $statusText

OAuth2\Response::$statusText
protected

Definition at line 18 of file Response.php.

◆ $statusTexts

OAuth2\Response::$statusTexts
static

Definition at line 22 of file Response.php.

◆ $version

OAuth2\Response::$version

Definition at line 16 of file Response.php.


The documentation for this class was generated from the following file: