By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Under special circumstances like the installer and early bootstrap, not all services can be used.
Previously the container was consulted directly, now there is a helper function on the \Drupal class.
// Before
if (!\Drupal::getContainer()->has('request')) {
// Something not using the request.
}
// After
if (!\Drupal::hasService('request')) {
// Something not using the request.
}
Impacts:
Module developers