protected function callHookHandler($hookName, $data = null)
    {
        if (array_key_exists($hookName, $this->handlers)) {
            $handlers = $this->handlers[$hookName] ?: [];
            $result = null;
            foreach ($handlers as $index => $handler) {
                $handlerArgs = $data === null ?
                               [$this, $index, &$handlers, $result] :
                               [$this, $data, $index, &$handlers, $result];
                $result = call_user_func_array($handler, $handlerArgs);
            }
            if ($result === null) {
                return true;
            }

            return $result;
        }

        return true;
    }