use Drupal\Core\Extension\ModuleHandlerInterface;
/**
* The module handler service.
*/
protected ModuleHandlerInterface $moduleHandler;
/**
* Constructs a form.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
*/
public function __construct(ModuleHandlerInterface $module_handler) {
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('module_handler'),
);
}