修改RQ、Router注释

This commit is contained in:
TOP糯米 2024-07-18 14:32:45 +08:00
parent f2d8ac626e
commit df45409102
3 changed files with 33 additions and 42 deletions

View File

@ -81,7 +81,7 @@ class Router
/**
* 完整控制器名
* @return mixed
* @return string
*/
public function controllerFullName()
{
@ -90,7 +90,7 @@ class Router
/**
* 控制器名
* @return mixed
* @return string
*/
public function controller()
{
@ -99,7 +99,7 @@ class Router
/**
* 模块名
* @return mixed
* @return string
*/
public function module()
{
@ -108,7 +108,7 @@ class Router
/**
* 方法名
* @return mixed
* @return string
*/
public function method()
{
@ -117,7 +117,7 @@ class Router
/**
* 请求参数
* @return mixed
* @return array
*/
public function params()
{

View File

@ -22,9 +22,9 @@ class Request
/**
* 当前URI
* @var mixed|null
* @var string
*/
private $uri = null;
private $uri = '';
/**
* post、get数据删除的值
@ -44,7 +44,7 @@ class Request
/**
* 当前请求方式
* @return mixed|string
* @return string
*/
public function requestMethod()
{
@ -53,7 +53,7 @@ class Request
/**
* 判断请求方式
* @param $method
* @param string $method
* @return bool
*/
public function is($method)
@ -102,7 +102,7 @@ class Request
/**
* 当前请求的URI
* @return mixed
* @return string
*/
public function uri()
{
@ -111,7 +111,7 @@ class Request
/**
* 模块名称
* @return mixed
* @return string
*/
public function module()
{
@ -120,7 +120,7 @@ class Request
/**
* 控制器完整类名
* @return mixed
* @return string
*/
public function controllerFullName()
{
@ -129,7 +129,7 @@ class Request
/**
* 控制器名称
* @return mixed
* @return string
*/
public function controller()
{
@ -138,7 +138,7 @@ class Request
/**
* 方法名称
* @return mixed
* @return string
*/
public function method()
{
@ -147,28 +147,19 @@ class Request
/**
* 参数
* @return mixed
* @return array
*/
public function params()
{
return Router::instance($this)->params();
}
/**
* 当前加载的路由规则
* @return null
*/
public function routeParameters()
{
return Router::instance($this)->loadRuleParameters();
}
/**
* 移除值
* @param $field
* @param string $field
* @return $this
*/
public function except($field = null)
public function except($field = '')
{
if (is_array($field)) {
$this->except = array_merge($this->except, $field);
@ -221,11 +212,11 @@ class Request
/**
* 得到当前的URI
* @return mixed|null
* @return string
*/
private function getUri()
{
$uri = null;
$uri = '';
if (isset($this->server['PATH_INFO']) && $this->server['PATH_INFO']) {
$uri = $this->server['PATH_INFO'];
} elseif (isset($_GET['s']) && $_GET['s']) {
@ -236,16 +227,16 @@ class Request
/**
* GET POST公共方法
* @param $type
* @param $name
* @param $except
* @param $filter
* @return null
* @param string $type
* @param string $name
* @param array $except
* @param string $filter
* @return array|string|null
*/
private function requestData($type, $name, $except, $filter)
{
$data = ($type == 'get') ? $_GET : $_POST;
$name = ($name == '*') ? null : $name;
$name = ($name == '*') ? '' : $name;
if (!is_array($except)) {
$except = explode(',', $except);

View File

@ -87,10 +87,10 @@ class Response
/**
* 设置Header
* @param null $header
* @param array|string $header
* @return $this
*/
public function header($header = null)
public function header($header)
{
if (is_array($header)) {
$this->header = array_merge($this->header, $header);
@ -106,7 +106,7 @@ class Response
/**
* 设置响应状态码
* @param $code
* @param int $code
* @return Response
*/
public function code($code = 200)
@ -124,7 +124,7 @@ class Response
/**
* 返回内容
* @param $data
* @param mixed $data
* @return Response
*/
public function send($data = null)
@ -151,11 +151,11 @@ class Response
/**
* 输出文件
* @param $filename
* @param $name
* @param string $filename
* @param string $name
* @return Response
*/
public function sendFile($filename = null, $name = null)
public function sendFile($filename, $name = '')
{
if (is_file($filename)) {
$name = ($name) ? $name : uniqid() . '.' . substr($filename, strrpos($filename, '.') + 1);
@ -168,7 +168,7 @@ class Response
/**
* 处理数据
* @param $data
* @param mixed $data
* @return false|int|null|string
*/
private function getContent($data)