Added json data type
This commit is contained in:
parent
8b75dbf929
commit
b5fc2b263b
|
@ -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;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue