Ejemplo n.º 1
0
 /**
  * Listen for an event and handle it with an inline callable.
  *
  * example:
  *
  *  `Events::listen(NineEvents::DATABASE_BOOTED, function ($event, $eventName, $dispatcher) { ... }, 100);`
  *
  * @param string   $eventName
  * @param callable $listener
  * @param int      $priority
  */
 public static function listen(string $eventName, callable $listener, int $priority = 0)
 {
     static::instantiate();
     static::$instance->addListener($eventName, $listener, $priority);
 }