Php_codesniffer: Generic.WhiteSpace.ScopeIndent incorrect error when multi-line IF condition mixed with HTML

Created on 1 Feb 2019  路  1Comment  路  Source: squizlabs/PHP_CodeSniffer

Hi,

I get this error when I mix HTML blocks with multiple statements
[phpcs] Line indented incorrectly; expected 2 tabs, found 3

__Sample code:__

<?php

if (true) {
    ?>
    <div>
        <?php

        if (true) {
            ?>
            <?php
        }

        if (true
            || false) {
            ?> <!-- error here -->
            <?php
        }

        ?>
    </div>
    <?php
}

?>

__Screenshot:__
:x:

skarmavbild 2019-02-01 kl 12 20 12

:white_check_mark:

skarmavbild 2019-02-01 kl 12 20 38

skarmavbild 2019-02-01 kl 12 20 56

__Version:__
PHP_CodeSniffer version 3.4.1 (stable) by Squiz (http://www.squiz.net) (Git clone 2019-02-01)

Bug

Most helpful comment

Thanks for reporting this. The fix will be in 3.4.1.

>All comments

Thanks for reporting this. The fix will be in 3.4.1.

Was this page helpful?
0 / 5 - 0 ratings