public function __construct($route_name, Route
$route, array
$parameters =
[], array
$raw_parameters =
[]) { $this->routeName =
$route_name;
$this->route =
$route;
// Pre-filter parameters.
$route_params =
$this->
getParameterNames();
$parameters =
array_intersect_key($parameters,
$route_params);
$raw_parameters =
array_intersect_key($raw_parameters,
$route_params);
$this->parameters =
new ParameterBag($parameters);
$this->rawParameters =
new InputBag($raw_parameters);
} /**
* Creates a RouteMatch from a request.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* A request object.
*
* @return \Drupal\Core\Routing\RouteMatchInterface
* A new RouteMatch object if there's a matched route for the request.
* A new NullRouteMatch object otherwise (e.g., on a 404 page or when
* invoked prior to routing).
*/