如何在phpstorm中为代码完成注释类

Suppose I have a class

class Class1
{
    public function method1(){
        return "hello world";
    }

}

and I have another class that uses this in a class

class Class2
{
     /** @var $firstClass Class1 */
     private $firstClass;

     public function __construct($firstClass)
     {
            $this->firstClass = $firstClass;

     }

     public function method2()
     {
            return $this->firstClass-> "I want code completion to work here"
     }
 }

How do I get the code completion to work using PHPDoc. I've searched phpdoc for scope, declaration, all kinds of stuff. I can't figure out the terms or placement of the comment line for phpdoc to pick this up.

I'm using phpstorm. Help!

查看全部
doushen2154
doushen2154
2013/09/25 01:56
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复