관리-도구
편집 파일: JSONUtil.php.tar
home/tattooscyy/test/app/Libs/Sdk/JSON/JSONUtil.php 0000604 00000001115 15224731054 0015755 0 ustar 00 <?php namespace App\Libs\Sdk\JSON; use stdClass; use UnexpectedValueException; /** * Class JSONUtil * * @package OnlinePayments\Sdk */ class JSONUtil { private function __construct() { } /** * @param string $value * @return stdClass * @throws UnexpectedValueException */ public static function decode(string $value): stdClass { $object = json_decode($value); if (json_last_error()) { throw new UnexpectedValueException('Invalid JSON value: ' . json_last_error_msg()); } return $object; } }