<?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($tzAUI, $cF9SB = true) { goto RK8M6; HOKsn: if (is_array($tzAUI)) { } elseif ($tzAUI instanceof Jsonable) { $tzAUI = json_decode($tzAUI->toJson(), true); } elseif ($tzAUI instanceof Arrayable) { $tzAUI = $tzAUI->toArray(); } elseif (is_string($tzAUI)) { goto NVAFS; NVAFS: $YPAh8 = null; goto QE9fl; Ha1yV: $tzAUI = is_array($YPAh8) ? $YPAh8 : explode(',', $tzAUI); goto VGt6Z; QE9fl: try { $YPAh8 = json_decode($tzAUI, true); } catch (\Throwable $vBRkZ) { } goto Ha1yV; VGt6Z: } else { $tzAUI = (array) $tzAUI; } goto TWNq1; TWNq1: return $cF9SB ? array_filter($tzAUI, function ($ohYVl) { return $ohYVl !== '' && $ohYVl !== null; }) : $tzAUI; goto WJ_8N; YOvOA: if ($tzAUI instanceof \Closure) { $tzAUI = $tzAUI(); } goto HOKsn; RK8M6: if (!$tzAUI) { return array(); } goto YOvOA; WJ_8N: } public static function render($tzAUI, $iq6Gr = array(), $p95nA = null) { goto SpgJe; VQWTF: if ($tzAUI instanceof Htmlable) { return (string) $tzAUI->toHtml(); } goto KHVz0; qQfA5: if ($tzAUI instanceof Renderable) { return (string) $tzAUI->render(); } goto VQWTF; SpgJe: if (is_string($tzAUI)) { return $tzAUI; } goto BYrD1; KHVz0: return (string) $tzAUI; goto ed8kx; BYrD1: if ($tzAUI instanceof \Closure) { $p95nA && ($tzAUI = $tzAUI->bindTo($p95nA)); $tzAUI = $tzAUI(...(array) $iq6Gr); } goto qQfA5; ed8kx: } }