Skip to content

Commit

Permalink
Prepared requests should send through the original request
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Sep 12, 2018
1 parent ccd0bf2 commit 621e613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 4 additions & 2 deletions src/Interfaces/ApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 621e613

Please sign in to comment.