Autocomplete for @return not working, works for @var
I'm using PhpStorm 8.01 on Windows 7 x64. I have this phpdoc block in a class:
/**
* @param $member_id
* @return FlockEx[][]
*/
public function getFlocksByMemberId($member_id)
{...}
Whenever I loop through this array, the autocomplete isn't working. I decided to use @var instead and the autocomplete does work though:
/**
* @var Broilers\FlockEx[][] $x
*/
$x = $flock_repository->getFlocksByMemberId(1);
foreach($x as $farm_key => $farm_id) {
foreach($farm_id as $flock) {
$flock->getAgeDays(); //If I type ->get... the list appears
}
}
I was curious if this is a bug or by design. I figured since @var works, PhpStorm would detect the @return value the same. Thanks!
请先登录再写评论。
Hi there,
https://youtrack.jetbrains.com/issue/WI-16786 ??
Yes--that is the exact issue I'm facing. It works fine for a one-dimensional array, but not for nested arrays. Any chances support for this will ever get added? Thanks!
I don't know.
Don't be shy -- just ask devs in that ticket.
Sorry--from your post count I just assumed you worked for JetBrains.