Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Fallback Values on Bad Response #31

Merged
merged 1 commit into from
Dec 3, 2024
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
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
Loading