A small issue, phpstorm not finding a function.


Hey everyone,

I'm currently recoding everything from functional programming to oop since it looks nicer and is more common. But I'm facing this issue. Please see the images below:

I'm looking up some guides to see if I'm doing it wrong. I'm very self conscious am I doing something wrong? Is this normal? I looked up an object oriented mysqli connection and data retrieval I didn't see much of a difference of what I'm doing.

All the best,


edit: forgot to mention, the code you see does work fully.

Comment actions Permalink

Hi there,

What exactly does not work?

My best guess so far .. is that IDE doe snot offer code completion after "$this->driver->" or "$this->browser->". If that's so --  provide proper typehints to those variables using PHPDoc comments, e.g.

class myClass {

/** @var \Some\BrowserClass */
private $browser;

Right now IDE does not know what type $browser field is so cannot give you proper suggestions. This is because your start_browser() function does not provide proper return type (which you can provide using PHPDoc .. or PHP own mechanics (PHP 7.x)).

Comment actions Permalink

That was the issue! Thank you very much I've learned phpdocs now very convenient!


Please sign in to leave a comment.