Webador / sendcloud

Provides a PHP client to interact with the SendCloud API in an object-oriented way.
MIT License
16 stars 15 forks source link

3.8 breaks the parcel create #11

Closed roberthenniger closed 3 years ago

roberthenniger commented 3 years ago

Seems the signature of API function to create a parcel has changed. In my opinion this should not be included in a 3.8 release without a warning.

villermen commented 3 years ago

Previously written calls should function identically between 3.7 and 3.8 because all added arguments have defaults configured and still accept the same arguments. (https://github.com/JouwWeb/sendcloud/compare/v3.7.0...v3.8.0)

@roberthenniger If your code broke between these releases that's definitely unintended behavior. Could you provide me with an example of code that breaks between these versions? I'll see if I can provide a fix to the library.

roberthenniger commented 3 years ago

We were using ~3.4 in our composer (was too unspecific) and I am affraid I cant tell you which was our last working version. On my dev environment we use 3.4.x and it works fine. So I have to test the different versions and identify when it breaks.

It fails with the $shippingMethod must be an integer or ShippingMethod instance when requesting a label. exception. have to digg deeper

villermen commented 3 years ago

Did you by any change pass a string to $shippingMethodId of Client::createLabel()? I believe PHP will juggle that to an integer if it has an int type hint. Casting to (int) should be enough to fix that.

villermen commented 3 years ago

Closing due to lack of response.