Skip to content

Commit

Permalink
Handle Fallback Values on Bad Response (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
onairmarc authored Dec 3, 2024
1 parent 25eadeb commit 223f641
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Objects/Calendar/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function tags(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Calendar/EventInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function get(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Calendar/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function all(array $query = []): ClientResponse
/** @internal */
public function mapFromPco(ClientResponse $clientResponse): void
{
$records = objectify($clientResponse->meta->response->json("data"));
$records = objectify($clientResponse->meta->response->json("data", []));

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Calendar/TagGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function tags(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function get(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function tags(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/GroupEnrollment.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function get(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/GroupMemberPerson.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function get(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/GroupMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function get(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function groups(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Groups/TagGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function tags(array $query = []): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/People/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function update(): ClientResponse

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

if (!is_iterable($records)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/People/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function delete(): ClientResponse
private function mapFromPco(ClientResponse $clientResponse): void
{
try {
$records = objectify($clientResponse->meta->response->json("data"));
$records = objectify($clientResponse->meta->response->json("data", []));
} catch (Exception|TypeError) {
return;
}
Expand Down

0 comments on commit 223f641

Please sign in to comment.