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\RequestInterface;
use Psr\Http\Message\UriInterface;
/**
* @author Márk Sági-Kazár <[email protected]>
*/
trait RequestDecorator
{
use MessageDecorator {
getMessage as getRequest;
}
* Exchanges the underlying request with another.
*
* @param RequestInterface $request
* @return self
public function withRequest(RequestInterface $request)
$new = clone $this;
$new->message = $request;
return $new;
* {@inheritdoc}
public function getRequestTarget()
return $this->message->getRequestTarget();
public function withRequestTarget($requestTarget)
$new->message = $this->message->withRequestTarget($requestTarget);
public function getMethod()
return $this->message->getMethod();
public function withMethod($method)
$new->message = $this->message->withMethod($method);
public function getUri()
return $this->message->getUri();
public function withUri(UriInterface $uri, $preserveHost = false)
$new->message = $this->message->withUri($uri, $preserveHost);