diff --git a/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php b/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php
index 82c71377a77d2c669d59e6d8c4922b7912fc0481..bbdeaab0a1e61fcba481a0947d1f16f95d78f30e 100644
--- a/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php
+++ b/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php
@@ -57,7 +57,7 @@ public function setContext(SymfonyRequestContext $context) {
   /**
    * {@inheritdoc}
    */
-  public function getContext() {
+  public function getContext(): SymfonyRequestContext {
     return $this->urlGenerator->getContext();
   }
 
diff --git a/core/lib/Drupal/Core/Routing/AccessAwareRouter.php b/core/lib/Drupal/Core/Routing/AccessAwareRouter.php
index b13006ca3f058e0b909181ddaf1b035092dade59..0e18492567d4c9794d5e3f1cdc06b7af1eb8417c 100644
--- a/core/lib/Drupal/Core/Routing/AccessAwareRouter.php
+++ b/core/lib/Drupal/Core/Routing/AccessAwareRouter.php
@@ -9,10 +9,8 @@
 use Drupal\Core\Session\AccountInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
-use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
 use Symfony\Component\Routing\RouteCollection;
 use Symfony\Component\Routing\RequestContext as SymfonyRequestContext;
-use Symfony\Component\Routing\RequestContextAwareInterface;
 use Symfony\Component\Routing\RouterInterface;
 
 /**
@@ -23,7 +21,7 @@ class AccessAwareRouter implements AccessAwareRouterInterface {
   /**
    * The router doing the actual routing.
    *
-   * @var \Symfony\Component\Routing\Matcher\RequestMatcherInterface
+   * @var \Symfony\Component\Routing\RouterInterface
    */
   protected $router;
 
@@ -44,14 +42,14 @@ class AccessAwareRouter implements AccessAwareRouterInterface {
   /**
    * Constructs a router for Drupal with access check and upcasting.
    *
-   * @param \Symfony\Component\Routing\Matcher\RequestMatcherInterface $router
+   * @param \Symfony\Component\Routing\RouterInterface $router
    *   The router doing the actual routing.
    * @param \Drupal\Core\Access\AccessManagerInterface $access_manager
    *   The access manager.
    * @param \Drupal\Core\Session\AccountInterface $account
    *   The account to use in access checks.
    */
-  public function __construct(RequestMatcherInterface $router, AccessManagerInterface $access_manager, AccountInterface $account) {
+  public function __construct(RouterInterface $router, AccessManagerInterface $access_manager, AccountInterface $account) {
     $this->router = $router;
     $this->accessManager = $access_manager;
     $this->account = $account;
@@ -69,18 +67,14 @@ public function __call($name, $arguments) {
    * {@inheritdoc}
    */
   public function setContext(SymfonyRequestContext $context) {
-    if ($this->router instanceof RequestContextAwareInterface) {
-      $this->router->setContext($context);
-    }
+    $this->router->setContext($context);
   }
 
   /**
    * {@inheritdoc}
    */
-  public function getContext() {
-    if ($this->router instanceof RequestContextAwareInterface) {
-      return $this->router->getContext();
-    }
+  public function getContext(): SymfonyRequestContext {
+    return $this->router->getContext();
   }
 
   /**
@@ -127,18 +121,14 @@ protected function checkAccess(Request $request) {
    * {@inheritdoc}
    */
   public function getRouteCollection(): RouteCollection {
-    if ($this->router instanceof RouterInterface) {
-      return $this->router->getRouteCollection();
-    }
+    return $this->router->getRouteCollection();
   }
 
   /**
    * {@inheritdoc}
    */
   public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string {
-    if ($this->router instanceof UrlGeneratorInterface) {
-      return $this->router->generate($name, $parameters, $referenceType);
-    }
+    return $this->router->generate($name, $parameters, $referenceType);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Routing/NullGenerator.php b/core/lib/Drupal/Core/Routing/NullGenerator.php
index 630e81ffe26bfd2703fcb5e1e50c2c980d30d5e8..0f0d13ec3bf7348920497bcda42741ae27374a18 100644
--- a/core/lib/Drupal/Core/Routing/NullGenerator.php
+++ b/core/lib/Drupal/Core/Routing/NullGenerator.php
@@ -4,7 +4,6 @@
 
 use Drupal\Core\Render\BubbleableMetadata;
 use Symfony\Component\HttpFoundation\RequestStack;
-use Symfony\Component\Routing\RequestContext as SymfonyRequestContext;
 use Symfony\Component\Routing\Exception\RouteNotFoundException;
 use Symfony\Component\Routing\Route;
 
@@ -56,18 +55,6 @@ protected function getInternalPathFromRoute($name, Route $route, $parameters = [
     return $route->getPath();
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function setContext(SymfonyRequestContext $context) {
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getContext() {
-  }
-
   /**
    * {@inheritdoc}
    */
diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php
index f56736ab267c569bec14f566ae07d1c348f11af7..185784db374db7e7f724fd7d0f4122975751fda8 100644
--- a/core/lib/Drupal/Core/Routing/UrlGenerator.php
+++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php
@@ -104,7 +104,7 @@ public function setContext(SymfonyRequestContext $context) {
   /**
    * {@inheritdoc}
    */
-  public function getContext() {
+  public function getContext(): SymfonyRequestContext {
     return $this->context;
   }
 
diff --git a/core/modules/help/tests/modules/help_test/src/SupernovaGenerator.php b/core/modules/help/tests/modules/help_test/src/SupernovaGenerator.php
index 9cdaa41858fba704fe83b0afa456d4f456957021..bfdc97e453a58f72e9a25a4c60e9f5c33f451c80 100644
--- a/core/modules/help/tests/modules/help_test/src/SupernovaGenerator.php
+++ b/core/modules/help/tests/modules/help_test/src/SupernovaGenerator.php
@@ -20,7 +20,7 @@ public function setContext(RequestContext $context) {
   /**
    * {@inheritdoc}
    */
-  public function getContext() {
+  public function getContext(): RequestContext {
     throw new \Exception();
   }