-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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.WhiteSpaceScopeIndent closure argument indenting incorrect with multi-line strings #1637
Comments
Shorter code to replicate: <?php
public function foo()
{
$foo('some
long description', function () {
});
} Scope indent debug output:
Problem is here:
The indent should be set to 8, but the first non-whitespace token on the line is a multi-string at column 0, so it can't be used to determine indent in this case. The indent checks needs to go back another line to find the true indent. |
…nting incorrect with multi-line strings
I've committed a fix for this issue, which required checks for multi-line strings when opening and closing closures. Thanks for reporting it. |
Hello,
I'm using Sniffer to lint the test code which is using Codeception\Specify in the code.
Problem
When doing this:
After running phpcbf
What I expected
Sniff should not adjust the indent of the first code.
Solution ?
Should we include
T_CONSTANT_ENCAPSED_STRING
when finding the first token position of the line ?The text was updated successfully, but these errors were encountered: