Netbeans autocomplete on $ this-> delegated object

I am using Netbeans and I love it.

However, my scenario is that when I want to use object B in object A, I cannot use the autocomplete function on $this->B->

(Yes, I know, there is a syntax error in the code below, the question is not syntax).

So for example:

require_once('Legion.class.php');

class MyClass {

    private $Legion;

    public function __construct() {
        $this->Legion = Legion::getInstance();
    }

    public function showResult() {
        $this->Legion->   //Not works here

        $Legion = $this->Legion;
        $Legion-> //Works
    }

}

      

When I scored $this->Legion->

, I have some basic functions, keywords, such as do

, echo

, while

and etc ....

But if I create a new variable for this B object, then I return all methods and properties available to it.

After that I also tried to use vdoc

without success:

/* @var $Legion Legion */
/* @var $this->Legion Legion */

      

Has anyone faced this problem? Is there a solution for this?

+3


source to share


1 answer


Try to use the correct PHP Doc

 /** 
 * My Legion
 * @var Legion
 */
private $Legion;     

      



-> http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.var.pkg.html

+6


source







All Articles