diff --git a/composer.lock b/composer.lock index 4440df740b17fcbe0d01b885dfc3827ce7378229..c4ef18e6d12f39a19fe59118f64f1d14065ff4e6 100644 --- a/composer.lock +++ b/composer.lock @@ -530,7 +530,7 @@ "dist": { "type": "path", "url": "core", - "reference": "84de0d6ef4eda33dd426005557f64496a2fd02d1" + "reference": "874a51210b265aa07599dc966748e43cf31a0321" }, "require": { "asm89/stack-cors": "^1.1", @@ -759,6 +759,7 @@ "lib/Drupal/Core/Site/Settings.php" ], "files": [ + "class_aliases.php", "includes/bootstrap.inc" ] }, diff --git a/core/class_aliases.php b/core/class_aliases.php new file mode 100644 index 0000000000000000000000000000000000000000..f058962f842d18325578b015e2ba5f3cb933f48b --- /dev/null +++ b/core/class_aliases.php @@ -0,0 +1,12 @@ +<?php + +/** + * @file + * Contains class_aliases that will be added by the autoloader. + * + * @see core/composer.json + */ + +// @todo https://www.drupal.org/project/drupal/issues/3197482 Remove this class +// alias once Drupal is running Symfony 5.3 or higher. +class_alias('Drupal\Core\Http\KernelEvent', 'Symfony\Component\HttpKernel\Event\KernelEvent', TRUE); diff --git a/core/composer.json b/core/composer.json index aeb57cbf8f955a269799184aa9e56f5de14b5c7e..b71a188907598fe707ebae53aae09ca7b5c24da6 100644 --- a/core/composer.json +++ b/core/composer.json @@ -201,7 +201,10 @@ "lib/Drupal/Core/Installer/InstallerRedirectTrait.php", "lib/Drupal/Core/Site/Settings.php" ], - "files": [ "includes/bootstrap.inc" ] + "files": [ + "class_aliases.php", + "includes/bootstrap.inc" + ] }, "config": { "preferred-install": "dist" diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index d9af456bbde0bfb13d0682df313525d6c469e29e..599e13833ad94296ae9e9ea3f5dbdb96c2a1aeac 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -18,7 +18,6 @@ use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\File\MimeType\MimeTypeGuesser; use Drupal\Core\Http\InputBag; -use Drupal\Core\Http\KernelEvent; use Drupal\Core\Http\TrustedHostsRequestFactory; use Drupal\Core\Installer\InstallerKernel; use Drupal\Core\Installer\InstallerRedirectTrait; @@ -40,10 +39,6 @@ use TYPO3\PharStreamWrapper\Behavior as PharStreamWrapperBehavior; use TYPO3\PharStreamWrapper\PharStreamWrapper; -// @todo https://www.drupal.org/project/drupal/issues/3197482 Remove this class -// alias once Drupal is running Symfony 5.3 or higher. -class_alias(KernelEvent::class, 'Symfony\Component\HttpKernel\Event\KernelEvent', TRUE); - /** * The DrupalKernel class is the core of Drupal itself. * diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelLegacyTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelLegacyTest.php index f07abf258f681da91e9b62dad2445daf374d4a41..adca11d8054482fb9b422d7709ca213f87de6ea3 100644 --- a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelLegacyTest.php +++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelLegacyTest.php @@ -19,7 +19,7 @@ class DrupalKernelLegacyTest extends UnitTestCase { * @covers ::isMasterRequest */ public function testKernelEventDeprecation() { - $kernel = new DrupalKernel('test', NULL); + $kernel = $this->createMock(DrupalKernel::class); $request = $this->createMock(Request::class); $event = new KernelEvent($kernel, $request, $kernel::MASTER_REQUEST);