phptools-docs
phptools-docs copied to clipboard
Same use statement added twice
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).
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);
Thanks, this happens while there is a syntax error and the same import is added twice. Fixed in the next update.