$this in a PHP template engine

There is a page template into purePHP
It is drawn by include in any method of the class

<?php
class SomeClass {

 public function count() { return 0; }
}

class OtherClass {

/**
 * @var SomeClass
*/
 protected $var1;

 function __construct() {
 $this--->var1 = new SomeClass;
}

 function showCount() {
include('showCount.phtml');
}
}


$x = new OtherClass;
$x->showCount();

?>


In the file showCount.phtml content
<?php

// note : $this instanceof OtherClass
echo $this--->var1->count();

?>


Question: How can I help the IDE to enable Code Completition inside the file showCount.phtml to $this variable, which in this context is the essence of class OtherClass?




My version is:
<?php

/**
 * @var OtherClass
*/
$that = $this;

echo $that--->var1->count(); // prompt work
?>
October 3rd 19 at 04:09
3 answers
October 3rd 19 at 04:11
Solution
Try
@var OtherClass $this
Yeah, turns out it works c $this - maximillia.Ho commented on October 3rd 19 at 04:14
October 3rd 19 at 04:13
So, what's wrong in this version, I did so enjoy.
Check yourself — do not blunt :(

It seemed to me that I mix up JS and PHP
In the JS var that = this has to do, in order not to lose context in PHP — only Code to include Complitions - maximillia.Ho commented on October 3rd 19 at 04:16
October 3rd 19 at 04:15
Question: How can I help the IDE to enable Code Completition

Generally depends on the IDE, Eclipse and NetBeans understand:

/* @var $name \class\name */

Find more questions by tags phpDocumentorPHPTemplate builders