diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index 07dc12f1f3..5e824d8353 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -757,4 +757,14 @@ public static function time() { return static::getContainer()->get('datetime.time'); } + /** + * Returns the messenger. + * + * @return \Drupal\Core\Messenger\MessengerInterface + * The messenger service. + */ + public static function messenger() { + return static::getContainer()->get('messenger'); + } + }