JustSteveKing / laravel-envoyer-sdk

A simple to use PHP class to work with the Laravel Envoyer API
MIT License
36 stars 15 forks source link

Array returned instead of object on invalid environment set reponse #7

Open ghost opened 3 years ago

ghost commented 3 years ago

An array is returned instead of the expected object:

TypeError: Return value of JustSteveKing\Laravel\Envoyer\SDK\Resources\Environment::put() must be an object or null, array returned in /Users/user/Sites/project/vendor/juststeveking/laravel-envoyer-sdk/src/Resources/Environment.php:60

This happens when the API returns an error, To reproduce it all you have to do is send some invalid data :). I'm not sure why though, because json_decode should return an object like it is in the code.

I think this is happening with most requests, it looks like the exact same message in issue #3

JustSteveKing commented 2 years ago

👀 this is weird.

I will look into this, now we have a PHP 8 release I can declare multiple return types to get around this issue.

Sorry for the delay, notifications seemed to be hidden right now