diff --git a/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php b/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php index 179817d..5e3cacb 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskDerivativeBase.php @@ -26,15 +26,12 @@ class LocalTaskDerivativeBase extends DerivativeBase { * Returns the local task ID of the given route or NULL if none is found. */ protected function getPluginIdFromRoute($route_name, &$local_tasks) { - $local_task_id = NULL; foreach ($local_tasks as $plugin_id => $local_task) { if ($local_task['route_name'] == $route_name) { - $local_task_id = $plugin_id; + return $plugin_id; break; } } - - return $local_task_id; } } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/UnapprovedComments.php b/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/UnapprovedComments.php index 35d0033..c7a1ff7 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/UnapprovedComments.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/UnapprovedComments.php @@ -10,7 +10,7 @@ use Drupal\Core\Menu\LocalTaskDefault; /** - * Provides a local task that shows the amount of unapproved comments + * Provides a local task that shows the amount of unapproved comments. */ class UnapprovedComments extends LocalTaskDefault {