phptools-docs
phptools-docs copied to clipboard
Import class name that is already in use
Hello,
I'd love to have a check if a class name is imported that is already present. It would be great to have some input box to provide the "as" alias. Even greater if that would contain some suggestion as placeholder.
Example:
class LoggerInterface implements \Psr\Log\LoggerInterface {
Using the "use \Psr\Log\LoggerInterface" action it adds use Psr\Log\LoggerInterface; which then throws the error: Cannot redeclare class/interface 'LoggerInterface'
The action should be able to detect that LoggerInterface is already used in the class and provide some input like for symbol renaming:
There you would be able to enter some value like PsrLoggerInterface which then results in the following output:
use Psr\Log\LoggerInterfac as PsrLoggerInterface;
class LoggerInterface implements PsrLoggerInterface {
I hope the request is clear enough, else I'll provide some other example.
Hi @Morgy93
Thank you for your feedback and suggestions.
The upcoming update 1.41 will (at least) underline errors/warnings in the Preview window (when confirming with Shift+Enter).