PhpStorm - return 在快速文档中键入提示
PhpStorm - return type hinting in quick documentation
根据 phpDoc,我非常喜欢 PhpStorm 及其文档生成器。现在我在快速文档中与 return 类型提示作斗争。例如我有这个代码:
$import_type = $this->importContainer->getType()->getSelectedSchema();
并且在 ImportContainer
class 我有这个 getType
方法:
/**
* @return \Easyk\inout\InOutImportType
*/
public function getType() {
return $this->type;
}
一切正常,但当我想使用 PhpStorm 的快速文档时,我会看到:
并且没有任何 return 值,return 类型提示应该是 \Easyk\inout\InOutImportType
。我发现如果我有这种类型的提示:
/**
* @return \Easyk\inout\InOutImportType $importType
*/
然后我会看到 return 值:
根据 @return 语法中的 phpDoc documentation 描述是可选的,所以为什么我必须描述 return 值才能在快速文档中看到它?对我来说,最好只在快速文档中看到确切的 return 类型提示 - 没有描述。我没有在 PhpStorm 中找到任何选项来启用它,是否有任何解决方法或者我错过了什么并且做错了?
我正在使用 PhpStorm 2017.1.4
... or I miss something and doing it wrong?
不——它已经可以正常工作了。
And there is not any return value, what should be \Easyk\inout\InOutImportType
from return type hinting.
在那里——再次检查(提示:检查第一行——函数signature/declaration)。
您在 "Returns" 部分中看到的是 return 值(例如 "Returns number of items or FALSE on error")的可选(正如您自己注意到的)description/explanation。
实际的 return 类型列在第一行函数签名的末尾。
根据 phpDoc,我非常喜欢 PhpStorm 及其文档生成器。现在我在快速文档中与 return 类型提示作斗争。例如我有这个代码:
$import_type = $this->importContainer->getType()->getSelectedSchema();
并且在 ImportContainer
class 我有这个 getType
方法:
/**
* @return \Easyk\inout\InOutImportType
*/
public function getType() {
return $this->type;
}
一切正常,但当我想使用 PhpStorm 的快速文档时,我会看到:
并且没有任何 return 值,return 类型提示应该是 \Easyk\inout\InOutImportType
。我发现如果我有这种类型的提示:
/**
* @return \Easyk\inout\InOutImportType $importType
*/
然后我会看到 return 值:
根据 @return 语法中的 phpDoc documentation 描述是可选的,所以为什么我必须描述 return 值才能在快速文档中看到它?对我来说,最好只在快速文档中看到确切的 return 类型提示 - 没有描述。我没有在 PhpStorm 中找到任何选项来启用它,是否有任何解决方法或者我错过了什么并且做错了?
我正在使用 PhpStorm 2017.1.4
... or I miss something and doing it wrong?
不——它已经可以正常工作了。
And there is not any return value, what should be
\Easyk\inout\InOutImportType
from return type hinting.
在那里——再次检查(提示:检查第一行——函数signature/declaration)。
您在 "Returns" 部分中看到的是 return 值(例如 "Returns number of items or FALSE on error")的可选(正如您自己注意到的)description/explanation。
实际的 return 类型列在第一行函数签名的末尾。