@@ -2372,7 +2372,7 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
23722372 class SomeService
23732373 {
23742374 public function __construct(
2375- private UrlGeneratorInterface $router ,
2375+ private UrlGeneratorInterface $urlGenerator ,
23762376 ) {
23772377 }
23782378
@@ -2381,20 +2381,20 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
23812381 // ...
23822382
23832383 // generate a URL with no route arguments
2384- $signUpPage = $this->router ->generate('sign_up');
2384+ $signUpPage = $this->urlGenerator ->generate('sign_up');
23852385
23862386 // generate a URL with route arguments
2387- $userProfilePage = $this->router ->generate('user_profile', [
2387+ $userProfilePage = $this->urlGenerator ->generate('user_profile', [
23882388 'username' => $user->getUserIdentifier(),
23892389 ]);
23902390
23912391 // generated URLs are "absolute paths" by default. Pass a third optional
23922392 // argument to generate different URLs (e.g. an "absolute URL")
2393- $signUpPage = $this->router ->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
2393+ $signUpPage = $this->urlGenerator ->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
23942394
23952395 // when a route is localized, Symfony uses by default the current request locale
23962396 // pass a different '_locale' value if you want to set the locale explicitly
2397- $signUpPageInDutch = $this->router ->generate('sign_up', ['_locale' => 'nl']);
2397+ $signUpPageInDutch = $this->urlGenerator ->generate('sign_up', ['_locale' => 'nl']);
23982398 }
23992399 }
24002400
0 commit comments