Closed mvar closed 8 years ago
I'm assuming you are talking about the side effects warning from PSR1/2. If that is the case, the error is reported on line 1 as it applies to the entire file and not a specific line. The only way to mute that error is to ignore the entire file or exclude it using the --ignore
command line argument.
The reason for this is that wrapping code with the ignore start/end comments just mutes errors reported on those lines. It doesn't make those parts of the file invisible to checking.
To ignore the entire file, put the comment // @codingStandardsIgnoreFile
somewhere near the top of your file (anywhere is actually file, but performance is better the higher you place it in the file).
Does that help?
Thanks for reply. I got it! I don't want to ignore whole file (because I have a lot of deprecated classes). I think it's better to skip Code Sniffer warnings (-n
).
Lets talk a little bit more about deprecated classes. An idea to trigger error I took from Symfony source code. I think that's really useful for end user. Sadly code like this does not comply PSR2. Mmm.. Maybe I need to address my issue to php-fig?
I think it's better to skip Code Sniffer warnings (-n).
Yes, also a good option.
Sadly code like this does not comply PSR2. Mmm.. Maybe I need to address my issue to php-fig?
That might be a good idea. I'm not aware of any existing PHP-FIG discussions around deprecation.
I'll close this issue now that you know what is going on. Thanks for getting back to me.
Thanks for answers.
If you are interested in this topic you can follow issue on php-fig/fig-standards#714
Code:
Code Sniffer generates warnings for
trigger_error ()
even when it is wrapped in@codingStandardsIgnore
. Is there a way to silent these warnings?