Commit 696d6e26 authored by dbourdere's avatar dbourdere 🤠

pass callback directly in function

parent 137b7f48
......@@ -35,7 +35,7 @@ class JsonSerializer
public static function stringify($object)
{
$array = self::getInstance()->normalize($object);
$arrayfiltered = self::array_filter_recursive($array, 'self::is_notnull');
$arrayfiltered = self::array_filter_recursive($array, function($v){return $v !== null;});
$object = json_encode($arrayfiltered);
return $object;
}
......@@ -53,7 +53,4 @@ class JsonSerializer
return array_filter($input, $callback);
}
public static function is_notnull($v) {
return !is_null($v);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment