Problem/Motivation

The \Drupal::request() method is documented as returning only a \Symfony\Component\HttpFoundation\Request object, as returned from calling static::getContainer()->get('request_stack')->getCurrentRequest()

However, the getCurrentRequest() method can in fact return NULL. So presumably, it's theoretically possible that \Drupal::request() could return NULL, and I assume should be documented as such? Otherwise it would have to throw an exception if called when there is no current request.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

mfb created an issue.