Skip to content

Generic.WhiteSpace.ScopeIndent incorrect error when multi-line IF condition mixed with HTML #2396

Closed
@robinjonsson

Description

@robinjonsson

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:

skarmavbild 2019-02-01 kl 12 20 12

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions