protected function sortHooks(array $hooks)
    {
        foreach ($hooks as $scopeName => &$scopeHooks) {
            foreach ($scopeHooks as $hookName => &$hookList) {
                usort($hookList, array($this, 'cmpHooks'));
            }
        }

        return $hooks;
    }