Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
912 stars 137 forks source link

Marking "Missing method" as an error #1136

Open viktorasp opened 6 years ago

viktorasp commented 6 years ago

Currently when a method from DI service is not found, there is no visual warning/notification.

When working with services and their methods, hitting [ctrl + space] after $this->get('foobar.service')-> will present a list of methods available for this service, thanks to this fantastic plugin. However, if to type in a non-existent method name, like $this->get('foobar.service')->getName(), it does not matter if getName() does exist or not - it will be displayed the same, without any visual cue indicating the absence/mistype of method name. Hovering mouse over, running inspections, etc. will never report it as a missing method.

The only option to solve it, is to do something like:

/* @var $foobar \Bundle\FoobarBundle\Service\Foobar */
$foobar = $this->get('foobar.service');
$foobar->getName();

however that is a totally different behaviour, as it targets Phpstorm's functionality directly.

freyr commented 6 years ago

Is there any chance that this issue will be addressed? Even answer "won't do" or "won't fix" will be something...

cedricziel commented 6 years ago

I'll take a look, but I can't tell when.

freyr commented 6 years ago

thanks :) it's a minor thing, but it's very inconvenient to add comments for every service...