Inspections say: Method ... not found, but why?
Hello
In normal cases this is right. But in the follow-thing is a problem to display this:
$ldbl = new $lctable();
$ladata = $ldbl->getOneWhere($pcfield." = '".$pcvalue."'"); // > getOnwWhere not found (can i set to off to check this?)
Anybody have an idea?
请先登录再写评论。
Hi Raffael,
What do you mean "why"?
This is your code: $ldbl = new $lctable(); -- you are creating instance of UNKNOWN (to me and IDE) class -- you are creating it via variable instead of providing class name directly. There is nothing wrong with this -- just IDE is not THAT advanced to interpret such situations (especially if value of such variable is set during runtime only). During runtime it works just fine (the nature of PHP), but how should I or PhpStorm know what class should be there?
The solution -- add typehint via PHPDoc comment for that local variable, for example:
Yes this is that what i search :)
Thanks for help.