<?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($ib3B9, $pvsQp = true) { goto EMn_X; nT_vE: return $pvsQp ? array_filter($ib3B9, function ($JiRHR) { return $JiRHR !== '' && $JiRHR !== null; }) : $ib3B9; goto esHJr; Q8OGg: if (is_array($ib3B9)) { } elseif ($ib3B9 instanceof Jsonable) { $ib3B9 = json_decode($ib3B9->toJson(), true); } elseif ($ib3B9 instanceof Arrayable) { $ib3B9 = $ib3B9->toArray(); } elseif (is_string($ib3B9)) { goto ADPvl; Yzv2l: try { $Opw1K = json_decode($ib3B9, true); } catch (\Throwable $GrUf4) { } goto rdwUt; ADPvl: $Opw1K = null; goto Yzv2l; rdwUt: $ib3B9 = is_array($Opw1K) ? $Opw1K : explode(',', $ib3B9); goto fPNCU; fPNCU: } else { $ib3B9 = (array) $ib3B9; } goto nT_vE; yUZEA: if ($ib3B9 instanceof \Closure) { $ib3B9 = $ib3B9(); } goto Q8OGg; EMn_X: if (!$ib3B9) { return array(); } goto yUZEA; esHJr: } public static function render($ib3B9, $DUFkV = array(), $bxwtL = null) { goto f1pNU; f1pNU: if (is_string($ib3B9)) { return $ib3B9; } goto EIruN; LHnEm: if ($ib3B9 instanceof Renderable) { return (string) $ib3B9->render(); } goto ujfA5; erdZv: return (string) $ib3B9; goto SrpC4; EIruN: if ($ib3B9 instanceof \Closure) { $bxwtL && ($ib3B9 = $ib3B9->bindTo($bxwtL)); $ib3B9 = $ib3B9(...(array) $DUFkV); } goto LHnEm; ujfA5: if ($ib3B9 instanceof Htmlable) { return (string) $ib3B9->toHtml(); } goto erdZv; SrpC4: } }