diff --git a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php index fac1598..ce82c67 100644 --- a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php +++ b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php @@ -56,7 +56,7 @@ public function getRoutes(EntityTypeInterface $entity_type) { protected function getCanonicalRoute(EntityTypeInterface $entity_type) { if ($entity_type->hasLinkTemplate('canonical') && $entity_type->hasViewBuilderClass()) { $entity_type_id = $entity_type->id(); - $route = (new Route($entity_type->getLinkTemplate('canonical'))); + $route = new Route($entity_type->getLinkTemplate('canonical')); $route ->addDefaults([ '_entity_view' => "{$entity_type_id}.full", @@ -82,8 +82,8 @@ protected function getCanonicalRoute(EntityTypeInterface $entity_type) { protected function getEditFormRoute(EntityTypeInterface $entity_type) { if ($entity_type->hasLinkTemplate('edit-form')) { $entity_type_id = $entity_type->id(); - $route = (new Route($entity_type->getLinkTemplate('edit-form'))); - // Use the "edit" form handler, otherwise default. + $route = new Route($entity_type->getLinkTemplate('edit-form')); + // Use the edit form handler, if available, otherwise default. $operation = 'default'; if ($entity_type->getFormClass('edit')) { $operation = 'edit'; @@ -113,7 +113,7 @@ protected function getEditFormRoute(EntityTypeInterface $entity_type) { protected function getDeleteFormRoute(EntityTypeInterface $entity_type) { if ($entity_type->hasLinkTemplate('delete-form')) { $entity_type_id = $entity_type->id(); - $route = (new Route($entity_type->getLinkTemplate('delete-form'))); + $route = new Route($entity_type->getLinkTemplate('delete-form')); $route ->addDefaults([ '_entity_form' => "{$entity_type_id}.delete", diff --git a/core/modules/taxonomy/src/Entity/VocabularyRouteProvider.php b/core/modules/taxonomy/src/Entity/VocabularyRouteProvider.php index bc073d3..32cf3b4 100644 --- a/core/modules/taxonomy/src/Entity/VocabularyRouteProvider.php +++ b/core/modules/taxonomy/src/Entity/VocabularyRouteProvider.php @@ -21,8 +21,7 @@ class VocabularyRouteProvider extends DefaultHtmlRouteProvider { protected function getEditFormRoute(EntityTypeInterface $entity_type) { $route = parent::getEditFormRoute($entity_type); - // Vocabularies use the "$vocabulary->label()" instead of - // "Edit $vocabulary->label()". + // Vocabularies use the vocabulary label instead of "Edit $label". $route->setDefault('_title_callback', '\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle'); return $route;