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