<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Provider\SiteTemplate; class SiteTemplateProvider { private static $instances = array(DefaultSiteTemplateProvider::class); 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 get($BjHij) { foreach (self::all() as $sefXk) { if ($sefXk->name() == $BjHij) { return $sefXk; } } return null; } public static function map() { return array_build(self::all(), function ($JdFJR, $PSYn9) { return array($PSYn9->name(), $PSYn9->title()); }); } }