R
R
Roman Revin2013-08-21 13:41:49
PHP
Roman Revin, 2013-08-21 13:41:49

Chain style and code completion in PhpStorm 6.0.3

Good afternoon. Faced a problem (quite a long time ago, but now it's already rooted). The bottom line is that I describe the call of class methods in chain-style form. And the IDE stops defining methods after the second step. For example:

$Users = User::find()->filterByRole('manager')->orderBy('name')->limit(20)->all();

PhpStorm successfully highlights the filterByRole and order methods, but the limit and all methods can no longer be determined.
If the method call is divided into parts, then everything will be highlighted normally. Example:

$UserQuery = User::find();
$UserQuery->filterByRole('manager')->orderBy('name');
$Users = $UserQuery->limit(20)->all();

Has anyone experienced this behavior? Did you manage to solve?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2013-08-21
@nazarpc

Add a PhpDoc section before each method.

D
Daedmen, 2013-08-21
@Daedmen

It’s better for them to write to the bug tracker youtrack.jetbrains.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question