PHPStorm Meta - how to reference method names in function calls?

I'm not sure how PHPStorm somehow natively supports this, but in PHPUnit, with this code:

$this->mailActivityFactory->expects($this->once())
->method('buildSwitchboardDelayEmailActivity')
->with($this->account->getAccountId(), $mailQueueData)
->will($this->returnValue($this->activity));

If I click on "buildSwitchboardDelayEmailActivity", PHPStorm is able to resolve the method name.

 

I would like to bring the same capability to https://github.com/ramsey/collection, for the following code:


use Ramsey\Collection\AbstractCollection;

class Follow {
public function myMethod(): string {
return 'aaa';
}
}

/**
* @extends AbstractCollection<Follow>
*/
class FollowCollection extends AbstractCollection
{
public function getType(): string
{
return Follow::class;
}
}

// In usage
$col = new FollowCollection():
$col->column('myMethod');

How do I let PHPStorm know to complete for Follow::myMethod in this case?

0

Unfortunately, it's not yet a thing. Please vote for WI-40903.

0

请先登录再写评论。