Tar
Tar

Reputation: 9045

How do I make PhpStorm suggest a list of predefined input variables?

How do I make PhpStorm suggest input variables ?

In Java/C# and the like (with VS/Eclipse), when I have a function that receives enum-input-variable, like:

void func(SomeEnum var);

Whenever I type func(, the editor kindly suggests all the available enums (of type SomeEnum). I look for this same functionality in PHP, when I have a predefined set of input options (like DB's tables).

Maybe with the use of Intellilang or these @ tags (PHPDocs ?) I can predefine such list ?

Upvotes: 1

Views: 1338

Answers (1)

LazyOne
LazyOne

Reputation: 165471

Currently you cannot limit the possible options for code completion in this regard: PHP simply has no such "thing" similar to Enum. The only limitation you can do is limit by expected parameter type (e.g. int variable will not be offered when parameter expects an array).

I think this will be the correct ticket to look for: http://youtrack.jetbrains.com/issue/WI-854 and maybe http://youtrack.jetbrains.com/issue/WI-3623

Kind of related (for array indexes completion): http://youtrack.jetbrains.com/issue/WI-3423

Upvotes: 2

Related Questions