for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TusPhp;
class Json {
public static function decodeOrEmptyArray($string) {
$decoded = json_decode($string, true);
return $decoded === null ? [] : $decoded;
}