X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=f916756883ed7ae8c40756847a70a471576490df;hb=5b89700a1a7585a181c4fd7ca49ff0a50cd524d6;hp=ee6138c9845683ced0629b8b0e357f1d8a0c3dd1;hpb=cc35b65e11b91686e2ea4d99ca18ac7f77232f07;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index ee6138c984..f916756883 100644 --- a/Civi.php +++ b/Civi.php @@ -18,12 +18,12 @@ class Civi { /** * A central location for static variable storage. - * - * @code + * @var array + * ``` * `Civi::$statics[__CLASS__]['foo'] = 'bar'; - * @endcode + * ``` */ - public static $statics = array(); + public static $statics = []; /** * Retrieve a named cache instance. @@ -64,7 +64,14 @@ class Civi { * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface */ public static function dispatcher() { - return Civi\Core\Container::singleton()->get('dispatcher'); + // NOTE: The dispatcher object is initially created as a boot service + // (ie `dispatcher.boot`). For compatibility with the container (eg + // `RegisterListenersPass` and `createEventDispatcher` addons), + // it is also available as the `dispatcher` service. + // + // The 'dispatcher.boot' and 'dispatcher' services are the same object, + // but 'dispatcher.boot' is resolvable earlier during bootstrap. + return Civi\Core\Container::getBootService('dispatcher.boot'); } /** @@ -75,7 +82,7 @@ class Civi { } /** - * @return \Psr\Log\LoggerInterface + * @return \CRM_Core_Error_Log */ public static function log() { return Civi\Core\Container::singleton()->get('psr_log'); @@ -106,7 +113,7 @@ class Civi { * singletons, containers. */ public static function reset() { - self::$statics = array(); + self::$statics = []; Civi\Core\Container::singleton(); }