<?php

declare(strict_types=1);

namespace apexl\Io\modules\menu\services;

use apexl\Io\modules\menu\collections\NavFilterCollection;
use apexl\Io\services\HookCollectedRegistry;

/**
 * Hook-collected registry of NavFilterInterface implementations.
 *
 * Zero built-in filters — io-menu ships the seam only. A downstream
 * package (e.g. `apexl/io-page-layouts`'s workspace nav-allowlist, Phase 5
 * "quiet mode") contributes filters via a module hook on
 * `NavFilterRegistry::COLLECT_HOOK`. If nothing is registered,
 * `all()->all()` is an empty array and `menuEntity::getAllItemsAsMenu()`
 * is a no-op pass-through — io-menu has no dependency on any consumer.
 *
 * @extends HookCollectedRegistry<NavFilterCollection>
 */
final class NavFilterRegistry extends HookCollectedRegistry
{
    public final const string COLLECT_HOOK = 'menu.collectNavFilters';

    protected function hookName(): string
    {
        return self::COLLECT_HOOK;
    }

    protected function emptyCollection(): NavFilterCollection
    {
        return new NavFilterCollection();
    }
}
