PHP Class Zend\Stratigility\Http\Response

Adds in write, end, and isComplete from RequestInterface in order to provide a common interface for all PSR HTTP implementations.
Inheritance: implements Psr\Http\Message\ResponseInterface, implements Zend\Stratigility\Http\ResponseInterface
Show file Open project: zendframework/zend-stratigility Class Usage Examples

Public Methods

Method Description
__construct ( Psr\Http\Message\ResponseInterface $response )
end ( string $data = null ) : self Mark the response as complete
getBody ( ) Proxy to PsrResponseInterface::getBody()
getHeader ( $header ) Proxy to PsrResponseInterface::getHeader()
getHeaderLine ( $header ) Proxy to PsrResponseInterface::getHeaderLine()
getHeaders ( ) Proxy to PsrResponseInterface::getHeaders()
getOriginalResponse ( ) : Psr\Http\Message\ResponseInterface Return the original PSR response object
getProtocolVersion ( ) Proxy to PsrResponseInterface::getProtocolVersion()
getReasonPhrase ( ) Proxy to PsrResponseInterface::getReasonPhrase()
getStatusCode ( ) Proxy to PsrResponseInterface::getStatusCode()
hasHeader ( $header ) Proxy to PsrResponseInterface::hasHeader()
isComplete ( ) : boolean Indicate whether or not the response is complete.
withAddedHeader ( $header, $value ) Proxy to PsrResponseInterface::withAddedHeader()
withBody ( Psr\Http\Message\StreamInterface $body ) Proxy to PsrResponseInterface::withBody()
withHeader ( $header, $value ) Proxy to PsrResponseInterface::withHeader()
withProtocolVersion ( $version ) Proxy to PsrResponseInterface::withProtocolVersion()
withStatus ( $code, $reasonPhrase = null ) Proxy to PsrResponseInterface::withStatus()
withoutHeader ( $header ) Proxy to PsrResponseInterface::withoutHeader()
write ( string $data ) : self Write data to the response body

Private Methods

Method Description
responseIsAlreadyCompleted ( string $detectedInMethod ) : RuntimeExceptio\RuntimeException

Method Details

__construct() public method

public __construct ( Psr\Http\Message\ResponseInterface $response )
$response Psr\Http\Message\ResponseInterface

end() public method

A completed response should no longer allow manipulation of either headers or the content body. If $data is passed, that data should be written to the response body prior to marking the response as complete.
public end ( string $data = null ) : self
$data string
return self

getBody() public method

public getBody ( )

getHeader() public method

public getHeader ( $header )

getHeaderLine() public method

public getHeaderLine ( $header )

getHeaders() public method

public getHeaders ( )

getOriginalResponse() public method

Return the original PSR response object
public getOriginalResponse ( ) : Psr\Http\Message\ResponseInterface
return Psr\Http\Message\ResponseInterface

getProtocolVersion() public method

public getProtocolVersion ( )

getReasonPhrase() public method

public getReasonPhrase ( )

getStatusCode() public method

public getStatusCode ( )

hasHeader() public method

public hasHeader ( $header )

isComplete() public method

I.e., if end() has previously been called.
public isComplete ( ) : boolean
return boolean

withAddedHeader() public method

public withAddedHeader ( $header, $value )

withBody() public method

public withBody ( Psr\Http\Message\StreamInterface $body )
$body Psr\Http\Message\StreamInterface

withHeader() public method

public withHeader ( $header, $value )

withProtocolVersion() public method

public withProtocolVersion ( $version )

withStatus() public method

public withStatus ( $code, $reasonPhrase = null )

withoutHeader() public method

public withoutHeader ( $header )

write() public method

Proxies to the underlying stream and writes the provided data to it.
public write ( string $data ) : self
$data string
return self