我可以有一个类型提示的数组SomeObject当使用列表


Can I have a typehint for array of SomeObject when using list?

我有一个生成SomeObject[]数组的方法。

/**
 * @return SomeObject[]
 */
private function thatMethod()
{
    ...
    return [$someObject, $someOtherObject, $yetAnotherObject]
}

然而当我通过list读取对象时

list($someObject, $someOtherObject, $yetAnotherObject) = $this->thatMethod();

我丢失了这些对象的typehint。我必须通过@var SomeObject $someObject明确地提示它们。我宁愿不这样做。

在PhpStorm9中使用list时,是否有方法获得类型提示?

PhpStorm目前还不能这样做。

有一张票要照看。标记/投票/评论以获得进度通知