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