@param string             $hook
@param ComponentInterface $component
@param string             $handler
@param int                $priority
@param int                $argCount

@return void
769246
public function addAction(string $hook, ComponentInterface $component, string $handler, int $priority = 10, int $argCount = 1): void {
		$this->actions[] = new Hook($hook, $component, $handler, $priority, $argCount);
	}
592581
public function listen($events, $listener, $priority = 0)
    {
        foreach ((array) $events as $event) {
            if (mb_strpos($event, '*') !== false) {
                $this->setupWildcardListen($event, $listener);
            } else {
                $this->listeners[$event][$priority][] = $this->makeListener($listener);

                unset($this->sorted[$event]);
            }
        }
    }
1309854
public function exec_hook($hook, $args = array())
    {
        if (!is_array($args)) {
            $args = array('arg' => $args);
        }

        // TODO: avoid recursion by checking in_array($hook, $this->exec_stack) ?

        $args += array('abort' => false);
        array_push($this->exec_stack, $hook);

        // Use for loop here, so handlers added in the hook will be executed too
        if (!empty($this->handlers[$hook])) {
            for ($i = 0; $i < count($this->handlers[$hook]); $i++) {
                $ret = call_user_func($this->handlers[$hook][$i], $args);
                if ($ret && is_array($ret)) {
                    $args = $ret + $args;
                }

                if ($args['break']) {
                    break;
                }
            }
        }

        array_pop($this->exec_stack);
        return $args;
    }
1359840
public function hook($name, $callable, $priority = 10)
    {
        if (!isset($this->hooks[$name])) {
            $this->hooks[$name] = array(array());
        }
        if (is_callable($callable)) {
            $this->hooks[$name][(int) $priority][] = $callable;
        }
    }
1225528
public function listen($events, $listener, $priority = 10, $acceptedArgs = 1)
    {
        foreach ((array) $events as $filter) {
            $this->listeners[$filter][] = $listener;

            unset($this->sorted[$filter]);

            if ( ! isset($this->registeredWpFilters[$filter])) {
                $this->registeredWpFilters[$filter] = true;

                add_filter(
                    $filter,
                    function () use ($filter) {
                        return $this->dispatch($filter, func_get_args());
                    },
                    $priority,
                    $acceptedArgs
                );
            }
        }
    }
664097
protected function addEventListener($name, $callback, $priority, $accepted_args)
    {
        $this->hooks[$name] = [$callback, $priority, $accepted_args];
        $this->addFilter($name, $callback, $priority, $accepted_args);
    }
466104
private function log(string $message, string $priority = LogLevel::INFO, array $parameters = []): void
    {
        $this->logger->log($priority, $message, $parameters);
    }
379471
public function attach(string $event, callable $callback, int $priority = self::PRIORITY_MIN): void
    {

        /* If there aren't any listeners for an event yet */
        if (empty($this->events[$event])) {

            /* Create a new queue for the event. */
            $this->events[$event] = new PriorityQueue();
        }

        /* Create a new listener with the given data */
        $listener = new EventListener($event, $callback, $priority);

        /* Insert the new callback into the queue. */
        $this->events[$event]->insert($listener, $priority);
    }
249654
public function invokePluginsHook($hook, $args)
    {
        foreach ($this->getPlugins() as $plugin) {
            if (method_exists($plugin, $hook)) {
                call_user_func_array(array($plugin, $hook), $args);
            }
        }
    }
1243143
public function attach($eventType, $handler, $priority = 100)
    {
        if (!isset($this->listeners[$eventType])) {
            if ($this->enablePriorities) {
                $priorityQueue = new PriorityQueue();
                $priorityQueue->setExtractFlags(PriorityQueue::EXTR_DATA);
            } else {
                $priorityQueue = [];
            }

            $this->listeners[$eventType] = $priorityQueue;
        }

        if (is_object($this->listeners[$eventType])) {
            /** @var PriorityQueue $priorityQueue */
            $priorityQueue = &$this->listeners[$eventType];
            $priorityQueue->insert($handler, $priority);
        } else {
            $this->listeners[$eventType][] = $handler;
        }
    }
1019251
public function param($param, $handler)
    {
        $param              = new RouteParam($param, $handler);
        $this->middleware[] = $param;
    }
126549
public function addAction(string $hook, callable $callable, ...$args)
    {
        return add_action($this->App->Config->©brand['©var'].'_'.$hook, $callable, ...$args);
    }
444963
protected function registerListener($event, $listener, $priority)
    {
        if (!is_callable($listener)) {
            throw new DispatcherException(sprintf('Invalid event listener. Only callables or ListenerInterface instances can be registered, got "%s"', gettype($listener)));
        }

        if (!isset($this->events[$event])) {
            $this->events[$event] = [];
        }

        if ($priority === null) {
            $this->events[$event][] = $listener;

            return;
        }

        array_splice($this->events[$event], (int) $priority, 0, [$listener]);
    }
22831
protected function add( $hooks, $hook, $service, $method, $priority, $accepted_args ) {
		$hooks[] = array(
			'hook'     => $hook,
			'service'  => $service,
			'method'   => $method,
			'priority' => $priority,
			'args'     => $accepted_args,
		);

		return $hooks;
	}
205691
public function Listen($signal_type, $callback, $priority=10)
    {
        if(!isset($this->listeners[$signal_type]))
            $this->listeners[$signal_type] = array();
        
        $this->listeners[$signal_type][] = array(
            'callback'=>$callback,
            'priority'=>$priority
        );
        
        $this->listeners[$signal_type] = SignalHandler::Sort(
            $this->listeners[$signal_type], 'priority'
        );
    }
279040
public static function addListener(string $name, $listener, $priority = 0)
    {
        BeanFactory::getBean('eventManager')->attach($name, $listener, $priority);
    }
1346223
public function register($hook, $callback, $priority = 0) {
		if (!isset($this->hooks[$hook])) {
			$this->hooks[$hook] = array();
		}
		if (!isset($this->hooks[$hook][$priority])) {
			$this->hooks[$hook][$priority] = array();
		}

		$this->hooks[$hook][$priority][] = $callback;
	}