Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

注释完善 #3122

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions src/think/Request.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
Expand All @@ -8,7 +9,7 @@
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------
declare (strict_types = 1);
declare (strict_types=1);

namespace think;

Expand Down Expand Up @@ -988,8 +989,8 @@ public function get(string | array | bool $name = '', $default = null, string |
/**
* 获取中间件传递的参数
* @access public
* @param string $name 变量名
* @param mixed $default 默认值
* @param string|null $name 变量名
* @param mixed $default 默认值
* @return mixed
*/
public function middleware(?string $name = null, $default = null)
Expand Down Expand Up @@ -1078,9 +1079,9 @@ public function patch(string | array | bool $name = '', $default = null, string
/**
* 获取request变量
* @access public
* @param string|array $name 数据名称
* @param mixed $default 默认值
* @param string|array|null $filter 过滤方法
* @param string|array|bool $name 数据名称
* @param mixed $default 默认值
* @param string|array|null $filter 过滤方法
* @return mixed
*/
public function request(string | array | bool $name = '', $default = null, string | array | null $filter = '')
Expand All @@ -1095,8 +1096,8 @@ public function request(string | array | bool $name = '', $default = null, strin
/**
* 获取环境变量
* @access public
* @param string $name 数据名称
* @param string $default 默认值
* @param string $name 数据名称
* @param string|null $default 默认值
* @return mixed
*/
public function env(string $name = '', ?string $default = null)
Expand All @@ -1110,8 +1111,8 @@ public function env(string $name = '', ?string $default = null)
/**
* 获取session数据
* @access public
* @param string $name 数据名称
* @param string $default 默认值
* @param string $name 数据名称
* @param string|null $default 默认值
* @return mixed
*/
public function session(string $name = '', $default = null)
Expand All @@ -1125,9 +1126,9 @@ public function session(string $name = '', $default = null)
/**
* 获取cookie参数
* @access public
* @param mixed $name 数据名称
* @param string $default 默认值
* @param string|array|null $filter 过滤方法
* @param mixed $name 数据名称
* @param string|null $default 默认值
* @param string|array|null $filter 过滤方法
* @return mixed
*/
public function cookie(string $name = '', $default = null, string | array | null $filter = '')
Expand Down Expand Up @@ -1259,8 +1260,8 @@ protected function throwUploadFileError($error)
/**
* 设置或者获取当前的Header
* @access public
* @param string $name header名称
* @param string $default 默认值
* @param string $name header名称
* @param string|null $default 默认值
* @return string|array|null
*/
public function header(string $name = '', ?string $default = null)
Expand Down Expand Up @@ -2208,11 +2209,7 @@ public function offsetGet(mixed $name): mixed
return $this->param($name);
}

public function offsetSet(mixed $name, mixed $value): void
{
}
public function offsetSet(mixed $name, mixed $value): void {}

public function offsetUnset(mixed $name): void
{
}
public function offsetUnset(mixed $name): void {}
}
16 changes: 9 additions & 7 deletions src/think/facade/Request.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check warning on line 1 in src/think/facade/Request.php

View workflow job for this annotation

GitHub Actions / php-cs-fixer

Found violation(s) of type: blank_line_after_opening_tag
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
Expand Down Expand Up @@ -58,18 +58,18 @@
* @method static \think\Request setRoute(array $route) 设置路由变量
* @method static mixed route(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取路由参数
* @method static mixed get(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取GET参数
* @method static mixed middleware(mixed $name, mixed $default = null) 获取中间件传递的参数
* @method static mixed middleware(string|null $name, mixed $default = null) 获取中间件传递的参数
* @method static mixed post(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取POST参数
* @method static mixed put(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取PUT参数
* @method static mixed delete(mixed $name = '', mixed $default = null, string|array|null $filter = '') 设置获取DELETE参数
* @method static mixed patch(mixed $name = '', mixed $default = null, string|array|null $filter = '') 设置获取PATCH参数
* @method static mixed request(string|array $name = '', mixed $default = null, string|array|null $filter = '') 获取request变量
* @method static mixed env(string $name = '', string $default = null) 获取环境变量
* @method static mixed session(string $name = '', string $default = null) 获取session数据
* @method static mixed cookie(mixed $name = '', string $default = null, string|array|null $filter = '') 获取cookie参数
* @method static mixed request(string|array|bool $name = '', mixed $default = null, string|array|null $filter = '') 获取request变量
* @method static mixed env(string $name = '', string|null $default = null) 获取环境变量
* @method static mixed session(string $name = '', string|null $default = null) 获取session数据
* @method static mixed cookie(mixed $name = '', string|null $default = null, string|array|null $filter = '') 获取cookie参数
* @method static mixed server(string $name = '', string $default = '') 获取server参数
* @method static null|array|UploadedFile file(string $name = '') 获取上传的文件信息
* @method static string|array header(string $name = '', string $default = null) 设置或者获取当前的Header
* @method static string|array header(string $name = '', string|null $default = null) 设置或者获取当前的Header
* @method static mixed input(array $data = [], string|false $name = '', mixed $default = null, string|array|null $filter = '') 获取变量 支持过滤和默认值
* @method static mixed filter(mixed $filter = null) 设置或获取当前的过滤规则
* @method static mixed filterValue(mixed &$value, mixed $key, array $filters) 递归过滤给定的值
Expand All @@ -93,9 +93,11 @@
* @method static int remotePort() 当前请求 REMOTE_PORT
* @method static string contentType() 当前请求 HTTP_CONTENT_TYPE
* @method static string secureKey() 获取当前请求的安全Key
* @method static \think\Request setLayer(string $layer) 设置当前的分层名
* @method static \think\Request setController(string $controller) 设置当前的控制器名
* @method static \think\Request setAction(string $action) 设置当前的操作名
* @method static string controller(bool $convert = false) 获取当前的控制器名
* @method static string layer(bool $convert = false) 获取当前的模块名
* @method static string controller(bool $convert = false, bool $base = false) 获取当前的控制器名
* @method static string action(bool $convert = false) 获取当前的操作名
* @method static string getContent() 设置或者获取当前请求的content
* @method static string getInput() 获取当前请求的php://input
Expand Down
4 changes: 2 additions & 2 deletions src/think/response/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function output($data): string
/**
* 获取视图变量
* @access public
* @param string $name 模板变量
* @param string|null $name 模板变量
* @return mixed
*/
public function getVars(?string $name = null)
Expand Down Expand Up @@ -128,7 +128,7 @@ public function assign(string|array $name, $value = null)
/**
* 视图内容过滤
* @access public
* @param callable $filter
* @param callable|null $filter
* @return $this
*/
public function filter(?callable $filter = null)
Expand Down
Loading