From a031f24492c42337bfc76b9f05026f2171c9b055 Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Thu, 19 Dec 2024 10:15:05 +1000 Subject: [PATCH] Issue #3487586 by geek-merlin: BlockLibraryController typehints LazyContextRepository, not the interface (cherry picked from commit 7a0fee2ed6fc3106bcf58d504674cc15710331fa) --- .../src/Controller/BlockLibraryController.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/core/modules/block/src/Controller/BlockLibraryController.php b/core/modules/block/src/Controller/BlockLibraryController.php index 45567f9efb67..df271e7932bb 100644 --- a/core/modules/block/src/Controller/BlockLibraryController.php +++ b/core/modules/block/src/Controller/BlockLibraryController.php @@ -7,10 +7,9 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Menu\LocalActionManagerInterface; -use Drupal\Core\Plugin\Context\LazyContextRepository; +use Drupal\Core\Plugin\Context\ContextRepositoryInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; /** @@ -51,32 +50,20 @@ class BlockLibraryController extends ControllerBase { * * @param \Drupal\Core\Block\BlockManagerInterface $block_manager * The block manager. - * @param \Drupal\Core\Plugin\Context\LazyContextRepository $context_repository + * @param \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository * The context repository. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The current route match. * @param \Drupal\Core\Menu\LocalActionManagerInterface $local_action_manager * The local action manager. */ - public function __construct(BlockManagerInterface $block_manager, LazyContextRepository $context_repository, RouteMatchInterface $route_match, LocalActionManagerInterface $local_action_manager) { + public function __construct(BlockManagerInterface $block_manager, ContextRepositoryInterface $context_repository, RouteMatchInterface $route_match, LocalActionManagerInterface $local_action_manager) { $this->blockManager = $block_manager; $this->routeMatch = $route_match; $this->localActionManager = $local_action_manager; $this->contextRepository = $context_repository; } - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('plugin.manager.block'), - $container->get('context.repository'), - $container->get('current_route_match'), - $container->get('plugin.manager.menu.local_action') - ); - } - /** * Shows a list of blocks that can be added to a theme's layout. * -- GitLab