<?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($mdHu1, $geg6A = true) { goto OfnbH; sMFTy: return $geg6A ? array_filter($mdHu1, function ($pk5fc) { return $pk5fc !== '' && $pk5fc !== null; }) : $mdHu1; goto l0uVG; rRQ60: if ($mdHu1 instanceof \Closure) { $mdHu1 = $mdHu1(); } goto lHj7Y; lHj7Y: if (is_array($mdHu1)) { } elseif ($mdHu1 instanceof Jsonable) { $mdHu1 = json_decode($mdHu1->toJson(), true); } elseif ($mdHu1 instanceof Arrayable) { $mdHu1 = $mdHu1->toArray(); } elseif (is_string($mdHu1)) { goto ymPvx; S30Ol: $mdHu1 = is_array($I2jnK) ? $I2jnK : explode(',', $mdHu1); goto x9xNN; ymPvx: $I2jnK = null; goto FT2Bd; FT2Bd: try { $I2jnK = json_decode($mdHu1, true); } catch (\Throwable $tZVhb) { } goto S30Ol; x9xNN: } else { $mdHu1 = (array) $mdHu1; } goto sMFTy; OfnbH: if (!$mdHu1) { return array(); } goto rRQ60; l0uVG: } public static function render($mdHu1, $dUOod = array(), $Kl0RD = null) { goto Bgf5Q; IV39X: return (string) $mdHu1; goto RSseT; J0f3i: if ($mdHu1 instanceof \Closure) { $Kl0RD && ($mdHu1 = $mdHu1->bindTo($Kl0RD)); $mdHu1 = $mdHu1(...(array) $dUOod); } goto DbQUx; DbQUx: if ($mdHu1 instanceof Renderable) { return (string) $mdHu1->render(); } goto l6DKu; l6DKu: if ($mdHu1 instanceof Htmlable) { return (string) $mdHu1->toHtml(); } goto IV39X; Bgf5Q: if (is_string($mdHu1)) { return $mdHu1; } goto J0f3i; RSseT: } }