json_decode returns null on error, not false
parent
9210500714
commit
cad0967788
|
@ -91,7 +91,7 @@ class JsonFile
|
|||
{
|
||||
$data = json_decode($json, true);
|
||||
|
||||
if (false === $data && 'false' !== $json) {
|
||||
if (null === $data && 'null' !== strtolower($json)) {
|
||||
switch (json_last_error()) {
|
||||
case JSON_ERROR_NONE:
|
||||
$msg = 'No error has occurred, is your composer.json file empty?';
|
||||
|
|
Loading…
Reference in New Issue