<?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($cBDsM, $DMbpM = true) { goto hgCYf; LJLFD: if ($cBDsM instanceof \Closure) { $cBDsM = $cBDsM(); } goto HeNBs; iM4TE: return $DMbpM ? array_filter($cBDsM, function ($knQyJ) { return $knQyJ !== '' && $knQyJ !== null; }) : $cBDsM; goto bj3Z6; HeNBs: if (is_array($cBDsM)) { } elseif ($cBDsM instanceof Jsonable) { $cBDsM = json_decode($cBDsM->toJson(), true); } elseif ($cBDsM instanceof Arrayable) { $cBDsM = $cBDsM->toArray(); } elseif (is_string($cBDsM)) { goto yQC7G; ajKcw: $cBDsM = is_array($VdGe3) ? $VdGe3 : explode(',', $cBDsM); goto ofVIW; MOxFo: try { $VdGe3 = json_decode($cBDsM, true); } catch (\Throwable $Sgh1N) { } goto ajKcw; yQC7G: $VdGe3 = null; goto MOxFo; ofVIW: } else { $cBDsM = (array) $cBDsM; } goto iM4TE; hgCYf: if (!$cBDsM) { return array(); } goto LJLFD; bj3Z6: } public static function render($cBDsM, $sgeM_ = array(), $jDtmX = null) { goto mAsXU; PzpQi: if ($cBDsM instanceof \Closure) { $jDtmX && ($cBDsM = $cBDsM->bindTo($jDtmX)); $cBDsM = $cBDsM(...(array) $sgeM_); } goto nMJml; aBSRQ: return (string) $cBDsM; goto Mo6Cr; nMJml: if ($cBDsM instanceof Renderable) { return (string) $cBDsM->render(); } goto roFSc; mAsXU: if (is_string($cBDsM)) { return $cBDsM; } goto PzpQi; roFSc: if ($cBDsM instanceof Htmlable) { return (string) $cBDsM->toHtml(); } goto aBSRQ; Mo6Cr: } }