Reporter | Phoenix Zerin (todofixthis) |
---|---|
Created | Dec 14, 2011 10:09:55 PM |
Updated | Dec 14, 2011 10:09:55 PM |
Priority | Normal |
Type | Feature |
State | Submitted |
Assignee | Alexey Gopachenko (neuro159) |
Subsystem | PHP Inspections |
Fix versions | No Fix versions |
Affected versions | No Affected versions |
On occasion, I will run into a misbehaving inspection. For an example, see WI-7659:
PhpStorm's Undefined Method inspection will complain that $this->_nodes->push() is an undefined method.
I could work around this by moving the @var declaration as described in WI-7659, but since this issue is going to be fixed, I prefer just to suppress the inspection for now and remove it once PhpStorm has been updated:
Once PhpStorm is updated and the Undefined Method inspection correctly recognizes $this->_nodes as an SplDoublyLinkedList, the @noinspection declaration will become superfluous. However, there will be no indicator that the @noinspection declaration can be removed.
Since these sorts of declarations do little more than clutter up my code, I would prefer to have as few of them as possible, so it would be nice if there were an inspection that would let me know when there are unnecessary @noinspection declarations in my code.
class MyClass { protected /** @var SplDoublyLinkedList */ $_nodes, $_index; public function add( $value ) { $this->_nodes->push($value); } }
PhpStorm's Undefined Method inspection will complain that $this->_nodes->push() is an undefined method.
I could work around this by moving the @var declaration as described in WI-7659, but since this issue is going to be fixed, I prefer just to suppress the inspection for now and remove it once PhpStorm has been updated:
class MyClass { protected /** @var SplDoublyLinkedList */ $_nodes, $_index; public function add( $value ) { /** @noinspection PhpUndefinedMethodInspection */ $this->_nodes->push($value); } }
Once PhpStorm is updated and the Undefined Method inspection correctly recognizes $this->_nodes as an SplDoublyLinkedList, the @noinspection declaration will become superfluous. However, there will be no indicator that the @noinspection declaration can be removed.
Since these sorts of declarations do little more than clutter up my code, I would prefer to have as few of them as possible, so it would be nice if there were an inspection that would let me know when there are unnecessary @noinspection declarations in my code.