<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Biz; trait BizTrait { private static $list = array(); public static function register($uYy4k) { self::$list[] = $uYy4k; } public static function registerAll(...$fa_50) { foreach ($fa_50 as $uYy4k) { self::register($uYy4k); } } public static function listAll() { foreach (self::$list as $QBy8K => $cG5OI) { if ($cG5OI instanceof \Closure) { self::$list[$QBy8K] = call_user_func($cG5OI); } else { if (is_string($cG5OI)) { self::$list[$QBy8K] = app($cG5OI); } } } return self::$list; } private static function getByName($HRrYd) { foreach (self::all() as $lDvaK) { if ($lDvaK->name() == $HRrYd) { return $lDvaK; } } return null; } public static function allMap() { return array_build(self::all(), function ($QBy8K, $cG5OI) { return array($cG5OI->name(), $cG5OI->title()); }); } }