From 7a7ebee5c169c385f1f25367f3e2b6c3ccc05c57 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 2 Mar 2017 11:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/library/think/App.php b/library/think/App.php index 0d97aa11..7038f818 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -120,7 +120,7 @@ class App // 请求缓存检查 $request->cache($config['request_cache'], $config['request_cache_expire'], $config['request_cache_except']); - $data = self::exec($dispatch,$config); + $data = self::exec($dispatch, $config); } catch (HttpResponseException $exception) { $data = $exception->getResponse(); } @@ -234,9 +234,9 @@ class App } $args = []; if ($reflect->getNumberOfParameters() > 0) { - // 判断数组类型 数字数组时按顺序绑定参数 - reset($vars); - $type = key($vars) === 0 ? 1 : 0; + // 判断数组类型 数字数组时按顺序绑定参数 + reset($vars); + $type = key($vars) === 0 ? 1 : 0; $params = $reflect->getParameters(); foreach ($params as $param) { $args[] = self::getParamValue($param, $vars, $type); @@ -266,8 +266,7 @@ class App if (method_exists($className, 'invoke')) { $method = new \ReflectionMethod($className, 'invoke'); if ($method->isPublic() && $method->isStatic()) { - $result = $className::invoke(Request::instance()); - continue; + return $className::invoke(Request::instance()); } } $result = method_exists($className, 'instance') ? $className::instance() : new $className; @@ -280,7 +279,7 @@ class App $result = $param->getDefaultValue(); } else { throw new \InvalidArgumentException('method param miss:' . $name); - } + } return $result; }