Skip to content

Commit 54c8d21

Browse files
committed
fix no content result
1 parent 704ce6e commit 54c8d21

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Client/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function execute(): ResponseInterface
4545
$responseInfo = curl_getinfo($this->curlResource);
4646
$responseCode = curl_getinfo($this->curlResource, CURLINFO_HTTP_CODE);
4747
$headerSize = curl_getinfo($this->curlResource, CURLINFO_HEADER_SIZE);
48-
$body = json_decode(mb_substr($response, $headerSize), true);
48+
$body = json_decode(mb_substr($response, $headerSize), true) ?: [];
4949
curl_close($this->curlResource);
5050

5151
if (!$responseInfo || $responseCode >= 400) {

src/Model/AbstractDataObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ final public function toJson(): string
3838

3939
final public function getEntityId(): ?int
4040
{
41-
return $this->data[$this->entityIdFieldName] ?? null;
41+
return isset($this->data[$this->entityIdFieldName]) ? (int) $this->data[$this->entityIdFieldName] : null;
4242
}
4343
}

src/Model/ListCriteriaBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function create(): ListCriteriaInterface
7979
$this->data['limit'] ?? null,
8080
$this->data['sortBy'] ?? null,
8181
$this->data['sortOrder'] ?? null,
82-
$this->data['viewId'] ?? null,
82+
$this->data['viewId'] ?? null
8383
);
8484
$this->data = [];
8585

0 commit comments

Comments
 (0)