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