for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Http\Message\Decorator;
use Psr\Http\Message\ResponseInterface;
/**
* @author Márk Sági-Kazár <[email protected]>
*/
trait ResponseDecorator
{
use MessageDecorator {
getMessage as getResponse;
}
* Exchanges the underlying response with another.
*
* @param ResponseInterface $response
* @return self
public function withResponse(ResponseInterface $response)
$new = clone $this;
$new->message = $response;
return $new;
* {@inheritdoc}
public function getStatusCode()
return $this->message->getStatusCode();
public function withStatus($code, $reasonPhrase = '')
$new->message = $this->message->withStatus($code, $reasonPhrase);
public function getReasonPhrase()
return $this->message->getReasonPhrase();