<?php
declare(strict_types=1);

namespace Ekesto\CacheInvalidator\Integrations\Multilingual;

use Ekesto\CacheInvalidator\Core\Multilingual\MultilingualProviderRegistry;

/**
 * Lite-safe facade for resolving the active multilingual resolver.
 *
 * The public static signature is preserved for existing call sites. Plugin
 * detection, the WPML/Polylang/TranslatePress adapters, and the Pro-only
 * resolver filter live in the premium provider; this facade simply delegates to
 * the registered provider (a Lite-safe no-op returning null unless the premium
 * multilingual implementation is present).
 */
final class LanguageResolverFactory
{
    /**
     * Resolve the active multilingual resolver, or null when none is available.
     *
     * @return LanguageResolverInterface|null
     */
    public static function create(): ?LanguageResolverInterface
    {
        return MultilingualProviderRegistry::current()->createResolver();
    }
}
