<?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($FT9zA, $JCV6U = true) { goto anbXH; fAHBc: return $JCV6U ? array_filter($FT9zA, function ($tHq0l) { return $tHq0l !== '' && $tHq0l !== null; }) : $FT9zA; goto XVuKE; h1Tyc: if ($FT9zA instanceof \Closure) { $FT9zA = $FT9zA(); } goto jsDRn; jsDRn: if (is_array($FT9zA)) { } elseif ($FT9zA instanceof Jsonable) { $FT9zA = json_decode($FT9zA->toJson(), true); } elseif ($FT9zA instanceof Arrayable) { $FT9zA = $FT9zA->toArray(); } elseif (is_string($FT9zA)) { goto caDxz; unogU: try { $d4xsp = json_decode($FT9zA, true); } catch (\Throwable $SXS9c) { } goto pdVEn; caDxz: $d4xsp = null; goto unogU; pdVEn: $FT9zA = is_array($d4xsp) ? $d4xsp : explode(',', $FT9zA); goto gwgfy; gwgfy: } else { $FT9zA = (array) $FT9zA; } goto fAHBc; anbXH: if (!$FT9zA) { return array(); } goto h1Tyc; XVuKE: } public static function render($FT9zA, $psLH5 = array(), $cTW9q = null) { goto l0l_U; KQUMs: if ($FT9zA instanceof Renderable) { return (string) $FT9zA->render(); } goto ziYjR; ziYjR: if ($FT9zA instanceof Htmlable) { return (string) $FT9zA->toHtml(); } goto pb9eZ; pb9eZ: return (string) $FT9zA; goto bl0qZ; l0l_U: if (is_string($FT9zA)) { return $FT9zA; } goto Cjbhk; Cjbhk: if ($FT9zA instanceof \Closure) { $cTW9q && ($FT9zA = $FT9zA->bindTo($cTW9q)); $FT9zA = $FT9zA(...(array) $psLH5); } goto KQUMs; bl0qZ: } }