Skip to content
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

AlphabeticallySortedUses removes filedoc when "use" before and after it #1504

Closed
kkmuffme opened this issue Jan 25, 2023 · 4 comments
Closed
Labels

Comments

@kkmuffme
Copy link

SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses

<?php

use Foo\Bar;

/**
 * bla
 */
use Abc\Xyz;

Will result in:

<?php

use Abc\Xyz;
use Foo\Bar;

completely removing the comment.

Additionally it would be nice if there was an option/rule to set if the "use" statements should be before or after the filedoc

@kukulich
Copy link
Contributor

I think it's not filedoc in this code, it's doccomment for use Abc\Xyz; so for code like this:

<?php

use Abc\Xyz;
use Www;
/**
 * bla
 */
use Foo\Bar;

the output should be:

<?php

use Abc\Xyz;
/**
 * bla
 */
use Foo\Bar;
use Www;

@kukulich kukulich added the Bug label Jan 30, 2023
@kkmuffme
Copy link
Author

I guess since it's the first comment in the file it might be filedoc, but anyways, it shouldn't remove the comment

@kukulich
Copy link
Contributor

kukulich commented Feb 1, 2023

Fixed in d5a5ebb

@kukulich kukulich closed this as completed Feb 1, 2023
@github-actions
Copy link

github-actions bot commented Mar 5, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants