Issue #3265121 by andypost, longwave, Spokje, neclimdul, smustgrave: Remove Symfony 4 RequestStack BC shim in 11.0.x

merge-requests/5836/merge
Dave Long 2024-03-02 22:53:35 +00:00
parent 9d6e557fd2
commit 60d51622ce
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
2 changed files with 0 additions and 63 deletions

View File

@ -1,33 +0,0 @@
<?php
namespace Drupal\Core\Http;
@trigger_error('The ' . __NAMESPACE__ . '\RequestStack is deprecated in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3265357', E_USER_DEPRECATED);
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack as SymfonyRequestStack;
/**
* Forward-compatibility shim for Symfony's RequestStack.
*
* @deprecated in drupal:10.0.0 and is removed from drupal:11.0.0. There is no
* replacement.
*
* @see https://www.drupal.org/node/3265357
*
* @todo Remove this in Drupal 11 https://www.drupal.org/node/3265121
*/
class RequestStack extends SymfonyRequestStack {
/**
* Gets the main request.
*
* @return \Symfony\Component\HttpFoundation\Request|null
* The main request.
*/
public function getMainRequest(): ?Request {
@trigger_error('The ' . __NAMESPACE__ . '\RequestStack is deprecated in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3265357', E_USER_DEPRECATED);
return parent::getMainRequest();
}
}

View File

@ -1,30 +0,0 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\Core\Http;
use Drupal\Core\Http\RequestStack;
use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\Core\Http\RequestStack
* @group legacy
*
* @todo Remove this in Drupal 11 https://www.drupal.org/node/3265121
*/
class RequestStackLegacyTest extends UnitTestCase {
/**
* Tests deprecation message in our subclassed RequestStack.
*
* @covers ::getMainRequest
*/
public function testGetMainRequestDeprecation() {
$stack = new RequestStack();
$this->expectDeprecation('The Drupal\Core\Http\RequestStack is deprecated in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3265357');
$this->assertNull($stack->getMainRequest());
}
}