From 96b418f5152bccdd2bc86075e7488780e192223c Mon Sep 17 00:00:00 2001 From: catch <6915-catch@users.noreply.drupalcode.org> Date: Tue, 23 Jul 2024 10:15:56 +0900 Subject: [PATCH] Issue #3350922 by Ranjit1032002, Akram Khan, quietone, geek-merlin, larowlan: Deprecate unused MatchingRouteNotFoundException --- .../Core/Routing/MatchingRouteNotFoundException.php | 6 +++++- core/lib/Drupal/Core/Url.php | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Core/Routing/MatchingRouteNotFoundException.php b/core/lib/Drupal/Core/Routing/MatchingRouteNotFoundException.php index 4d5d0afe475..f4a6461c53c 100644 --- a/core/lib/Drupal/Core/Routing/MatchingRouteNotFoundException.php +++ b/core/lib/Drupal/Core/Routing/MatchingRouteNotFoundException.php @@ -6,7 +6,11 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException; /** * No matching route was found. + * + * @deprecated in drupal:11.1.0 and is removed from drupal:12.0.0. There is no + * replacement. + * + * @see https://www.drupal.org/node/3462776 */ class MatchingRouteNotFoundException extends ResourceNotFoundException { - } diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index d79322f19af..1857ba09048 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -482,8 +482,12 @@ class Url implements TrustedCallbackInterface { * would get an access denied running the same request via the normal page * flow. * - * @throws \Drupal\Core\Routing\MatchingRouteNotFoundException - * Thrown when the request cannot be matched. + * @throws Symfony\Component\Routing\Exception\NoConfigurationException + * If no routing configuration could be found. + * @throws Symfony\Component\Routing\Exception\ResourceNotFoundException + * If no matching resource could be found. + * @throws Symfony\Component\Routing\Exception\MethodNotAllowedException + * If a matching resource was found but the request method is not allowed. */ public static function createFromRequest(Request $request) { // We use the router without access checks because URL objects might be