-
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
PSR2/UseDeclaration: allow comments after the last USE statement #1893
PSR2/UseDeclaration: allow comments after the last USE statement #1893
Conversation
@@ -142,7 +142,7 @@ public function process(File $phpcsFile, $stackPtr) | |||
return; | |||
} | |||
|
|||
$next = $phpcsFile->findNext(T_WHITESPACE, ($end + 1), null, true); | |||
$next = $phpcsFile->findNext([T_WHITESPACE, T_PHPCS_IGNORE, T_COMMENT], ($end + 1), null, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to use Tokens::$EmptyTokens
instead for completeness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Updated!
d7dc100
to
b569625
Compare
b569625
to
f147caf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this should go into 3.2.3 as it involved the new PHPCS annotations (aside from normal comments).
Thanks a lot for fixing this, and for the test. |
This appears to have caused a regression, please see #1898 |
OK - the regression here is that this allows you to do: use Class; // comment but it now causes this to fail: use Class;
//comment Because the test fixture tried to evaluate both at once it appeared to fix the problem, but it actually caused a regression instead |
Resolves #1891