<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Config; use ModStart\Core\Exception\BizException; use Module\Member\Oauth\AbstractOauth; class MemberOauth { private static $list = array(); public static function register($Z32UA) { self::$list[] = $Z32UA; } public static function hasEnableItems() { $SkrlQ = self::get(); return !empty($SkrlQ); } public static function hasItems() { goto meCma; aMe4c: $SkrlQ = array_filter($SkrlQ, function ($Z32UA) { return $Z32UA->hasRender(); }); goto jjYqN; meCma: $SkrlQ = self::get(); goto aMe4c; jjYqN: return !empty($SkrlQ); goto ieVLo; ieVLo: } public static function get($MGY9H = null) { goto OSJ7l; PprfK: if (null === $YK6cM) { $YK6cM = array(); foreach (self::$list as $Z32UA) { if (is_string($Z32UA)) { $Z32UA = array(app($Z32UA)); } else { if ($Z32UA instanceof \Closure) { $Z32UA = call_user_func($Z32UA); } } $YK6cM = array_merge($YK6cM, $Z32UA); } } goto PS_Tf; OUuy0: foreach ($YK6cM as $Z32UA) { if ($Z32UA->name() == $MGY9H) { return $Z32UA; } } goto HYwle; OSJ7l: static $YK6cM = null; goto PprfK; HYwle: return null; goto g4q8B; PS_Tf: if (null === $MGY9H) { return $YK6cM; } goto OUuy0; g4q8B: } public static function getByOauthKey($MGY9H) { foreach (self::get() as $pArCr) { if ($pArCr->oauthKey() == $MGY9H) { return $pArCr; } } return null; } public static function getOrFail($MGY9H) { goto u8vct; KzmrJ: return $pArCr; goto CSP7D; u8vct: $pArCr = self::get($MGY9H); goto V1mY7; V1mY7: BizException::throwsIfEmpty('授权登录信息(' . $MGY9H . ')未找到', $pArCr); goto KzmrJ; CSP7D: } private static function sort() { static $S0SDS = 1000; return $S0SDS++; } }