Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
robinjonsson opened this issue Feb 1, 2019 · 1 comment
Milestone

Comments

@robinjonsson
Copy link

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)

@gsherwood gsherwood added this to the 3.4.1 milestone Feb 11, 2019
@gsherwood gsherwood changed the title Generic.WhiteSpace.ScopeIndent incorrect error when multi-line statement mixed with HTML Generic.WhiteSpace.ScopeIndent incorrect error when multi-line IF condition mixed with HTML Feb 11, 2019
gsherwood added a commit that referenced this issue Feb 11, 2019
… multi-line IF condition mixed with HTML
@gsherwood
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants