Unverified Commit 31d2dc98 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3265419 by andypost: Improve deprecation message for RequestStack::getMasterRequest()

(cherry picked from commit 3c7c0fdf)
parent c0ae5a3f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
/**
 * Forward-compatibility shim for Symfony's RequestStack.
 *
 * @todo Remove when Symfony 5.3 or greater is required.
 * @todo https://www.drupal.org/node/3265121 Remove in Drupal 10.0.x.
 */
class RequestStack extends SymfonyRequestStack {

@@ -31,7 +31,7 @@ public function getMainRequest(): ?Request {
   * {@inheritdoc}
   */
  public function getMasterRequest() {
    @trigger_error('Drupal\Core\Http\RequestStack::getMasterRequest() is deprecated, use getMainRequest() instead.', E_USER_DEPRECATED);
    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use getMainRequest() instead. See https://www.drupal.org/node/3253744', E_USER_DEPRECATED);
    return $this->getMainRequest();
  }

+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ class RequestStackLegacyTest extends UnitTestCase {
  public function testGetMasterRequestDeprecation() {
    $stack = new RequestStack();

    $this->expectDeprecation('Drupal\Core\Http\RequestStack::getMasterRequest() is deprecated, use getMainRequest() instead.');
    $this->expectDeprecation('Drupal\Core\Http\RequestStack::getMasterRequest() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use getMainRequest() instead. See https://www.drupal.org/node/3253744');
    $this->assertNull($stack->getMasterRequest());
  }