src/Pentagonal/Hookable/Hookable.php
public function add($hookName, $callable, $priority = 10, $accepted_args = 1)
    {
        $hookName = $this->sanitize($hookName);
        if (!$hookName) {
            throw new \Exception("Invalid Hook Name Specified", E_USER_ERROR);
        }

        $id = $this->uniqueId($hookName, $callable, $priority);
        if ($id === null) {
            throw new \Exception(
                sprintf("Invalid callable specified on hook name %s", $hookName),
                E_USER_ERROR
            );
        }

        $hook_list = $this->filters;
        $hook_list[$hookName][$priority][$id] = array(
            'function' => $callable,
            'accepted_args' => $accepted_args
        );
        $this->filters = array_merge($this->filters, $hook_list);
        unset($this->merged[$hookName]);
        return true;
    }
public function add($hookName, $callable, $priority = 10, $accepted_args = 1)
    {
        $hookName = $this->sanitize($hookName);
        if (!$hookName) {
            throw new \Exception("Invalid Hook Name Specified", E_USER_ERROR);
        }

        $id = $this->uniqueId($hookName, $callable, $priority);
        if ($id === null) {
            throw new \Exception(
                sprintf("Invalid callable specified on hook name %s", $hookName),
                E_USER_ERROR
            );
        }

        $hook_list = $this->filters;
        $hook_list[$hookName][$priority][$id] = array(
            'function' => $callable,
            'accepted_args' => $accepted_args
        );
        $this->filters = array_merge($this->filters, $hook_list);
        unset($this->merged[$hookName]);
        return true;
    }
Add Hooks Function it just like a WordPress add_action() / add_filter() hooks

@param string    $hookName            Hook Name
@param Callable  $callable            Callable
@param integer   $priority            priority
@param integer   $accepted_args       num count of accepted args / parameter

@return boolean
@throws \Exception