mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-23 18:00:29 +08:00
Update WechatService.php
This commit is contained in:
parent
ca2e1d19f3
commit
3c3cdfef32
@ -97,7 +97,7 @@ class WechatService extends Service
|
|||||||
*/
|
*/
|
||||||
public static function __callStatic(string $name, array $arguments)
|
public static function __callStatic(string $name, array $arguments)
|
||||||
{
|
{
|
||||||
[$type, $class, $classname] = self::paraseName($name);
|
[$type, $class, $classname] = self::parseName($name);
|
||||||
if ("{$type}{$class}" !== $name) {
|
if ("{$type}{$class}" !== $name) {
|
||||||
throw new \think\Exception("抱歉,实例 {$name} 不在符合规则!");
|
throw new \think\Exception("抱歉,实例 {$name} 不在符合规则!");
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ class WechatService extends Service
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private static function paraseName(string $name): array
|
private static function parseName(string $name): array
|
||||||
{
|
{
|
||||||
foreach (['WeChat', 'WeMini', 'WeOpen', 'WePay', 'ThinkService'] as $type) {
|
foreach (['WeChat', 'WeMini', 'WeOpen', 'WePay', 'ThinkService'] as $type) {
|
||||||
if (strpos($name, $type) === 0) {
|
if (strpos($name, $type) === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user