<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\LiveStream; use ModStart\Core\Exception\BizException; class LiveStreamProvider { private static $instances = array(); public static function register($O9Vtg) { self::$instances[] = $O9Vtg; } public static function all() { foreach (self::$instances as $MFVkb => $YxV2x) { if ($YxV2x instanceof \Closure) { self::$instances[$MFVkb] = call_user_func($YxV2x); } else { if (is_string($YxV2x)) { self::$instances[$MFVkb] = app($YxV2x); } } } return self::$instances; } public static function nameTitleMap() { return array_build(self::all(), function ($MFVkb, $O9Vtg) { return array($O9Vtg->name(), $O9Vtg->title()); }); } public static function first() { foreach (self::all() as $O9Vtg) { return $O9Vtg->name(); } return null; } public static function get($MGY9H) { foreach (self::all() as $Z32UA) { if ($Z32UA->name() == $MGY9H) { return $Z32UA; } } return null; } }