Skip to content

Commit

Permalink
fix order of params because optional parameter should be last (#26)
Browse files Browse the repository at this point in the history
* fix order of params because optional parameter should be last

* fix indentation
  • Loading branch information
mtreuberg authored May 2, 2024
1 parent e8539b7 commit 662a72b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Request/FluentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function execute() {
default:
throw new \Exception("No appropriate HTTP method found for this request.");
}

return $this->handleResponse($response);
}

Expand All @@ -134,16 +134,16 @@ public function execute() {
*/
protected function executeFileUpload(string $route, string $filepath) {
$endpointUrl = $this->endpointUri."/".$route;

$this->options[CURLOPT_HTTPHEADER][] = "Api-Key:".$this->credentials->getApiKey();

$webHelper = new WebHelper($this->container);

$response = $webHelper->putImageRequest($endpointUrl,
$this->requestDetails,
$this->options,
$filepath);
$filepath,
$this->options);

return $this->handleResponse($response);
}

Expand Down Expand Up @@ -193,4 +193,4 @@ public function withCustomParameter(string $name, string $value) {
*/
abstract protected function getRoute();
}
}
}
4 changes: 2 additions & 2 deletions src/Request/WebHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ public function put($endpoint, $queryParams, array $options = array(), array $da
* Send a PUT requst using cURL
* @param string $url to request
* @param array $queryParams values to send
* @param array $options for cURL
* @param string $filepath of image to add
* @param array $options for cURL
* @return string
*/
public function putImageRequest($endpoint, $queryParams, array $options = array(), string $filepath) {
public function putImageRequest($endpoint, $queryParams, string $filepath, array $options = array()) {

$image = fopen($filepath, "rb");

Expand Down

0 comments on commit 662a72b

Please sign in to comment.