We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example code:
<?php $a = function () {}; $b = fn ($a) => $a; return 1;
Tokens:
00: T_OPEN_TAG => <?php\n 01: T_WHITESPACE => \n 02: T_VARIABLE => $a 03: T_WHITESPACE => · 04: T_EQUAL => = 05: T_WHITESPACE => · 06: T_CLOSURE => function 07: T_WHITESPACE => · 08: T_OPEN_PARENTHESIS => ( 09: T_CLOSE_PARENTHESIS => ) 10: T_WHITESPACE => · 11: T_OPEN_CURLY_BRACKET => { 12: T_CLOSE_CURLY_BRACKET => } 13: T_SEMICOLON => ; 14: T_WHITESPACE => \n 15: T_WHITESPACE => \n 16: T_VARIABLE => $b 17: T_WHITESPACE => · 18: T_EQUAL => = 19: T_WHITESPACE => · 20: T_FN => fn 21: T_WHITESPACE => · 22: T_OPEN_PARENTHESIS => ( 23: T_VARIABLE => $a 24: T_CLOSE_PARENTHESIS => ) 25: T_WHITESPACE => · 26: T_FN_ARROW => => 27: T_WHITESPACE => · 28: T_VARIABLE => $a 29: T_SEMICOLON => ; 30: T_WHITESPACE => \n 31: T_WHITESPACE => \n 32: T_RETURN => return 33: T_WHITESPACE => · 34: T_LNUMBER => 1 35: T_SEMICOLON => ; 36: T_WHITESPACE => \n
Test:
$phpcsFile->findEndOfStatement(4); // result 13 - correct $phpcsFile->findEndOfStatement(18); // result 35 - incorrect, expected 29
The text was updated successfully, but these errors were encountered:
Hotfix: detecting end of statement with PHP 7.4 fn closure
6c2020a
Fixes squizlabs#2748
Custo findEndOfStatement in ScopeIndent sniff as the original one has…
e38d51c
… a bug The function File::findEndOfStatement has a bug in finding end of statement for fn closures, see: squizlabs/PHP_CodeSniffer#2748
1be4196
Changelog + unit test rename for #2748 (ref #2749)
f0ec2ab
Successfully merging a pull request may close this issue.
Example code:
Tokens:
Test:
The text was updated successfully, but these errors were encountered: