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.Formatting.DisallowMultipleStatements errors when mutliple short echo tags are used on the same line #1156

Closed
nkovacs opened this issue Sep 12, 2016 · 0 comments

Comments

@nkovacs
Copy link
Contributor

nkovacs commented Sep 12, 2016

In #423 you made an exception to Generic.Formatting.DisallowMultipleStatements for multiple php open/close tags in the same line.

This works inconsistently. The following are all okay:

<div class="<?php echo $class; ?>" id="<?php echo $id; ?>"></div>
<div class="<?php echo $class ?>" id="<?php echo $id ?>"></div>
<div class="<?= $class ?>" id="<?= $id ?>"></div>

But this isn't:

<div class="<?= $class; ?>" id="<?= $id; ?>"></div>

I've added a failing test: https://github.com/nkovacs/PHP_CodeSniffer/tree/disallow-multiple-statements-bug

nkovacs added a commit to nkovacs/PHP_CodeSniffer that referenced this issue Sep 12, 2016
nkovacs added a commit to nkovacs/PHP_CodeSniffer that referenced this issue Sep 12, 2016
@gsherwood gsherwood changed the title DisallowMultipleStatements exception for open/close tags works inconsistently Generic.Formatting.DisallowMultipleStatements errors when mutliple short echo tags are used on the same line Sep 12, 2016
gsherwood added a commit that referenced this issue Sep 12, 2016
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