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
Afficher le fichier Open project: zendframework/zend-stratigility Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
responseIsAlreadyCompleted ( string $detectedInMethod ) : RuntimeExceptio\RuntimeException

Method Details

__construct() public méthode

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

end() public méthode

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
Résultat self

getBody() public méthode

public getBody ( )

getHeader() public méthode

public getHeader ( $header )

getHeaderLine() public méthode

public getHeaderLine ( $header )

getHeaders() public méthode

public getHeaders ( )

getOriginalResponse() public méthode

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

getProtocolVersion() public méthode

public getProtocolVersion ( )

getReasonPhrase() public méthode

public getReasonPhrase ( )

getStatusCode() public méthode

public getStatusCode ( )

hasHeader() public méthode

public hasHeader ( $header )

isComplete() public méthode

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

withAddedHeader() public méthode

public withAddedHeader ( $header, $value )

withBody() public méthode

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

withHeader() public méthode

public withHeader ( $header, $value )

withProtocolVersion() public méthode

public withProtocolVersion ( $version )

withStatus() public méthode

public withStatus ( $code, $reasonPhrase = null )

withoutHeader() public méthode

public withoutHeader ( $header )

write() public méthode

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