From 4fbb2e218b38d31264a62add7ca14054c0e44fca Mon Sep 17 00:00:00 2001
From: rodetrev <60662-rodetrev@users.noreply.drupalcode.org>
Date: Thu, 19 Jan 2023 17:05:43 -0800
Subject: [PATCH] Issue #3308141 by rodetrev, DieterHolvoet, RhiP,
 kaloyan.damyanov: Lazy should typehint ModuleHandler interface rather than a
 specific implementation

---
 src/Lazy.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Lazy.php b/src/Lazy.php
index 91b4e33..52774b9 100644
--- a/src/Lazy.php
+++ b/src/Lazy.php
@@ -4,7 +4,7 @@ namespace Drupal\lazy;
 
 use Drupal\Core\Condition\ConditionManager;
 use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Extension\ModuleHandler;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Routing\AdminContext;
 use Symfony\Component\HttpFoundation\RequestStack;
 
@@ -46,7 +46,7 @@ class Lazy implements LazyInterface {
   /**
    * The module manager.
    *
-   * @var \Drupal\Core\Extension\ModuleHandler
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
    */
   protected $moduleHandler;
 
@@ -61,7 +61,7 @@ class Lazy implements LazyInterface {
    *   The condition plugins manager.
    * @param \Drupal\Core\Routing\AdminContext $admin_context
    *   The route admin context service.
-   * @param \Drupal\Core\Extension\ModuleHandler $module_handler
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module manager.
    */
   public function __construct(
@@ -69,7 +69,7 @@ class Lazy implements LazyInterface {
     RequestStack $request_stack,
     ConditionManager $condition_manager,
     AdminContext $admin_context,
-    ModuleHandler $module_handler
+    ModuleHandlerInterface $module_handler
   ) {
     $this->lazySettings = $config_factory->get('lazy.settings')->get();
     $this->requestStack = $request_stack->getCurrentRequest();
-- 
GitLab