public static function hasHookFired($type = 'action', $hook = null)
    {
        if (! in_array($type, ['action', 'filter'], true)) {
            $type = 'action';
        }
        $target = $type === 'filter' ? 'filters' : 'actions';
        if (empty($hook) || ! is_string($hook)) {
            $msg = __METHOD__.' needs a valid hook to check.';
            throw new InvalidArgumentException($msg);
        }

        return array_key_exists($hook, static::$hooks_done[$target]);
    }