<?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($wvO30, $udDBo = true) { goto uqoWD; uqoWD: if (!$wvO30) { return array(); } goto WHsKp; WHsKp: if ($wvO30 instanceof \Closure) { $wvO30 = $wvO30(); } goto n1WAa; n1WAa: if (is_array($wvO30)) { } elseif ($wvO30 instanceof Jsonable) { $wvO30 = json_decode($wvO30->toJson(), true); } elseif ($wvO30 instanceof Arrayable) { $wvO30 = $wvO30->toArray(); } elseif (is_string($wvO30)) { goto oWi81; fC7OW: $wvO30 = is_array($WMwX5) ? $WMwX5 : explode(',', $wvO30); goto HgSNU; oWi81: $WMwX5 = null; goto y_RY8; y_RY8: try { $WMwX5 = json_decode($wvO30, true); } catch (\Throwable $xpJqz) { } goto fC7OW; HgSNU: } else { $wvO30 = (array) $wvO30; } goto e23do; e23do: return $udDBo ? array_filter($wvO30, function ($uTz0e) { return $uTz0e !== '' && $uTz0e !== null; }) : $wvO30; goto RZllq; RZllq: } public static function render($wvO30, $Sy_B1 = array(), $lrRXC = null) { goto MvJQ7; pOsKQ: if ($wvO30 instanceof \Closure) { $lrRXC && ($wvO30 = $wvO30->bindTo($lrRXC)); $wvO30 = $wvO30(...(array) $Sy_B1); } goto o72UJ; MbBmK: if ($wvO30 instanceof Htmlable) { return (string) $wvO30->toHtml(); } goto qr0Fg; qr0Fg: return (string) $wvO30; goto Xq_DF; MvJQ7: if (is_string($wvO30)) { return $wvO30; } goto pOsKQ; o72UJ: if ($wvO30 instanceof Renderable) { return (string) $wvO30->render(); } goto MbBmK; Xq_DF: } }