Answer the question
In order to leave comments, you need to log in
How to make friends PHPShorm and external variables?
There is a head.php file.
This file declares variables like $login, $login_id, ... (etc)
This file is included in all project interfaces, and as a result, variables are actively used.
PHPShorm swears that it does not see these variables:
In principle, one can not discuss the fact that such a format for using variables is evil, since we are talking about project support with a minimum of refactoring.
So hence the question. Is it possible to somehow make friends PhpSHtorm and external variables without disabling code inspection?
Thank you.
Answer the question
In order to leave comments, you need to log in
Is the file in a project? Is it included in the required file (include/require)? If yes, then PhpStorm should pick up the variables itself. If not, or they are declared in a "magical" way (as in Yii, for example), then you need to use PHPDoc:
/**
* @var int $login_id
*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question