Skip to content

Commit

Permalink
Fix object to array implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Dobric committed Oct 24, 2019
1 parent a43e2d8 commit b77eed2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/DataService/ResourceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use ActiveCollab\Quickbooks\Data\QueryResponse;
use DateTime;
use Exception;
use QuickBooksOnline\API\Core\Http\Serialization\JsonObjectSerializer;
use QuickBooksOnline\API\DataService\DataService;
use QuickBooksOnline\API\Facades\FacadeHelper;

Expand Down Expand Up @@ -167,10 +166,10 @@ private function objectToArray($entity = null): array
return [];
}

$entity = is_array($entity) ? $entity[0] : $entity;

return json_decode(
(new JsonObjectSerializer())->Serialize($entity),
json_encode(
is_array($entity) ? $entity[0] : $entity
),
true
);
}
Expand Down

0 comments on commit b77eed2

Please sign in to comment.