【发布时间】:2014-07-29 18:35:30
【问题描述】:
我有一些伪代码
<?php
namespace Parent {
class Helper{
public $a;
}
class Test{
/**
* @var Helper
*/
public $helper;
public function __construct() {
$reflection = new \ReflectionClass($this);
$name = $reflection->getNamespaceName() . "\Helper";
$this->helper = new $name;
}
}
}
namespace Child {
class Helper{
public $b;
}
class Test extends \Parent\Test {}
}
在这个 PHPDoc 属性中,\Child\Test->helper 有指向 \Parent\Helper 的链接。
对于 PHPStorm 和 phpDocumentor,@var Helper 等于 @var \Parent\Helper。当尝试在\Child\Test 中获取$this->helper 的自动完成功能时,我只能从\Parent\Helper 获取方法
我应该如何重写我的 phpdoc 块?
【问题讨论】: