是否有PHPDoc标准来描述通过引用传递的功能属性



我有一个函数,它使用作为引用传递的属性:

public function doSomething(&$argumentPassedByReference)
{
// ...
}

我维护我的项目的PHPDoc,所以我这样描述我的功能:

/**
* Do something very useful with the thing passed in parameters
*
* @param Type $argumentPassedByReference Thing that will be edited
*/
public function doSomething(&$argumentPassedByReference)

但我并不是很满意,因为它并没有显示$argumentPassedByReference是通过引用传递的。PHPDoc中是否有一个标准来描述这一点?

在函数定义中添加与号:

/**
* Do something very useful with the thing passed in parameters
*
* @param Type &$argumentPassedByReference Thing that will be edited
*/

《诗篇》有@param out来标记输出类型——这不是一回事,但可能很有用。

最新更新