rackspace / php-opencloud

The PHP SDK for OpenStack clouds
developer.rackspace.com
Other
451 stars 250 forks source link

Return null on empty json string in PHP7 #712

Open thomaslorentsen opened 7 years ago

thomaslorentsen commented 7 years ago

PHP7 no longer considers an empty string as valid JSON.

When passing an empty string to json_decode an exception is raised instead of returning null.

This is documented on the PHP7 Backward incompatible changes page.

I have updated the method to check for an empty response string and return null instead.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.006%) to 88.777% when pulling 07a84ab6a81c68942c78829aa11307ed6dea5903 on thomaslorentsen:working into ea17effa6b532a11c3e6593419653812417f8480 on rackspace:working.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.006%) to 88.777% when pulling 07a84ab6a81c68942c78829aa11307ed6dea5903 on thomaslorentsen:working into ea17effa6b532a11c3e6593419653812417f8480 on rackspace:working.