PHP Class Icicle\Http\Message\BasicResponse

Inheritance: extends AbstractMessage, implements Icicle\Http\Message\Response
Exibir arquivo Open project: icicleio/http Class Usage Examples

Public Methods

Method Description
__construct ( integer $code = 200, array $headers = [], Icicle\Stream\ReadableStream $stream = null, string $reason = null, string $protocol = '1.1' )
getCookie ( string $name )
getCookies ( ) : array
getReasonPhrase ( ) : string
getStatusCode ( ) : integer
hasCookie ( string $name ) : boolean
withAddedHeader ( string $name, $value ) : Icicle\Http\Message\Message
withCookie ( string $name, $value = '', integer $expires, string $path = null, string $domain = null, boolean $secure = false, boolean $httpOnly = false ) : Icicle\Http\Message\Response
withHeader ( string $name, $value ) : Icicle\Http\Message\Message
withStatus ( integer $code, string $reason = null ) : Icicle\Http\Message\Response
withoutCookie ( string $name ) : Icicle\Http\Message\Response
withoutHeader ( string $name ) : Icicle\Http\Message\Message

Protected Methods

Method Description
filterReason ( string $reason = null ) : string
validateStatusCode ( integer $code ) : integer

Private Methods

Method Description
setCookiesFromHeaders ( ) Sets cookies based on headers.
setHeadersFromCookies ( ) Sets headers based on cookie values.

Method Details

__construct() public method

public __construct ( integer $code = 200, array $headers = [], Icicle\Stream\ReadableStream $stream = null, string $reason = null, string $protocol = '1.1' )
$code integer Status code.
$headers array
$stream Icicle\Stream\ReadableStream
$reason string Status code reason.
$protocol string

filterReason() protected method

protected filterReason ( string $reason = null ) : string
$reason string
return string

getCookie() public method

public getCookie ( string $name )
$name string

getCookies() public method

public getCookies ( ) : array
return array

getReasonPhrase() public method

public getReasonPhrase ( ) : string
return string

getStatusCode() public method

public getStatusCode ( ) : integer
return integer

hasCookie() public method

public hasCookie ( string $name ) : boolean
$name string
return boolean

validateStatusCode() protected method

protected validateStatusCode ( integer $code ) : integer
$code integer
return integer

withAddedHeader() public method

public withAddedHeader ( string $name, $value ) : Icicle\Http\Message\Message
$name string
return Icicle\Http\Message\Message

withCookie() public method

public withCookie ( string $name, $value = '', integer $expires, string $path = null, string $domain = null, boolean $secure = false, boolean $httpOnly = false ) : Icicle\Http\Message\Response
$name string
$expires integer
$path string
$domain string
$secure boolean
$httpOnly boolean
return Icicle\Http\Message\Response

withHeader() public method

public withHeader ( string $name, $value ) : Icicle\Http\Message\Message
$name string
return Icicle\Http\Message\Message

withStatus() public method

public withStatus ( integer $code, string $reason = null ) : Icicle\Http\Message\Response
$code integer
$reason string
return Icicle\Http\Message\Response

withoutCookie() public method

public withoutCookie ( string $name ) : Icicle\Http\Message\Response
$name string
return Icicle\Http\Message\Response

withoutHeader() public method

public withoutHeader ( string $name ) : Icicle\Http\Message\Message
$name string
return Icicle\Http\Message\Message