From a91073a5c00cefa9f0566e9bacd5e2f6a97ae1bb Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 10 Dec 2024 16:51:56 +0000
Subject: [PATCH 1/2] Test on Drupal 10 and 11

---
 .gitlab-ci.yml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f1dfcfd..8fd6958 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -42,9 +42,7 @@ include:
 variables:
   _PHPUNIT_CONCURRENT: "1"
 #  _PHPUNIT_EXTRA: "--suppress-deprecations"
-#  OPT_IN_TEST_PREVIOUS_MAJOR: '1'
-  OPT_IN_TEST_NEXT_MINOR: '1'
-  OPT_IN_TEST_NEXT_MAJOR: '1'
+  OPT_IN_TEST_PREVIOUS_MAJOR: '1'
 
 #
 # Linting jobs are passing so any issue that breaks them should fix them.
-- 
GitLab


From 3be1ea86f501ad266820f51585af0abb680f11e5 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 10 Dec 2024 16:58:33 +0000
Subject: [PATCH 2/2] Fix PHPCS

---
 src/ConfigSelector.php                                      | 5 +++--
 src/DecoratingConfigInstaller.php                           | 5 +++--
 .../config_selector_ui_test/config_selector_ui_test.install | 6 ++++++
 tests/src/Functional/ConfigSelectorProfileTest.php          | 2 ++
 tests/src/Functional/ConfigSelectorUiTest.php               | 2 ++
 tests/src/Kernel/ActiveEntityTest.php                       | 2 ++
 tests/src/Kernel/ConfigSelectorTest.php                     | 2 ++
 tests/src/Unit/ConfigSelectorTest.php                       | 2 ++
 8 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/ConfigSelector.php b/src/ConfigSelector.php
index c9962e9..46bcd7e 100644
--- a/src/ConfigSelector.php
+++ b/src/ConfigSelector.php
@@ -56,7 +56,8 @@ class ConfigSelector {
     #[Autowire(service: 'logger.channel.config_selector')]
     protected LoggerInterface $logger,
     protected StateInterface $state,
-    protected MessengerInterface $messenger) {
+    protected MessengerInterface $messenger,
+  ) {
   }
 
   /**
@@ -288,7 +289,7 @@ class ConfigSelector {
         $url = $entity->toUrl();
       }
     }
-    catch (\Exception $e) {
+    catch (\Exception) {
     }
     return isset($url) ? $url->toString() : '';
   }
diff --git a/src/DecoratingConfigInstaller.php b/src/DecoratingConfigInstaller.php
index 766b56d..5df91b7 100644
--- a/src/DecoratingConfigInstaller.php
+++ b/src/DecoratingConfigInstaller.php
@@ -24,7 +24,8 @@ class DecoratingConfigInstaller implements ConfigInstallerInterface {
    */
   public function __construct(
     protected ConfigInstallerInterface $decoratedService,
-    protected ConfigSelector $configSelector) {
+    protected ConfigSelector $configSelector,
+  ) {
   }
 
   /**
@@ -37,7 +38,7 @@ class DecoratingConfigInstaller implements ConfigInstallerInterface {
   /**
    * {@inheritdoc}
    */
-  public function installOptionalConfig(StorageInterface $storage = NULL, $dependency = []): void {
+  public function installOptionalConfig(?StorageInterface $storage = NULL, $dependency = []): void {
     $this->decoratedService->installOptionalConfig($storage, $dependency);
     if ($storage === NULL && empty($dependency)) {
       // This is not called as part of a regular module install. It's called
diff --git a/tests/modules/config_selector_ui_test/config_selector_ui_test.install b/tests/modules/config_selector_ui_test/config_selector_ui_test.install
index a325222..48822b5 100644
--- a/tests/modules/config_selector_ui_test/config_selector_ui_test.install
+++ b/tests/modules/config_selector_ui_test/config_selector_ui_test.install
@@ -1,5 +1,11 @@
 <?php
 
+/**
+ * @file
+ */
+
+declare(strict_types=1);
+
 /**
  * @file
  * The Configuration Selector UI Test module install methods.
diff --git a/tests/src/Functional/ConfigSelectorProfileTest.php b/tests/src/Functional/ConfigSelectorProfileTest.php
index cc25665..7fdd8a3 100644
--- a/tests/src/Functional/ConfigSelectorProfileTest.php
+++ b/tests/src/Functional/ConfigSelectorProfileTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Drupal\Tests\config_selector\Functional;
 
 use Drupal\Tests\BrowserTestBase;
diff --git a/tests/src/Functional/ConfigSelectorUiTest.php b/tests/src/Functional/ConfigSelectorUiTest.php
index 9633800..edf3f73 100644
--- a/tests/src/Functional/ConfigSelectorUiTest.php
+++ b/tests/src/Functional/ConfigSelectorUiTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Drupal\Tests\config_selector\Functional;
 
 use Drupal\config_selector\Entity\Feature;
diff --git a/tests/src/Kernel/ActiveEntityTest.php b/tests/src/Kernel/ActiveEntityTest.php
index eb35a91..81cd580 100644
--- a/tests/src/Kernel/ActiveEntityTest.php
+++ b/tests/src/Kernel/ActiveEntityTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Drupal\Tests\config_selector\Kernel;
 
 use Drupal\Core\Entity\EntityStorageInterface;
diff --git a/tests/src/Kernel/ConfigSelectorTest.php b/tests/src/Kernel/ConfigSelectorTest.php
index 82c09ec..3a9ff32 100644
--- a/tests/src/Kernel/ConfigSelectorTest.php
+++ b/tests/src/Kernel/ConfigSelectorTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Drupal\Tests\config_selector\Kernel;
 
 use Drupal\config_selector\TestLogger;
diff --git a/tests/src/Unit/ConfigSelectorTest.php b/tests/src/Unit/ConfigSelectorTest.php
index 5e4ab12..6d65453 100644
--- a/tests/src/Unit/ConfigSelectorTest.php
+++ b/tests/src/Unit/ConfigSelectorTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace Drupal\Tests\config_selector\Unit;
 
 use Drupal\config_selector\ConfigSelector;
-- 
GitLab