Added json data type

This commit is contained in:
Filip Znachor 2024-01-27 11:31:41 +01:00
parent 8b75dbf929
commit b5fc2b263b

View file

@ -20,6 +20,11 @@ class Parser {
"bool" => function ($input) {
if ($input == null) return null;
return !in_array($input, ["0", "false"]);
},
"json" => function ($input) {
if ($input == null) return null;
$json = json_decode($input);
return is_array($json) ? $json : null;
}
];
}