Skip to content

Commit 9c4728f

Browse files
Chaning RouterInterface => UrlGeneratorInterface
Further up on the page it's advised to use `UrlGeneratorInterface` as typehint. I don't know what the difference is, but I'm guessing that it saves you from `use RouterInterface` (if you need the `UrlGeneratorInterface` for something else anyway, as in this example). Is this right?
1 parent 013b6d1 commit 9c4728f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routing.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,13 +2394,12 @@ Now you'll get the expected results when generating URLs in your commands::
23942394
use Symfony\Component\Console\Input\InputInterface;
23952395
use Symfony\Component\Console\Output\OutputInterface;
23962396
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
2397-
use Symfony\Component\Routing\RouterInterface;
23982397
// ...
23992398

24002399
class SomeCommand extends Command
24012400
{
24022401
public function __construct(
2403-
private RouterInterface $router,
2402+
private UrlGeneratorInterface $router,
24042403
) {
24052404
parent::__construct();
24062405
}

0 commit comments

Comments
 (0)