Art-of-WiFi / UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API
MIT License
1.09k stars 217 forks source link

Breaking change… NULL no longer allowed for version number #214

Closed pbksol closed 4 months ago

pbksol commented 4 months ago

I tend to bet that almost every "new UniFi_API\Client…" contains a NULL as parameter for $version.

With version 1.1.84 this will now result in an error because to wrong data type is given.

The changelog only gives a slight hint with "parameter type hinting" – so be careful and prepare to modify your existing scripts.

malle-pietje commented 4 months ago

The README has been updated to warn you, also the commits do mention the changes. That being said, this is a necessary step to make the class more robust, and make the coding style more consistent. Reports like this are important to get things right asap.

Keep in mind there are a few additional changes that need to be applied and tested that are related to too strict return types which will be pushed tomorrow.

malle-pietje commented 4 months ago

Okay, v1.1.85 now allows null values for the $site and $version parameters in the constructor. Hope this helps 😉

In all other methods I have kept the parameter type hinting as it was in v1.1.84. If there are any errors caused by incorrect type hinting, please report them in the Issues section.

pbksol commented 4 months ago

That was primary meant as a PSA ;-) – people tend to not read readme files.

Thanks for the compatibility modification 👍

malle-pietje commented 4 months ago

Thanks, and you're welcome 👍