Open puggan opened 8 months ago
This sounds like a duplicate of known issue https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/149
Also, please don't open issues in this repo anymore. This repo is abandoned and https://github.com/PHPCSStandards/PHP_CodeSniffer is its successor. See: #3932
Describe the bug
I get false positive
Generic.WhiteSpace.ScopeIndent.IncorrectExact
when an foreach has an heredoc in it.Code sample
Custom ruleset
using a psr12 ruleset, but get the same error but for
PEAR.WhiteSpace.ScopeIndent.IncorrectExact
when running with a fresh clone of this repo.To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs -s --sniffs="PEAR.WhiteSpace.ScopeIndent" test.php ...
or with my config, i get Generic instead of PEAR:
Expected behavior
I expect both row 18 and 19
if ($b) {
should have the same indentation, 8 spaces. So instead of the warning, it shouldexpect 8 and found 8
, and therefor not show the warning.Versions (please complete the following information)
PHP_CodeSniffer version 3.8.0 (stable) by Squiz and PHPCSStandards
Additional context
Workaround: move the heredoc before the foreach.
Please confirm:
master
branch of PHP_CodeSniffer.