DivideBV / Postnl

Library to connect to PostNL's SOAP service called CIF
GNU General Public License v2.0
31 stars 40 forks source link

Fix issues with SOAP_SINGLE_ELEMENT_ARRAYS #32

Closed slokhorst closed 6 years ago

slokhorst commented 8 years ago

This should fix issues where SOAP arrays with a single element are not created as arrays.

Untested, please test and do not merge yet!

ameenross commented 8 years ago

I found a better (canonical) reference of the functionality of that flag: https://bugs.php.net/bug.php?id=36226

slokhorst commented 8 years ago

This seems to do the trick. I've tested all Barcode, Labelling and Confirming functions and they seem to work. I don't have access to other services but I don't think that this will cause any problems, as we don't do any processing of their return values.

ameenross commented 8 years ago

as we don't do any processing of their return values.

What if someone who uses the lib does, and expects a single value where it will now be an array?

ameenross commented 8 years ago

For example, someone could have done $result->getLabels()->getLabel()->getContent() instead of my example in the README using a foreach loop on $result->getLabels(). Unfortunately this is a backward compatibility breaking change.

ameenross commented 8 years ago

So I just fixed the pertinent issue and released 1.0.2. We can go this direction and release 2.0.0 later.

ameenross commented 6 years ago

Closed because it didn't apply anymore and redoing it was easy enough

ameenross commented 5 years ago

For example, someone could have done $result->getLabels()->getLabel()->getContent()

Lol, this actually just happened... https://github.com/DivideBV/Postnl/issues/72