Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct($base_uri, array $options = [], \GuzzleHttp\Client $

$this->options = $options;

$this->client = (!empty($http_client))? $http_client: new \GuzzleHttp\Client($this->getOptions());
$this->client = (!empty($http_client)) ? $http_client : new \GuzzleHttp\Client($this->getOptions());
}

/**
Expand All @@ -38,7 +38,7 @@ public function endpoint($endpoint)
{
$endpoint = /** @scrutinizer ignore-call */ Psr7\uri_for($endpoint);

if ($endpoint->isAbsolute($endpoint)){
if ($endpoint->isAbsolute($endpoint)) {
throw new \Exception("Endpoint must be a relative path");
}

Expand All @@ -55,7 +55,7 @@ protected function getOptions()
'base_uri' => $this->base_uri,
'http_errors' => true,
'headers' => ['Accept' => 'application/json']
],$this->options);
], $this->options);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Hydrator/ClassHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function hydrateResource(Resource $resource, Document $document, array &
*/
private function getObjectFromMap($type, $id, array $resourceMap)
{
return !empty($resourceMap[$type . "-" . $id])?$resourceMap[$type . "-" . $id]:null;
return !empty($resourceMap[$type . "-" . $id]) ? $resourceMap[$type . "-" . $id] : null;
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ protected function buildQuery()

if (!empty($this->filters)) {
foreach ($this->filters as $resource => $columns) {
if(is_array($columns)){
if (is_array($columns)) {
foreach ($columns as $column => $operands) {
foreach ($operands as $operand => $value) {
$query['filter'][$resource][$column][$operand] = is_array($value) ? implode(',',
$value) : $value;
}
}
}
else{
} else{
$query['filter'][$resource] = $columns;
}
}
Expand Down