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!

4 comments
Comment actions Permalink

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!

0
Comment actions Permalink
Any chances support for this will ever get added?

I don't know.

Don't be shy -- just ask devs in that ticket.

0
Comment actions Permalink

Sorry--from your post count I just assumed you worked for JetBrains.

0

Please sign in to leave a comment.