<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider; trait BizTrait { private static $list = array(); public static function register($i9_MK) { self::$list[] = $i9_MK; } public static function registerAll(...$KNECc) { foreach ($KNECc as $i9_MK) { self::register($i9_MK); } } public static function listAll() { foreach (self::$list as $MFVkb => $YxV2x) { if ($YxV2x instanceof \Closure) { self::$list[$MFVkb] = call_user_func($YxV2x); } else { if (is_string($YxV2x)) { self::$list[$MFVkb] = app($YxV2x); } } } return self::$list; } public static function getByName($MGY9H) { foreach (self::listAll() as $Z32UA) { if ($Z32UA->name() == $MGY9H) { return $Z32UA; } } return null; } public static function allMap() { return array_build(self::listAll(), function ($MFVkb, $YxV2x) { return array($YxV2x->name(), $YxV2x->title()); }); } public static function allMapEnabled() { return array_build(array_filter(self::listAll(), function ($YxV2x) { return $YxV2x->enable(); }), function ($MFVkb, $YxV2x) { return array($YxV2x->name(), $YxV2x->title()); }); } }