PHP Class Raml\Response

See also: http://raml.org/spec.html#responses
Inheritance: implements raml\ArrayInstantiationInterface, implements raml\MessageSchemaInterface
Afficher le fichier Open project: alecsammon/php-raml-parser Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( integer $statusCode ) Create a new Response
addBody ( raml\BodyInterface $body ) Add a new body
addHeader ( raml\NamedParameter $header ) Add a new header
createFromArray ( string $statusCode, array $data = [] ) : Response Create a new response object from an array
getBodies ( ) : raml\BodyInterface[] Returns the list of bodies for this response type.
getBodyByType ( string $type ) : raml\BodyInterface Get the body by type
getDescription ( ) : string Returns the description
getHeaders ( ) : raml\NamedParameter[] Returns the headers
getStatusCode ( ) : integer Returns the status code
getTypes ( ) : array Returns all supported types in response
setDescription ( string $description ) Set the description

Method Details

__construct() public méthode

Create a new Response
public __construct ( integer $statusCode )
$statusCode integer

addBody() public méthode

Add a new body
public addBody ( raml\BodyInterface $body )
$body raml\BodyInterface

addHeader() public méthode

Add a new header
public addHeader ( raml\NamedParameter $header )
$header raml\NamedParameter

createFromArray() public static méthode

Create a new response object from an array
public static createFromArray ( string $statusCode, array $data = [] ) : Response
$statusCode string
$data array
Résultat Response

getBodies() public méthode

Returns the list of bodies for this response type.
public getBodies ( ) : raml\BodyInterface[]
Résultat raml\BodyInterface[]

getBodyByType() public méthode

Get the body by type
public getBodyByType ( string $type ) : raml\BodyInterface
$type string
Résultat raml\BodyInterface

getDescription() public méthode

Returns the description
public getDescription ( ) : string
Résultat string

getHeaders() public méthode

Returns the headers
public getHeaders ( ) : raml\NamedParameter[]
Résultat raml\NamedParameter[]

getStatusCode() public méthode

Returns the status code
public getStatusCode ( ) : integer
Résultat integer

getTypes() public méthode

Returns all supported types in response
public getTypes ( ) : array
Résultat array

setDescription() public méthode

Set the description
public setDescription ( string $description )
$description string