phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Same use statement added twice

Open php4fan opened this issue 1 year ago • 2 comments

image

Most, if not all, of the use statements above were added automatically by using autocomplete. That is, when I used any of those types for the first time, I typed it without the FQCN and I used autocomplete, and that automatically added the corresponding use statement.

Somehow it ended up adding one of them twice, which is something that should never happen under any circumstances, and there's nothing I could possibly had done wrong myself to justify that (unless I manually added the second one myself which is not the case).

php4fan avatar Feb 16 '24 20:02 php4fan

It seems to happen systematically if I first use the class like this:

public function __construct(UrlGeneratorInterface $router) {

and then, somewhere else, I use it like this (for the first time):

$whatever = $this->router->generate('app_whatever', [], UrlGeneratorInterface::ABSOLUTE_URL);

php4fan avatar Feb 16 '24 21:02 php4fan

Thanks, this happens while there is a syntax error and the same import is added twice. Fixed in the next update.

jakubmisek avatar Mar 29 '24 18:03 jakubmisek