Autocompletion of methods and properties of a class
Hello !
I conducted a little experiment for auto completion.
--------------------------------
class controller {
public function __construct(){
// ...
}
public function testAction(){
$model = new model();
$dependency1 = new dependency1();
$model->dependency1 = $dependency1;
$dependency2 = new dependency2();
$model->dependency2 = $dependency2;
}
}
class model {
/**
* @var dependency1
*/
public $dependency1;
/**
* @var dependency2
*/
public $dependency2;
public function foo(){
$this->dependency1->test1();
}
}
class dependency2 {
public function test2(){
return 'test2';
}
}
class dependency1 {
public function test1(){
return "test1";
}
}
$controller = new controller();
$controller->testAction();
----------------------------------------
In the model I have provided the properties with a PhpDoc comment.
The completion of works.
When I use the model provided the property dependency1 PhpDoc with this, then it does not work.
/ **
* @ Var Zend_Db_Adapter
* /
public $ dependency1;
What am I doing wrong?
Sorry for my bad English.
Sincerely
Stephan
请先登录再写评论。