summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php')
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php88
1 files changed, 88 insertions, 0 deletions
diff --git a/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php b/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php
new file mode 100644
index 0000000..7c50e58
--- /dev/null
+++ b/Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php
@@ -0,0 +1,88 @@
+<?php
+
+namespace Http\Message\Decorator;
+
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\UriInterface;
+
+/**
+ * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
+ */
+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();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withRequestTarget($requestTarget)
+ {
+ $new = clone $this;
+ $new->message = $this->message->withRequestTarget($requestTarget);
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMethod()
+ {
+ return $this->message->getMethod();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withMethod($method)
+ {
+ $new = clone $this;
+ $new->message = $this->message->withMethod($method);
+
+ return $new;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getUri()
+ {
+ return $this->message->getUri();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withUri(UriInterface $uri, $preserveHost = false)
+ {
+ $new = clone $this;
+ $new->message = $this->message->withUri($uri, $preserveHost);
+
+ return $new;
+ }
+}