Skip to content

Commit 223f641

Browse files
authored
Handle Fallback Values on Bad Response (#31)
1 parent 25eadeb commit 223f641

File tree

13 files changed

+13
-13
lines changed

13 files changed

+13
-13
lines changed

src/Objects/Calendar/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function tags(array $query = []): ClientResponse
9494

9595
private function mapFromPco(ClientResponse $clientResponse): void
9696
{
97-
$records = objectify($clientResponse->meta->response->json("data"));
97+
$records = objectify($clientResponse->meta->response->json("data", []));
9898

9999
if (!is_iterable($records)) {
100100
return;

src/Objects/Calendar/EventInstance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function get(array $query = []): ClientResponse
8787

8888
private function mapFromPco(ClientResponse $clientResponse): void
8989
{
90-
$records = objectify($clientResponse->meta->response->json("data"));
90+
$records = objectify($clientResponse->meta->response->json("data", []));
9191

9292
if (!is_iterable($records)) {
9393
return;

src/Objects/Calendar/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function all(array $query = []): ClientResponse
4646
/** @internal */
4747
public function mapFromPco(ClientResponse $clientResponse): void
4848
{
49-
$records = objectify($clientResponse->meta->response->json("data"));
49+
$records = objectify($clientResponse->meta->response->json("data", []));
5050

5151
if (!is_iterable($records)) {
5252
return;

src/Objects/Calendar/TagGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function tags(array $query = []): ClientResponse
5353

5454
private function mapFromPco(ClientResponse $clientResponse): void
5555
{
56-
$records = objectify($clientResponse->meta->response->json("data"));
56+
$records = objectify($clientResponse->meta->response->json("data", []));
5757

5858
if (!is_iterable($records)) {
5959
return;

src/Objects/Groups/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function get(array $query = []): ClientResponse
6363

6464
private function mapFromPco(ClientResponse $clientResponse): void
6565
{
66-
$records = objectify($clientResponse->meta->response->json("data"));
66+
$records = objectify($clientResponse->meta->response->json("data", []));
6767

6868
if (!is_iterable($records)) {
6969
return;

src/Objects/Groups/Group.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function tags(array $query = []): ClientResponse
106106

107107
protected function mapFromPco(ClientResponse $clientResponse): void
108108
{
109-
$records = objectify($clientResponse->meta->response->json("data"));
109+
$records = objectify($clientResponse->meta->response->json("data", []));
110110

111111
if (!is_iterable($records)) {
112112
return;

src/Objects/Groups/GroupEnrollment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function get(array $query = []): ClientResponse
4949

5050
protected function mapFromPco(ClientResponse $clientResponse): void
5151
{
52-
$records = objectify($clientResponse->meta->response->json("data"));
52+
$records = objectify($clientResponse->meta->response->json("data", []));
5353

5454
if (!is_iterable($records)) {
5555
return;

src/Objects/Groups/GroupMemberPerson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function get(array $query = []): ClientResponse
5050

5151
protected function mapFromPco(ClientResponse $clientResponse): void
5252
{
53-
$records = objectify($clientResponse->meta->response->json("data"));
53+
$records = objectify($clientResponse->meta->response->json("data", []));
5454

5555
if (!is_iterable($records)) {
5656
return;

src/Objects/Groups/GroupMembership.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function get(array $query = []): ClientResponse
5454

5555
protected function mapFromPco(ClientResponse $clientResponse): void
5656
{
57-
$records = objectify($clientResponse->meta->response->json("data"));
57+
$records = objectify($clientResponse->meta->response->json("data", []));
5858

5959
if (!is_iterable($records)) {
6060
return;

src/Objects/Groups/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function groups(array $query = []): ClientResponse
5656

5757
protected function mapFromPco(ClientResponse $clientResponse): void
5858
{
59-
$records = objectify($clientResponse->meta->response->json("data"));
59+
$records = objectify($clientResponse->meta->response->json("data", []));
6060

6161
if (!is_iterable($records)) {
6262
return;

0 commit comments

Comments
 (0)