You need to define the type of $_bar in the class
class foo()
{
/**
* @var Bar
*/
private $_bar;
public function __construct($bar)
{
$this->_bar = $bar;
}
public function doStuff()
{
include('doStuffCode.php');
}
}
And then in your included file you hint:
/* @var $this foo */
Which will be the correct way of doing this. All though I'm not sure private variables can be hinted this way due to the scope of the included file contents.