Elgg\Debug\Inspector::buildHandlerTree PHP Method

buildHandlerTree() protected method

Build a tree of event handlers
protected buildHandlerTree ( array $all_handlers ) : array
$all_handlers array Set of handlers from a HooksRegistrationService
return array
    protected function buildHandlerTree($all_handlers)
    {
        $tree = array();
        $root = elgg_get_root_path();
        foreach ($all_handlers as $hook => $types) {
            foreach ($types as $type => $priorities) {
                ksort($priorities);
                foreach ($priorities as $priority => $handlers) {
                    foreach ($handlers as $callable) {
                        $description = $this->describeCallable($callable, $root);
                        $callable = "{$priority}: {$description}";
                        $tree["{$hook}, {$type}"][] = $callable;
                    }
                }
            }
        }
        ksort($tree);
        return $tree;
    }