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
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