original_string: public static function instance($manager = null)
      {
          if ($manager instanceof EventManager) {
              static::$_generalManager = $manager;
          }
          if (empty(static::$_generalManager)) {
              static::$_generalManager = new static();
          }
  
          static::$_generalManager->_isGlobal = true;
  
          return static::$_generalManager;
      }
code: public static function instance($manager = null)
      {
          if ($manager instanceof EventManager) {
              static::$_generalManager = $manager;
          }
          if (empty(static::$_generalManager)) {
              static::$_generalManager = new static();
          }
  
          static::$_generalManager->_isGlobal = true;
  
          return static::$_generalManager;
      }
code_tokens: public static function instance ( $ manager = null ) { if ( $ manager instanceof EventManager ) { static :: $ _generalManager = $ manager ; } if ( empty ( static :: $ _generalManager ) ) { static :: $ _generalManager = new static ( ) ; } static :: $ _generalManager -> _isGlobal = true ; return static :: $ _generalManager ; }
docstring: Returns the globally available instance of a Cake\Event\EventManager
  this is used for dispatching events attached from outside the scope
  other managers were created. Usually for creating hook systems or inter-class
  communication
  
  If called with the first parameter, it will be set as the globally available instance
  
  @param \Cake\Event\EventManager|null $manager Event manager instance.
  @return static The global event manager
docstring_tokens: Returns the globally available instance of a Cake \ Event \ EventManager this is used for dispatching events attached from outside the scope other managers were created . Usually for creating hook systems or inter - class communication