Update AbstractApi.php

This commit is contained in:
Tony Roy 2021-03-11 23:01:10 -04:00 committed by GitHub
commit 039733e9f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,33 +23,45 @@ abstract class AbstractApi implements ApiInterface
* @return mixed * @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException * @throws \GuzzleHttp\Exception\GuzzleException
*/ */
protected function post($parameters) protected function get($path, $parameters)
{ {
return $this->client->getHttpClient()->post(array_merge([ return $this->client->getHttpClient()->get($path, array_merge([
'api_key' => $this->client->getHttpClient()->getOptions()['key'] 'api_key' => $this->client->getHttpClient()->getOptions()['key']
], $parameters)); ], $parameters));
} }
/** /**
* @param array $parameters * @param array $parameters
* @return mixed * @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException * @throws \GuzzleHttp\Exception\GuzzleException
*/ */
protected function put($parameters) protected function post($path, $parameters)
{ {
return $this->client->getHttpClient()->put(array_merge([ return $this->client->getHttpClient()->post($path, array_merge([
'api_key' => $this->client->getHttpClient()->getOptions()['key'] 'api_key' => $this->client->getHttpClient()->getOptions()['key']
], $parameters)); ], $parameters));
} }
/** /**
* @param array $parameters * @param array $parameters
* @return mixed * @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException * @throws \GuzzleHttp\Exception\GuzzleException
*/ */
protected function delete($parameters) protected function put($path, $parameters)
{ {
return $this->client->getHttpClient()->delete(array_merge([ return $this->client->getHttpClient()->put($path, array_merge([
'api_key' => $this->client->getHttpClient()->getOptions()['key']
], $parameters));
}
/**
* @param array $parameters
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
protected function delete($path, $parameters)
{
return $this->client->getHttpClient()->delete($path, array_merge([
'api_key' => $this->client->getHttpClient()->getOptions()['key'] 'api_key' => $this->client->getHttpClient()->getOptions()['key']
], $parameters)); ], $parameters));
} }