By skifdesu on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
11.5.x
Introduced in version:
11.4.0
Issue links:
Description:
Overview
As of Drupal 11.4.0, the $entity_type parameter on EntityRouteProviderInterface::getRoutes() is deprecated. Route providers already receive the entity type on construction, so passing it again is redundant. Core no longer passes the argument; providers should read the entity type from the value injected on construction. The parameter is removed in drupal:13.0.0.
Changes
// Before.
public function getRoutes(EntityTypeInterface $entity_type) {
// ...
}
$routes = $route_provider->getRoutes($entity_type);
// After.
public function getRoutes(?EntityTypeInterface $entity_type = NULL) {
$entity_type = $entity_type ?? $this->entityType;
// ...
}
$routes = $route_provider->getRoutes();
Impacts:
Module developers