From 621e613ce1b5118e5e0c53bfd843d5a440303130 Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Wed, 12 Sep 2018 13:56:06 +0100 Subject: [PATCH] Prepared requests should send through the original request --- src/ApiRequest.php | 2 +- src/Interfaces/ApiInterface.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ApiRequest.php b/src/ApiRequest.php index e72c355..c6bbc18 100644 --- a/src/ApiRequest.php +++ b/src/ApiRequest.php @@ -28,7 +28,7 @@ public function get() { if($this->_promise) { - $this->_response = $this->getApi()->processPreparedRequest($this->_promise); + $this->_response = $this->getApi()->processPreparedRequest($this->_promise, $this); } else { diff --git a/src/Interfaces/ApiInterface.php b/src/Interfaces/ApiInterface.php index 5c581b3..c2fa68b 100644 --- a/src/Interfaces/ApiInterface.php +++ b/src/Interfaces/ApiInterface.php @@ -27,11 +27,13 @@ public function processRequest(ApiRequestInterface $request); public function prepareRequest(ApiRequestInterface $request); /** - * @param PromiseInterface $apiRequest + * @param PromiseInterface $apiRequest + * + * @param ApiRequestInterface|null $rawRequest * * @return \Packaged\Api\Interfaces\ApiResponseInterface */ - public function processPreparedRequest(PromiseInterface $apiRequest); + public function processPreparedRequest(PromiseInterface $apiRequest, ApiRequestInterface $rawRequest = null); /** * Bind this API to an instance