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