json-parser/helpers.php

17 lines
299 B
PHP
Raw Normal View History

2022-09-17 05:02:40 +02:00
<?php
use Cerbero\JsonParser\JsonParser;
if (!function_exists('parseJson')) {
/**
* Parse the given source of JSON
*
* @param mixed $source
2022-10-16 02:19:40 +02:00
* @return JsonParser
2022-09-17 05:02:40 +02:00
*/
2022-10-16 02:19:40 +02:00
function parseJson(mixed $source): JsonParser
2022-09-17 05:02:40 +02:00
{
return new JsonParser($source);
}
}