Skip to content

Commit

Permalink
fix params in client send and jsonResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Miotello committed Jan 12, 2023
1 parent 7515e57 commit 888d7a2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/VeeamSPCClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
use Shellrent\VeeamVspcApiClient\Support\Filter;
use Shellrent\VeeamVspcApiClient\Support\FilterCollection;
use Shellrent\VeeamVspcApiClient\Support\RequestBuilder;

class VeeamSPCClient {
Expand Down Expand Up @@ -49,7 +50,15 @@ protected function getOptions(): array {
return array_merge( $this->Options, $additions );
}

public function send( RequestBuilder $requestBuilder, ?Filter $filter = null, ?array $queryParams = null ) {
/**
* @param RequestBuilder $requestBuilder
* @param null|Filter|FilterCollection $filter
* @param array|null $queryParams
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @return \Psr\Http\Message\ResponseInterface
*/
public function send( RequestBuilder $requestBuilder, $filter = null, ?array $queryParams = null ) {
if ( $filter ) {
$requestBuilder->filter( $filter );
}
Expand All @@ -61,7 +70,15 @@ public function send( RequestBuilder $requestBuilder, ?Filter $filter = null, ?a
return $this->Client->send( $requestBuilder->buildRequest(), $this->getOptions() );
}

public function jsonResponse( RequestBuilder $requestBuilder, ?Filter $filter = null, ?array $queryParams = null ) {
/**
* @param RequestBuilder $requestBuilder
* @param null|Filter|FilterCollection $filter
* @param array|null $queryParams
*
* @throws \GuzzleHttp\Exception\GuzzleException
* @return mixed
*/
public function jsonResponse( RequestBuilder $requestBuilder, $filter = null, ?array $queryParams = null ) {
if ( $filter ) {
$requestBuilder->filter( $filter );
}
Expand Down

0 comments on commit 888d7a2

Please sign in to comment.