<?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($HDpl6, $XYn5i = true) { goto ncjZO; ncjZO: if (!$HDpl6) { return array(); } goto GkP9_; ecOW5: return $XYn5i ? array_filter($HDpl6, function ($Q0rz2) { return $Q0rz2 !== '' && $Q0rz2 !== null; }) : $HDpl6; goto WJtmY; iL5qI: if (is_array($HDpl6)) { } elseif ($HDpl6 instanceof Jsonable) { $HDpl6 = json_decode($HDpl6->toJson(), true); } elseif ($HDpl6 instanceof Arrayable) { $HDpl6 = $HDpl6->toArray(); } elseif (is_string($HDpl6)) { goto byP0R; ChJKk: $HDpl6 = is_array($tGYjm) ? $tGYjm : explode(',', $HDpl6); goto fne81; x09Vh: try { $tGYjm = json_decode($HDpl6, true); } catch (\Throwable $SwVsw) { } goto ChJKk; byP0R: $tGYjm = null; goto x09Vh; fne81: } else { $HDpl6 = (array) $HDpl6; } goto ecOW5; GkP9_: if ($HDpl6 instanceof \Closure) { $HDpl6 = $HDpl6(); } goto iL5qI; WJtmY: } public static function render($HDpl6, $UbqnB = array(), $bKHwB = null) { goto xq3zm; xPSIk: if ($HDpl6 instanceof Renderable) { return (string) $HDpl6->render(); } goto XuQEG; xq3zm: if (is_string($HDpl6)) { return $HDpl6; } goto hmrYb; dfd9M: return (string) $HDpl6; goto hJqv9; hmrYb: if ($HDpl6 instanceof \Closure) { $bKHwB && ($HDpl6 = $HDpl6->bindTo($bKHwB)); $HDpl6 = $HDpl6(...(array) $UbqnB); } goto xPSIk; XuQEG: if ($HDpl6 instanceof Htmlable) { return (string) $HDpl6->toHtml(); } goto dfd9M; hJqv9: } }