From fa99d124eb0ff45d4348f6da65561772f65d4bed Mon Sep 17 00:00:00 2001
From: Roman Paska <40929-Taran2L@users.noreply.drupalcode.org>
Date: Wed, 23 Oct 2024 08:36:32 +0000
Subject: [PATCH] Issue #3482167 by taran2l, voleger: Add a BC layer for
 service argument change

---
 src/QueueUIBatch.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/QueueUIBatch.php b/src/QueueUIBatch.php
index 3639542..d2754ed 100644
--- a/src/QueueUIBatch.php
+++ b/src/QueueUIBatch.php
@@ -47,8 +47,15 @@ class QueueUIBatch implements QueueUIBatchInterface {
     protected ModuleHandlerInterface $moduleHandler,
     protected MessengerInterface $messenger,
     protected mixed $queueFactory,
-    protected LoggerChannelFactoryInterface $logger,
-  ) {}
+    protected ?LoggerChannelFactoryInterface $logger = NULL,
+  ) {
+    if (is_null($logger)) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $logger argument is deprecated in queue_ui:3.2.0 and will be required in queue_ui:4.0.0. See https://www.drupal.org/node/3482168', E_USER_DEPRECATED);
+
+      // @phpstan-ignore-next-line
+      $this->logger = \Drupal::service('logger.factory');
+    }
+  }
 
   /**
    * {@inheritdoc}
-- 
GitLab