Support for dynamic autocompletion PhpStorm 2.x


There was a feature in PhpStorm 1.x, that allowed to write like this:

class Dummy_Object1 {
     public function object1_func1() {}
     public function object1_func2() {}

class Dummy_Object2 {
     public function object2_func1() {}
     public function object2_func2() {}

class Dummy_Factory {
      * Factory method
      * @param string $name
      * @return Dummy_$name      <------ variable in phpdoc declaration
     public static function createDummy($name) {
          $name = 'Dummy_' . $name;
          return new $name();

// then we try to use the factory

Dummy_Factory::createDummy('Object1')-> [Ctrl-Space] - here goes Object1's parameters autocompletion
Dummy_Factory::createDummy('Object2')-> [Ctrl-Space] - here goes Object2's parameters autocompletion

Unfortunately, when I installed PhpStorm 2, i've noticed this type of autocompletion didn't work anymore. Moreover, when I attended CodeFest 2011 in Novosibirsk and met there Phpstorm's developers, they told me - "oh? that was a bug in phpstorm 1.x, so that was fixed in 2.0". :O Is that really so? Is there any chance to re-add this bug/feature in following releases? Or maybe are there any other means to get such autocomplete on factory methods?
1 comment
Comment actions Permalink

Some support for the factory-pattern would be excellent!


Please sign in to leave a comment.