intuit / QuickBooks-V3-PHP-SDK

Official PHP SDK for QuickBooks REST API v3.0: https://developer.intuit.com/
Apache License 2.0
243 stars 246 forks source link

fix: removeNullProperties should not filter out regular arrays #420

Open mgkimsal opened 3 years ago

mgkimsal commented 3 years ago

Existing removeNullProperties filtered out standard arrays, causing problems. Specifically, an $invoice object with $customerRef on it (with $customerRef['value']) was filtered out, causing "CustomerRef is missing" validation errors.

I added the count() check to ignore empty array values, which seems in spirit with the 'removeNull' intention.

Adding a test, based on the previously added testThatRemoveNullPropertiesLeavesNonNullValuesInPlace