- Status changed to Needs work
over 1 year ago 8:25pm 3 February 2023 - π«π·France andypost
No, this one is to deprecate
UrlMatcher
and use the one from Symfony
But second is aboutAccessAwareRouter
polishingSetting needs work for change record and proper deprecation of the class according https://www.drupal.org/about/core/policies/core-change-policies/drupal-d... β
+++ b/core/lib/Drupal/Core/Routing/Router.php @@ -7,7 +7,8 @@ +use Symfony\Component\Routing\Matcher\UrlMatcher; @@ -28,7 +29,7 @@ -class Router extends UrlMatcher implements RequestMatcherInterface, RouterInterface { +class Router extends UrlMatcher implements RouterInterface { +++ /dev/null @@ -1,58 +0,0 @@ -class UrlMatcher extends BaseUrlMatcher {
Filed change record https://www.drupal.org/node/3339050 β
- π«π·France andypost
Btw core's
UrlMatcher
still very different implementation from SF oneprotected function getAttributes(Route $route, $name, array $attributes): array { if ($route instanceof RouteObjectInterface && is_string($route->getRouteKey())) { $name = $route->getRouteKey(); } $attributes[RouteObjectInterface::ROUTE_NAME] = $name; $attributes[RouteObjectInterface::ROUTE_OBJECT] = $route; return $this->mergeDefaults($attributes, $route->getDefaults()); }
SF code
protected function getAttributes(Route $route, string $name, array $attributes): array { $defaults = $route->getDefaults(); if (isset($defaults['_canonical_route'])) { $name = $defaults['_canonical_route']; unset($defaults['_canonical_route']); } $attributes['_route'] = $name; return $this->mergeDefaults($attributes, $defaults); }