Skip to content

Commit 5caf480

Browse files
committed
delete authVerifyFunc params
1 parent 479b12f commit 5caf480

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/BaseRpc.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class BaseRpc
1717
* @param $namespace
1818
* @param $func
1919
* @param $args
20-
* @param null $authVerify
21-
* @param null $outMakeInstance
20+
* @param null $authVerifyFunc
21+
* @param null $outMakeInstanceFunc
2222
* @return mixed
2323
* @throws RpcException
2424
*/
25-
public function handle($namespace, $func, $args, $authVerify = null, $outMakeInstance = null)
25+
public function handle($namespace, $func, $args, $authVerifyFunc = null, $outMakeInstanceFunc = null)
2626
{
2727
$this->namespace = $namespace;
2828
$this->func = $func;
@@ -43,23 +43,23 @@ public function handle($namespace, $func, $args, $authVerify = null, $outMakeIns
4343
}
4444

4545
// 权限等验证过滤处理
46-
if (isset($authVerify)) {
47-
call_user_func_array($authVerify, [$this->func, $this->args]);
46+
if (isset($authVerifyFunc)) {
47+
$authVerifyFunc();
4848
}
4949

50-
return $this->invokeFunc($this->func, $this->args, $outMakeInstance);
50+
return $this->invokeFunc($this->func, $this->args, $outMakeInstanceFunc);
5151
}
5252

5353
/**
5454
* 以‘_’来分割ajax传递过来的类名和方法名,调用该方法,并返回值
5555
*
5656
* @param $func
5757
* @param $args
58-
* @param null $outMakeInstance
58+
* @param null $outMakeInstanceFunc
5959
* @return mixed
6060
* @throws RpcException
6161
*/
62-
protected function invokeFunc($func, $args, $outMakeInstance = null)
62+
protected function invokeFunc($func, $args, $outMakeInstanceFunc = null)
6363
{
6464
$params = explode('_', $func, 2);
6565
if (count($params) != 2) throw new RpcException($this->ERR_MSG_METHOD_FORMAT_ERROR);
@@ -69,8 +69,8 @@ protected function invokeFunc($func, $args, $outMakeInstance = null)
6969
$funcName = $params[1];
7070
if (!class_exists($className)) throw new RpcException(sprintf($this->ERR_MSG_CLASS_NOT_FOUND, $className));
7171

72-
if (isset($outMakeInstance)) {
73-
$object = $outMakeInstance($className);
72+
if (isset($outMakeInstanceFunc)) {
73+
$object = $outMakeInstanceFunc($className);
7474
} else {
7575
$object = new $className();
7676
}

0 commit comments

Comments
 (0)