summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php
diff options
context:
space:
mode:
Diffstat (limited to 'Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php')
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php b/Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php
new file mode 100644
index 0000000..dbec1ab
--- /dev/null
+++ b/Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Http\Client\Common;
+
+use Psr\Http\Message\RequestInterface;
+
+/**
+ * Emulates an HTTP Client in an HTTP Async Client.
+ *
+ * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
+ */
+trait HttpClientEmulator
+{
+ /**
+ * {@inheritdoc}
+ *
+ * @see HttpClient::sendRequest
+ */
+ public function sendRequest(RequestInterface $request)
+ {
+ $promise = $this->sendAsyncRequest($request);
+
+ return $promise->wait();
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @see HttpAsyncClient::sendAsyncRequest
+ */
+ abstract public function sendAsyncRequest(RequestInterface $request);
+}