So the following is a weird issue and while I'm sure people are going to accuse me of bad practice when it comes to how this behavior is happening, for the sake of the project I'm working on, this is the use case, and I'd love to know if I'm missing something.
I have the following situation
class foo()
{
private $_bar;
public function __construct($bar)
{
$this->_bar = $bar;
}
public function doStuff()
{
include('doStuffCode.php');
}
}
doStuffCode.php:
$this->_bar->(this is where I'd like to get some type hinting)
I've tried to drop in /* var $this->_bar Bar */
but that doesn't seem to do anything for me. It seems like I can't add type-hinting to a specific class variable. The workaround for now has been to set up a temporary variable called $bar, set the type hinting on it, then use it to get the methods I'm looking for and copying them back into the right context.
I'm curious if I'm just trying something wrong, doing something unsupported, misunderstanding how I should be declaring the javadoc, or have a fundamental misunderstanding of how this type-hinting should be working.
Thanks for the help