Add support for manipulating empty json files

main
Jordi Boggiano 10 years ago
parent af6ef235e1
commit 534bd64cd1

@ -34,6 +34,9 @@ class JsonManipulator
}
$contents = trim($contents);
if ($contents === '') {
$contents = '{}';
}
if (!$this->pregMatch('#^\{(.*)\}$#s', $contents)) {
throw new \InvalidArgumentException('The json file must be an object ({})');
}

Loading…
Cancel
Save