You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
18 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
19 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
23 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
The lines reported are the one before the default clause, the line with the default clause, and the ending array of the default clause. There errors always seem to start at the end of the second array, with or without a default clause. When using other types instead of arrays no errors occur.
The text was updated successfully, but these errors were encountered:
iquito
changed the title
Wrongly assumed match indentation with arrays
Wrongly assumed indentation with match and arrays
Mar 31, 2021
Match checking in findStartOfStatement needed to skip over short arrays and function calls etc, so now using findEndOfStatement for that. That exposed a bug in findEndOfStatement when checking a match arrow directly, which is now also fixed.
Match checking in findStartOfStatement needed to skip over short arrays and function calls etc, so now using findEndOfStatement for that. That exposed a bug in findEndOfStatement when checking a match arrow directly, which is now also fixed.
Thanks a lot for testing master and reporting this. This was caused by match expression support in findStartofStatement and findEndOfStatement being incorrect. Once fixing those, the sniff reports indentation correctly.
Using PSR-12 with current
dev-master
the PHP8match
clause and arrays have a "wrong" indentation interaction:Reports the following errors:
The lines reported are the one before the default clause, the line with the default clause, and the ending array of the default clause. There errors always seem to start at the end of the second array, with or without a default clause. When using other types instead of arrays no errors occur.
The text was updated successfully, but these errors were encountered: