DivideBV / Postnl

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

GetNearestLocations method name inconsistency #48

Closed slokhorst closed 7 years ago

slokhorst commented 7 years ago

In the Location webservice, there is a function called GetNearestLocations. It is implemented in this library as GetNearestLocation (singular, without the 's'). This is quite confusing as (1) it returns multiple locations, and (2) people are likely to try the function from the documentation, which doesn't exist.

Is it okay if I fix this in a PR and create a GetNearestLocations function which wraps GetNearestLocation (to maintain backwards compatibility)? Or is this undesirable and should we consider this a non-issue (and I shouldn't complain 😛)?

ameenross commented 7 years ago

Oh yes, good catch. I fully agree.

Do it the other way around though: rename the function, then create a function with the old name, wrapping the correct function. And mark the wrapper deprecated in the docbloc. I'll be glad to merge it if you create a PR

The same should be done with the one in Postnl.php by the way.