<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Provider; trait ProviderTrait { public static function register($hcBRx) { self::$list[] = $hcBRx; } public static function listAll() { goto uC42S; XNntd: if ($gxLf3) { @usort(self::$list, function ($gt237, $nJOfP) { if ($gt237->order() == $nJOfP->order()) { return 0; } return $gt237->order() > $nJOfP->order() ? 1 : -1; }); } goto uA1FC; cITup: if ($ijOcF) { return self::$list; } goto wXKaw; DkMGx: return self::$list; goto eIuux; k0UP0: foreach (self::$list as $F_a6B => $JiRHR) { if ($JiRHR instanceof \Closure) { self::$list[$F_a6B] = call_user_func($JiRHR); } else { if (is_string($JiRHR)) { self::$list[$F_a6B] = app($JiRHR); } } if (!$gxLf3 && method_exists(self::$list[$F_a6B], 'order')) { $gxLf3 = true; } } goto XNntd; uC42S: static $ijOcF = false; goto cITup; wXKaw: $gxLf3 = false; goto k0UP0; uA1FC: $ijOcF = true; goto DkMGx; eIuux: } public static function allMap() { return array_build(self::listAll(), function ($F_a6B, $JiRHR) { return array($JiRHR->name(), $JiRHR->title()); }); } public static function allDefaultMap() { return array_merge(array('' => L('None')), array_build(self::listAll(), function ($F_a6B, $JiRHR) { return array($JiRHR->name(), $JiRHR->title()); })); } public static function isEmpty() { return empty(self::$list); } public static function getByName($XggBq) { foreach (self::listAll() as $V563N) { if ($V563N->name() == $XggBq) { return $V563N; } } return null; } public static function first() { foreach (self::listAll() as $V563N) { return $V563N; } return null; } }