SendCloud / SendCloud-API-PHP-Wrapper

Official SendCloud API PHP Wrapper
MIT License
15 stars 12 forks source link

JSON Object returns now also Previous and Next in array when using: $api->parcels->get #18

Open marcdelange12345 opened 6 years ago

marcdelange12345 commented 6 years ago

JSON Object returns now also Previous and Next in array when using: $api->parcels->get Due to the array_shift only the first part of the array is added to the response, which is are not the Parcels anymore.

Used reversed so that after Next and Previous will be removed it also will work.

Quick and very dirty fix: Old: if (!empty($return_object)) { //reversed by Marc due to a bug. $response_body = array_reverse($response_body); $response_body = array_shift($response_body); } New: if (!empty($return_object)) { //reversed by Marc due to a change. $response_body = array_reverse($response_body); $response_body = array_shift($response_body); }