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