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