foo('bar', function () {
if ($conditionA &&
$conditionB
) {
if ($conditionC) {
$a = 1;
}
}
});
After the merge of #2414 solution, the code above started generating the following errors from Generic.WhiteSpace.ScopeIndent:
5 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
7 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
Encountered same with latest version on https://github.com/vimeo/psalm/blob/1f4191fcfaf44a7ec83f99771596acbed8b47169/src/Psalm/Internal/LanguageServer/ClientHandler.php#L78-L82
It's also failing for us with the following report:
FILE: ...race-php/src/DDTrace/Integrations/Symfony/SymfonyIntegration.php
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
50 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
52 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
54 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
59 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
61 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
69 | ERROR | [x] Line indented incorrectly; expected 12 spaces,
| | found 16
| | (Generic.WhiteSpace.ScopeIndent.IncorrectExact)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Time: 1.61 secs; Memory: 12MB
Here are the lines in question. These tests passed when running version 3.4.0 but fail with version 3.4.1.
Debugged this a bit and found it is not related to the change in #2414 , which is also unreleased.
This was actually caused by the fix for #2396
I've committed a fix for this and tested with the code linked in the comments. Thanks for submitting so much to test - made it much easier to fix. This will be in 3.4.2, which I'll try and release quite soon.
Wow - that was fast! Thanks so much @gsherwood! :)
Most helpful comment
I've committed a fix for this and tested with the code linked in the comments. Thanks for submitting so much to test - made it much easier to fix. This will be in 3.4.2, which I'll try and release quite soon.