class RequestStack

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Http/RequestStack.php \Drupal\Core\Http\RequestStack

Forward-compatibility shim for Symfony's RequestStack.

@todo Remove this in Drupal 11 https://www.drupal.org/node/3265121

Hierarchy

  • class \Drupal\Core\Http\RequestStack implements \Symfony\Component\HttpFoundation\RequestStack

Expanded class hierarchy of RequestStack

Deprecated

in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement.

See also

https://www.drupal.org/node/3265357

1 file declares its use of RequestStack
RequestStackLegacyTest.php in core/tests/Drupal/Tests/Core/Http/RequestStackLegacyTest.php
2 string references to 'RequestStack'
LocalTaskIntegrationTestBase::getLocalTaskManager in core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php
Sets up the local task manager for the test.
SharedTempStoreTest::testSerialization in core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php
Tests the serialization of a shared temp store.

File

core/lib/Drupal/Core/Http/RequestStack.php, line 20

Namespace

Drupal\Core\Http
View source
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();
  }

}

Members

Title Sort descending Modifiers Object type Summary
RequestStack::getMainRequest public function Gets the main request.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.