Files
framework/library
HyperQing c64a335884 为Request类的几个方法完善注释
在phpstorm2016.2.1中,使用下列语句会提示警告: 

>Method __toString is not implemented for '\think\Request' less... (Ctrl+F1) 
This inspection detects attempts to convert objects without __toString() method implementation to string, since PHP 5.2.0, it would cause E_RECOVERABLE_ERROR. "Check __toString exists for each expression type": if the option is on, the inspection will check all possible types of the expression and report if at least one ot them doesn't contain __toString() method implementation. 
```
$request = Request::instance();
echo "当前模块名称是" . $request->module();// 这句会被IDE提示警告
echo "当前控制器名称是" . $request->controller();// 这句会被IDE提示警告
echo "当前操作名称是" . $request->action();// 这句就不会
```
后来发现是注释引起的问题,注释中有@return string|$this。而action()方法却写成@return string。个人认为应该统一写成@return string|Request 比较合适。学识短浅,仅供参考 
```
/**
     * 设置或者获取当前的模块名
     * @access public
     * @param string $module 模块名
     * @return string|$this
     */
    public function module($module = null)
```
2016-10-21 11:36:55 +08:00
..