diff --git a/src/Form/BlockFieldConfigForm.php b/src/Form/BlockFieldConfigForm.php
index 5bd3d34d22840e05fd2698abe371ba638016a287..0a98e9f25a0fdba059a3688a0ba144f4174648c4 100644
--- a/src/Form/BlockFieldConfigForm.php
+++ b/src/Form/BlockFieldConfigForm.php
@@ -7,7 +7,7 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
-use Drupal\Core\Extension\ModuleHandler;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\Context\ContextRepositoryInterface;
 use Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait;
 use Drupal\Core\Plugin\ContextAwarePluginInterface;
@@ -30,7 +30,7 @@ class BlockFieldConfigForm extends FieldFormBase implements ContainerInjectionIn
   /**
    * {@inheritdoc}
    */
-  public function __construct(ConfigFactory $config_factory, EntityTypeManagerInterface $entity_type_manager, CacheTagsInvalidatorInterface $cache_invalidator, ModuleHandler $module_handler, ContextRepositoryInterface $context_repository) {
+  public function __construct(ConfigFactory $config_factory, EntityTypeManagerInterface $entity_type_manager, CacheTagsInvalidatorInterface $cache_invalidator, ModuleHandlerInterface $module_handler, ContextRepositoryInterface $context_repository) {
     parent::__construct($config_factory, $entity_type_manager, $cache_invalidator, $module_handler);
     $this->contextRepository = $context_repository;
   }
diff --git a/src/Form/FieldFormBase.php b/src/Form/FieldFormBase.php
index 218b4cdaf04a4de4c8503a14650f755ed5848e9b..e118cd04267c5ce8f3c35bf51d38804802bbb2df 100644
--- a/src/Form/FieldFormBase.php
+++ b/src/Form/FieldFormBase.php
@@ -7,7 +7,7 @@ use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
-use Drupal\Core\Extension\ModuleHandler;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
@@ -35,7 +35,7 @@ class FieldFormBase extends ConfigFormBase implements ContainerInjectionInterfac
   /**
    * Drupal module handler.
    *
-   * @var \Drupal\Core\Extension\ModuleHandler
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
    */
   protected $moduleHandler;
 
@@ -55,10 +55,10 @@ class FieldFormBase extends ConfigFormBase implements ContainerInjectionInterfac
    *   The entity type manager.
    * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_invalidator
    *   The cache invalidator.
-   * @param \Drupal\Core\Extension\ModuleHandler $module_handler
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
    */
-  public function __construct(ConfigFactory $config_factory, EntityTypeManagerInterface $entity_type_manager, CacheTagsInvalidatorInterface $cache_invalidator, ModuleHandler $module_handler) {
+  public function __construct(ConfigFactory $config_factory, EntityTypeManagerInterface $entity_type_manager, CacheTagsInvalidatorInterface $cache_invalidator, ModuleHandlerInterface $module_handler) {
     parent::__construct($config_factory);
     $this->entityTypeManager = $entity_type_manager;
     $this->cacheInvalidator = $cache_invalidator;