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

Require certain namespaces to always use the same alias #1617

Open
TravisCarden opened this issue Sep 7, 2023 · 0 comments
Open

Require certain namespaces to always use the same alias #1617

TravisCarden opened this issue Sep 7, 2023 · 0 comments

Comments

@TravisCarden
Copy link

I want specific classes to always be aliased with the same names. For example, I want these classes to always and only be aliased like this:

use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
use Symfony\Component\Process\Process as SymfonyProcess;

Never like this, for example:

use Symfony\Component\Filesystem\Filesystem; # No alias.
use Symfony\Component\Process\Process as SomeNonStandardAlias;

I looked over https://github.com/slevomat/coding-standard/blob/master/doc/namespaces.md and didn't find anything that does this. If I'm not overlooking one, would you consider adding it? I would be willing to help with a PR--though I only consider myself an "advanced beginner" with writing rules, so I might need some direction to write one well (and add tests?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant