PHP 文档:声明您正在返回另一个函数调用的结果

PHP doc: state that you are returning the result of another function call

具有这样的功能:

function cancel($thing_id)
{
   $this->Thing->id = $thing_id;
   return $this->Thing->cancel();
}

如何格式化 @return 以反映我正在 return 另一个函数调用的结果?

不可能 link 将 return 类型转换为不同的函数 return 类型。 phpDocumentor: Defining a 'Type' 中没有提到它是一种类型,最接近的是 callable 类型。

你能做的最好的事情可能是:

/**
 * As a example I have assumed that $this->Thing->cancel() returns either true or false
 *
 * @see Thing::cancel
 * @return bool Returns the result of Thing::cancel
 */

如您所见,我指定了$this->Thing->cancel()的return类型,并说明了return类型的来源。为了方便找到方法我添加了@see标签,指向方法