Closed davidkmenta closed 5 years ago
That doesn't look like an error message generated by one of the included sniffs. What coding standard are you using? Please also run PHPCS with the -s
command line argument so it also indicates what sniff generated that error message.
@gsherwood yop, you're right, my mistake. It's caused by the SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountBeforeControlStructure
sniff. But I can't say if it is an error in that sniff or it's a general problem in PHPCS...
But I can't say if it is an error in that sniff or it's a general problem in PHPCS...
It looks like a sniff problem. I've checked PHPCS and it is tokenising the content correctly (including assigning different tokens to the enable and disable lines) so the sniff itself is probably not taking those enable/disable comments into account.
I'm getting a weird error when I'm using partial ignoring.
Here is part of my code:
The error I'm getting:
29 | ERROR | [x] Expected 1 lines before "foreach", found 0.
If I use the
// phpcs:ignore Generic.PHP.ForbiddenFunctions
comment instead, everything is fine.