I have the following class structure
I'm using Symfony2's service to manage the BaseHandler
and BaseManager
classes
class BaseHandler implements IHandler
{
/**
* @var IManager
*/
protected $manager;
...
public function setManager(IManager $manager)
{
$this->manager = $manager;
}
...
}
All works fine, but the problem is when I try to use some methods of SpecializedManager
class and the PhpStorm's suggestions doesn't show their methods, only methods belonging to IManager
.
For example in my controller
public function indexAction(){
$handler = $this->get('appbundle.handler.specialized_handler');
$items = $this->manager->mySubClassMethod(); // PHPStorm shows warning
...
}
I don't know how to set in the handler subclass the annotation of var manager
to change to something like this @var SpecializedHandler $manager
, neither another alternative ways for methods appear in the suggestions.
NOTE: the base class or extended for multiples specialized subclasses.