Skip to content

Commit

Permalink
Fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
prwater committed Apr 28, 2020
1 parent e6139c7 commit a4ccfc2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Endpoint/Endpoint.php
Expand Up @@ -69,6 +69,10 @@ protected function restDelete(array $path, ?array $query = null): void
protected function restGet(array $path, ?array $query = null): BaseResource
{
$result = $this->client->performHttpCall(ClubCollectApiClient::HTTP_GET, $path, $query);
if ($result===null)
{
throw new ClubCollectApiException('Null response received from ClubCollect');
}

return $this->createResourceObject($result);
}
Expand All @@ -89,6 +93,11 @@ protected function restGetList(string $key, array $path, ?array $query = null):
{
$list = [];
$result = $this->client->performHttpCall(ClubCollectApiClient::HTTP_GET, $path, $query);
if ($result===null)
{
throw new ClubCollectApiException('Null response received from ClubCollect');
}

foreach ($result[$key] as $import)
{
$list[] = $this->createResourceObject($import);
Expand Down Expand Up @@ -121,6 +130,10 @@ protected function restGetPages(string $key, ?int $from, ?int $to, array $path,

$query['page_number'] = $page;
$result = $this->client->performHttpCall(ClubCollectApiClient::HTTP_GET, $path, $query);
if ($result===null)
{
throw new ClubCollectApiException('Null response received from ClubCollect');
}

foreach ($result[$key] as $import)
{
Expand Down Expand Up @@ -167,6 +180,10 @@ protected function restPost(array $path, ?array $query = null, ?array $body = nu
protected function restPut(array $path, ?array $query = null, ?array $body = null): BaseResource
{
$result = $this->client->performHttpCall(ClubCollectApiClient::HTTP_PUT, $path, $query, $body);
if ($result===null)
{
throw new ClubCollectApiException('Null response received from ClubCollect');
}

return $this->createResourceObject($result);
}
Expand Down

0 comments on commit a4ccfc2

Please sign in to comment.