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
When we have a non used use statement and move a FQCN inline to a use statement, it can get lost
namespace Spryker; use Org\App\BazBatInterface; // seen as unused class Test { protected \Org\App\BazBatInterface $bazBat;
becomes
namespace Spryker; class Test { protected BazBatInterface $bazBat;
and not recoverable FQCN / use statement
The text was updated successfully, but these errors were encountered:
I tried squizlabs/PHP_CodeSniffer#3620 (comment) as per the comment
diff --git a/Spryker/Sniffs/Namespaces/UseStatementSniff.php b/Spryker/Sniffs/Namespaces/UseStatementSniff.php --- a/Spryker/Sniffs/Namespaces/UseStatementSniff.php (revision 0640063a7ae52af8f08a0e4b9e63b334ed529069) +++ b/Spryker/Sniffs/Namespaces/UseStatementSniff.php (date 1655979560894) @@ -684,6 +684,10 @@ if ($addedUseStatement['alias'] !== null) { $phpcsFile->fixer->replaceToken($lastIndex, $addedUseStatement['alias']); + for ($i = $startIndex; $i <= $lastSeparatorIndex; $i++) { + $phpcsFile->fixer->replaceToken($i, $tokens[$i]['content']); + } + $phpcsFile->fixer->replaceToken($lastSeparatorIndex + 1, $tokens[$lastSeparatorIndex + 1]['content']); } $phpcsFile->fixer->endChangeset();
but didnt seem to have any effect yet.
Sorry, something went wrong.
No branches or pull requests
When we have a non used use statement and move a FQCN inline to a use statement, it can get lost
becomes
and not recoverable FQCN / use statement
The text was updated successfully, but these errors were encountered: