@@ -23,6 +23,9 @@ |
||
23 | 23 | class Url extends Controller |
24 | 24 | { |
25 | 25 | |
26 | + /** |
|
27 | + * @param string $dispatch |
|
28 | + */ |
|
26 | 29 | public function __construct(Request $request, Rule $rule, $dispatch, array $param = [], int $code = null) |
27 | 30 | { |
28 | 31 | $this->request = $request; |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | namespace think\route\dispatch; |
14 | 14 | |
15 | +use think\Request; |
|
15 | 16 | use think\exception\HttpException; |
16 | 17 | use think\helper\Str; |
17 | -use think\Request; |
|
18 | 18 | use think\route\Rule; |
19 | 19 | |
20 | 20 | /** |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | namespace think\route; |
14 | 14 | |
15 | -use think\helper\Str; |
|
16 | 15 | use think\Request; |
17 | 16 | use think\Route; |
17 | +use think\helper\Str; |
|
18 | 18 | use think\route\dispatch\Callback as CallbackDispatch; |
19 | 19 | use think\route\dispatch\Controller as ControllerDispatch; |
20 | 20 |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * 获取路由参数定义 |
253 | 253 | * @access public |
254 | 254 | * @param string $name 参数名 |
255 | - * @param mixed $default 默认值 |
|
255 | + * @param boolean $default 默认值 |
|
256 | 256 | * @return mixed |
257 | 257 | */ |
258 | 258 | public function getOption(string $name = '', $default = null) |
@@ -769,7 +769,6 @@ discard block |
||
769 | 769 | /** |
770 | 770 | * 解析URL地址中的参数Request对象 |
771 | 771 | * @access protected |
772 | - * @param string $rule 路由规则 |
|
773 | 772 | * @param array $var 变量 |
774 | 773 | * @return void |
775 | 774 | */ |
@@ -808,7 +807,7 @@ discard block |
||
808 | 807 | * 生成路由的正则规则 |
809 | 808 | * @access protected |
810 | 809 | * @param string $rule 路由规则 |
811 | - * @param array $match 匹配的变量 |
|
810 | + * @param string[] $match 匹配的变量 |
|
812 | 811 | * @param array $pattern 路由变量规则 |
813 | 812 | * @param array $option 路由参数 |
814 | 813 | * @param bool $completeMatch 路由是否完全匹配 |
@@ -14,12 +14,12 @@ |
||
14 | 14 | |
15 | 15 | use Closure; |
16 | 16 | use think\Container; |
17 | -use think\middleware\AllowCrossDomain; |
|
18 | -use think\middleware\CheckRequestCache; |
|
19 | -use think\middleware\FormTokenCheck; |
|
20 | 17 | use think\Request; |
21 | 18 | use think\Response; |
22 | 19 | use think\Route; |
20 | +use think\middleware\AllowCrossDomain; |
|
21 | +use think\middleware\CheckRequestCache; |
|
22 | +use think\middleware\FormTokenCheck; |
|
23 | 23 | use think\route\dispatch\Callback as CallbackDispatch; |
24 | 24 | use think\route\dispatch\Controller as ControllerDispatch; |
25 | 25 | use think\route\dispatch\Redirect as RedirectDispatch; |
@@ -288,9 +288,9 @@ |
||
288 | 288 | /** |
289 | 289 | * 匹配路由地址 |
290 | 290 | * @access protected |
291 | - * @param array $rule 路由规则 |
|
291 | + * @param RuleItem[] $rule 路由规则 |
|
292 | 292 | * @param array $vars 路由变量 |
293 | - * @param mixed $allowDomain 允许域名 |
|
293 | + * @param string|boolean $allowDomain 允许域名 |
|
294 | 294 | * @return array |
295 | 295 | */ |
296 | 296 | protected function getRuleUrl(array $rule, array &$vars = [], $allowDomain = ''): array |
@@ -886,6 +886,10 @@ discard block |
||
886 | 886 | } |
887 | 887 | |
888 | 888 | // 判断图像类型 |
889 | + |
|
890 | + /** |
|
891 | + * @param string $image |
|
892 | + */ |
|
889 | 893 | protected function getImageType($image) |
890 | 894 | { |
891 | 895 | if (function_exists('exif_imagetype')) { |
@@ -904,7 +908,7 @@ discard block |
||
904 | 908 | * 验证表单令牌 |
905 | 909 | * @access public |
906 | 910 | * @param mixed $value 字段值 |
907 | - * @param mixed $rule 验证规则 |
|
911 | + * @param string $rule 验证规则 |
|
908 | 912 | * @param array $data 数据 |
909 | 913 | * @return bool |
910 | 914 | */ |
@@ -1496,7 +1500,7 @@ discard block |
||
1496 | 1500 | * 使用正则验证数据 |
1497 | 1501 | * @access public |
1498 | 1502 | * @param mixed $value 字段值 |
1499 | - * @param mixed $rule 验证规则 正则规则或者预定义正则名 |
|
1503 | + * @param string $rule 验证规则 正则规则或者预定义正则名 |
|
1500 | 1504 | * @return bool |
1501 | 1505 | */ |
1502 | 1506 | public function regex($value, $rule): bool |
@@ -107,7 +107,7 @@ |
||
107 | 107 | |
108 | 108 | /** |
109 | 109 | * 获取模板引擎渲染内容 |
110 | - * @param $callback |
|
110 | + * @param \Closure $callback |
|
111 | 111 | * @return string |
112 | 112 | * @throws \Exception |
113 | 113 | */ |