commit 80f2e9f11048a8a36f14e2ff51d720b54d1f9991
Author: Jonathan Sacksick <jonathan.sacksick@gmail.com>
Date:   Wed Nov 6 09:54:14 2024 +0200

    Issue #3485811 by jsacksick: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct().

diff --git a/src/Form/FastlySettingsForm.php b/src/Form/FastlySettingsForm.php
index 022f1bc..52ab7ca 100644
--- a/src/Form/FastlySettingsForm.php
+++ b/src/Form/FastlySettingsForm.php
@@ -4,15 +4,9 @@ namespace Drupal\fastly\Form;
 
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\HtmlCommand;
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\fastly\Api;
-use Drupal\fastly\State;
-use Drupal\fastly\VclHandler;
-use Drupal\fastly\Services\Webhook;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class FastlySettingsForm Defines a form to configure module settings.
@@ -56,43 +50,20 @@ class FastlySettingsForm extends ConfigFormBase {
    */
   protected $baseUrl;
 
-  /**
-   * Constructs a FastlySettingsForm object.
-   *
-   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
-   *   The factory for configuration objects.
-   * @param \Drupal\fastly\Api $api
-   *   Fastly API for Drupal.
-   * @param \Drupal\fastly\State $state
-   *   Fastly state service for Drupal.
-   * @param \Drupal\fastly\VclHandler $vclHandler
-   *   Vcl handler.
-   * @param \Drupal\fastly\Services\Webhook $webhook
-   *   The Fastly webhook service.
-   * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
-   *   The request stack object.
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, Api $api, State $state, VclHandler $vclHandler, Webhook $webhook, RequestStack $requestStack) {
-    parent::__construct($config_factory);
-    $this->api = $api;
-    $this->state = $state;
-    $this->vclHandler = $vclHandler;
-    $this->webhook = $webhook;
-    $this->baseUrl = $requestStack->getCurrentRequest()->getHost();
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('fastly.api'),
-      $container->get('fastly.state'),
-      $container->get('fastly.vclhandler'),
-      $container->get('fastly.services.webhook'),
-      $container->get('request_stack')
-    );
+    $instance = parent::create($container);
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
+    $request_stack = $container->get('request_stack');
+    $instance->api = $container->get('fastly.api');
+    $instance->state = $container->get('fastly.state');
+    $instance->vclHandler = $container->get('fastly.vclhandler');
+    $instance->webhook = $container->get('fastly.services.webhook');
+    $instance->baseUrl = $request_stack->getCurrentRequest()->getHost();
+
+    return $instance;
   }
 
   /**
diff --git a/src/Form/ImageOptimizerForm.php b/src/Form/ImageOptimizerForm.php
index 920a1f8..a032073 100644
--- a/src/Form/ImageOptimizerForm.php
+++ b/src/Form/ImageOptimizerForm.php
@@ -4,15 +4,10 @@ namespace Drupal\fastly\Form;
 
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\OpenModalDialogCommand;
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
-use Drupal\fastly\Api;
-use Drupal\fastly\VclHandler;
-use Drupal\fastly\Services\Webhook;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class ImageOptimizerForm.
@@ -49,28 +44,19 @@ class ImageOptimizerForm extends ConfigFormBase {
    */
   protected $baseUrl;
 
-  /**
-   * {@inheritdoc}
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, Api $api, VclHandler $vclHandler, Webhook $webhook, RequestStack $requestStack) {
-    parent::__construct($config_factory);
-    $this->api = $api;
-    $this->vclHandler = $vclHandler;
-    $this->webhook = $webhook;
-    $this->baseUrl = $requestStack->getCurrentRequest()->getHost();
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('fastly.api'),
-      $container->get('fastly.vclhandler'),
-      $container->get('fastly.services.webhook'),
-      $container->get('request_stack')
-    );
+    $instance = parent::create($container);
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
+    $request_stack = $container->get('request_stack');
+    $instance->api = $container->get('fastly.api');
+    $instance->vclHandler = $container->get('fastly.vclhandler');
+    $instance->webhook = $container->get('fastly.webhook');
+    $instance->baseUrl = $request_stack->getCurrentRequest()->getHost();
+
+    return $instance;
   }
 
   /**
diff --git a/src/Form/PurgeOptionsForm.php b/src/Form/PurgeOptionsForm.php
index 0f7d6c7..540a21a 100644
--- a/src/Form/PurgeOptionsForm.php
+++ b/src/Form/PurgeOptionsForm.php
@@ -2,19 +2,10 @@
 
 namespace Drupal\fastly\Form;
 
-use Drupal\Core\Ajax\AjaxResponse;
-use Drupal\Core\Ajax\HtmlCommand;
-use Drupal\Core\Ajax\OpenModalDialogCommand;
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\fastly\Api;
 use Drupal\fastly\CacheTagsHashInterface;
-use Drupal\fastly\State;
-use Drupal\fastly\VclHandler;
-use Drupal\fastly\Services\Webhook;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class PurgeOptionsForm.
@@ -43,24 +34,17 @@ class PurgeOptionsForm extends ConfigFormBase {
    */
   protected $baseUrl;
 
-  /**
-   * {@inheritdoc}
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, Webhook $webhook, RequestStack $requestStack) {
-    parent::__construct($config_factory);
-    $this->webhook = $webhook;
-    $this->baseUrl = $requestStack->getCurrentRequest()->getHost();
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('fastly.services.webhook'),
-      $container->get('request_stack')
-    );
+    $instance = parent::create($container);
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
+    $request_stack = $container->get('request_stack');
+    $instance->webhook = $container->get('fastly.services.webhook');
+    $instance->baseUrl = $request_stack->getCurrentRequest()->getHost();
+
+    return $instance;
   }
 
   /**
diff --git a/src/Form/StaleContentOptionsForm.php b/src/Form/StaleContentOptionsForm.php
index 9c02c15..f9811d1 100644
--- a/src/Form/StaleContentOptionsForm.php
+++ b/src/Form/StaleContentOptionsForm.php
@@ -2,12 +2,9 @@
 
 namespace Drupal\fastly\Form;
 
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\fastly\Services\Webhook;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class StaleContentOptionsForm.
@@ -30,31 +27,17 @@ class StaleContentOptionsForm extends ConfigFormBase {
    */
   protected $baseUrl;
 
-  /**
-   * Constructs a StaleContentOptionsForm object.
-   *
-   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
-   *   The factory for configuration objects.
-   * @param \Drupal\fastly\Services\Webhook $webhook
-   *   The Fastly webhook service.
-   * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
-   *   The request stack object.
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, Webhook $webhook, RequestStack $requestStack) {
-    parent::__construct($config_factory);
-    $this->webhook = $webhook;
-    $this->baseUrl = $requestStack->getCurrentRequest()->getHost();
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('fastly.services.webhook'),
-      $container->get('request_stack')
-    );
+    $instance = parent::create($container);
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
+    $request_stack = $container->get('request_stack');
+    $instance->webhook = $container->get('fastly.services.webhook');
+    $instance->baseUrl = $request_stack->getCurrentRequest()->getHost();
+
+    return $instance;
   }
 
   /**
diff --git a/src/Form/WebhookForm.php b/src/Form/WebhookForm.php
index 097e303..3660751 100644
--- a/src/Form/WebhookForm.php
+++ b/src/Form/WebhookForm.php
@@ -2,12 +2,9 @@
 
 namespace Drupal\fastly\Form;
 
-use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\fastly\Services\Webhook;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Class WebhookForm.
@@ -30,24 +27,17 @@ class WebhookForm extends ConfigFormBase {
    */
   protected $baseUrl;
 
-  /**
-   * {@inheritdoc}
-   */
-  public function __construct(ConfigFactoryInterface $config_factory, Webhook $webhook, RequestStack $request_stack) {
-    parent::__construct($config_factory);
-    $this->webhook = $webhook;
-    $this->baseUrl = $request_stack->getCurrentRequest()->getHost();
-  }
-
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('config.factory'),
-      $container->get('fastly.services.webhook'),
-      $container->get('request_stack')
-    );
+    $instance = parent::create($container);
+    /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
+    $request_stack = $container->get('request_stack');
+    $instance->webhook = $container->get('fastly.services.webhook');
+    $instance->baseUrl = $request_stack->getCurrentRequest()->getHost();
+
+    return $instance;
   }
 
   /**