<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Renderable; class ConvertUtil { public static function toArray($gwXrh, $CJNWc = true) { goto xoEfu; f3zUJ: return $CJNWc ? array_filter($gwXrh, function ($VFelt) { return $VFelt !== '' && $VFelt !== null; }) : $gwXrh; goto GSCfL; kUWTf: if (is_array($gwXrh)) { } elseif ($gwXrh instanceof Jsonable) { $gwXrh = json_decode($gwXrh->toJson(), true); } elseif ($gwXrh instanceof Arrayable) { $gwXrh = $gwXrh->toArray(); } elseif (is_string($gwXrh)) { goto Ze8RX; Ze8RX: $zlzl0 = null; goto A7NrU; PZ_c1: $gwXrh = is_array($zlzl0) ? $zlzl0 : explode(',', $gwXrh); goto S5GBN; A7NrU: try { $zlzl0 = json_decode($gwXrh, true); } catch (\Throwable $Y5fnH) { } goto PZ_c1; S5GBN: } else { $gwXrh = (array) $gwXrh; } goto f3zUJ; xoEfu: if (!$gwXrh) { return array(); } goto iBQ5h; iBQ5h: if ($gwXrh instanceof \Closure) { $gwXrh = $gwXrh(); } goto kUWTf; GSCfL: } public static function render($gwXrh, $CCHgz = array(), $skY9R = null) { goto Fy8Gb; QabOW: return (string) $gwXrh; goto nuWB7; quv20: if ($gwXrh instanceof Htmlable) { return (string) $gwXrh->toHtml(); } goto QabOW; Fy8Gb: if (is_string($gwXrh)) { return $gwXrh; } goto Ii_E8; Ii_E8: if ($gwXrh instanceof \Closure) { $skY9R && ($gwXrh = $gwXrh->bindTo($skY9R)); $gwXrh = $gwXrh(...(array) $CCHgz); } goto mlQUs; mlQUs: if ($gwXrh instanceof Renderable) { return (string) $gwXrh->render(); } goto quv20; nuWB7: } }