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