How to make certain magic methods not trigger "unused declaration" inspection?
PHP magic methods are quite common, and they usually trigger the "unused declaration" inspection in PHPStorm.
I saw there's an "Entry points" setting, but I'm not sure it's suited to fix those cases.
For instance, I'm using Laravel's Eloquent, and every method beginning with "scope" inside a class inheriting from Eloquent\Model is suited to a magic call.
Is it possible to do that, or should I fill a feature request?
Please sign in to leave a comment.
Basically, there is a generic feature request ticket for the "Unused declaration" in Laravel reported already:
https://youtrack.jetbrains.com/issue/WI-49024
Please feel free to leave a comment with examples there.
Igor Santos Yes, it is possible to disable that inspection by using the `Entry points`.
In the PHPStorm, go to:
And add this pattern:
\App\*
(or\App\Models\*
);scope*
;After that, all
scope*
methods in the specified namespace would be ignored by that inspection.I hope it helps!