sajari / sdk-php

Official repository of the Search.io SDK for PHP
https://www.search.io
MIT License
8 stars 1 forks source link

Specifying an empty array for transforms should be possible. #26

Closed dhowden closed 7 years ago

dhowden commented 7 years ago

Currently you can't specify an empty array for transforms, it should be possible.

https://github.com/sajari/sajari-sdk-php/blob/master/src/Sajari/Client/Client.php#L211

Not sure how you can get around this in PHP though? Maybe just check isset instead of also checking count (and remove the default [] value).

tbillington commented 7 years ago

Fixed by using null as the default so that we can distinguish between an intentional empty array and nothing being passed.

https://github.com/sajari/sajari-sdk-php/commit/ed5263141a03bb78b37d2a12013f3ec719ab86eb