Reputation: 8573
In view templates, I'm seeing a lot of warnings to do with undefined fields on objects and undefined variables. I want to disable them.
Upvotes: 2
Views: 1031
Reputation: 165471
You can provide type hints via standard PHPDoc comments -- just place such block at the top of the file and declare all variables used so they will be recognized and offered in code completion (yes, you can provide type hint for $this
this way as well):
<?php
/** @var \My\ViewRendererClass $this */
/** @var string $abcd */
...
?>
<div class="container">
...
In case if you actually need to disable certain inspection in whole file (or bunch of files) -- do this at Scope/Inspection level:
Settings/Preferences | Appearance & Behaviour | Scopes
) and include all such filesSettings/Preferences | Editor | Inspections
find desired inspection and add new rule for that scope, e.g. disable for that scope but enabled in all other places.Upvotes: 3