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/MultipleStatementAlignment: false positive with non-scoped control structures #2578

Closed
jrfnl opened this issue Aug 9, 2019 · 1 comment

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Aug 9, 2019

Ported over from: #2529 (comment)

$phrase = 'phrase';
if ($a === true)
    if ($b === true)
        $phrase = 'another phrase';
else
    $phrase = 'different phrase';

Throws:

 3 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 9
   |         |     spaces but found 1 space
   |         |     (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
 8 | WARNING | [x] Equals sign not aligned with surrounding assignments; expected 5
   |         |     spaces but found 1 space
   |         |     (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)

Caused by the control structure not having any braces.

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 2, 2023

Closing as replaced by PHPCSStandards/PHP_CodeSniffer#16

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant