Background:
- the declined T218555: Provide access to WebRequest and associated information via a service object,
- the file comment of ServiceWiring.php,
- the Dependency Injection docs (as of change 779158).
It is problematic to reference RequestContext in ServiceWiring. These have ocasionally crept back in.
Most recently in the new UrlUtils service (change 776991, which broke wgInternalServer and wgCanonicalServer (ref T325529, T305093), but also introduced:
UrlUtils::FALLBACK_PROTOCOL => RequestContext::getMain()->getRequest()->getProtocol(),
Rather than to keep chasing these, I propose we add a lint check that prevents these. Either CodeSniffer or Phan would work for this one. Usually we prefer Phan when its type related, although given it would have to be done through the singleton RequestContet::getMain it could also be detecteed more easily/quickly through CodeSniffer.