Page MenuHomePhabricator

Methods within User class that deprecate on `::getRequest()` should expect WebRequest as argument
Open, Needs TriagePublic

Description

There are plenty of methods in User class that call $this->getRequest() to retrieve information about the current Request. Those methods should expect WebReqest as argument instead of calling $this->getRequest().

Removal plan

  1. Add an optional parameter WebRequest $request = null to those methods. When $request is passed use it, otherwise use $this->getRequest()
  2. Update all places/extensions that call those methods and pass the $request.
  3. Update methods updated in point 1. and add a deprecation warning that from now the $request argument is required.

Event Timeline

Change 982378 had a related patch set uploaded (by Pmiazga; author: Pmiazga):

[mediawiki/core@master] User::toRateLimitSubject and ::isPingLimitable should expect WebRequest

https://gerrit.wikimedia.org/r/982378

Change 982380 had a related patch set uploaded (by Pmiazga; author: Pmiazga):

[mediawiki/core@master] User::setEmailWithConfirmation() should expect $ip, not depend upon ::getRequest

https://gerrit.wikimedia.org/r/982380