【发布时间】:2017-11-23 23:30:27
【问题描述】:
我真的很喜欢 PhpStorm 和它的文档生成器 phpDoc。现在我在快速文档中处理返回类型提示。例如我有这个代码:
$import_type = $this->importContainer->getType()->getSelectedSchema();
在ImportContainer 类中我有这个getType 方法:
/**
* @return \Easyk\inout\InOutImportType
*/
public function getType() {
return $this->type;
}
一切正常,但是当我想使用 PhpStorm 的快速文档时,我会看到:
并且没有任何返回值,返回类型提示应该是\Easyk\inout\InOutImportType。我发现如果我有这种类型的提示:
/**
* @return \Easyk\inout\InOutImportType $importType
*/
然后我会看到返回值:
根据@return 语法中的phpDoc documentation,描述是可选的,那么为什么我必须描述返回值才能在快速文档中看到它?对我来说,最好只是在快速文档中查看确切的返回类型提示 - 无需描述。我在 PhpStorm 中没有找到任何启用它的选项,是否有任何解决方法或者我错过了什么并且做错了?
我正在使用 PhpStorm 2017.1.4
【问题讨论】:
标签: return documentation phpstorm phpdoc type-hinting