Your IP : 216.73.216.43


Current Path : /proc/thread-self/root/home/rtorresani/www/vendor/laminas/laminas-i18n/src/
Upload File :
Current File : //proc/thread-self/root/home/rtorresani/www/vendor/laminas/laminas-i18n/src/Module.php

<?php

namespace Laminas\I18n;

use Laminas\ModuleManager\ModuleManager;
use Laminas\ServiceManager\ConfigInterface;

/**
 * @see ConfigInterface
 *
 * @psalm-import-type ServiceManagerConfigurationType from ConfigInterface
 */
class Module
{
    /**
     * Return laminas-i18n configuration for laminas-mvc application.
     *
     * @return array{
     *     filters: ServiceManagerConfigurationType,
     *     service_manager: ServiceManagerConfigurationType,
     *     validators: ServiceManagerConfigurationType,
     *     view_helpers: ServiceManagerConfigurationType,
     * }
     */
    public function getConfig()
    {
        $provider = new ConfigProvider();
        return [
            'filters'         => $provider->getFilterConfig(),
            'service_manager' => $provider->getDependencyConfig(),
            'validators'      => $provider->getValidatorConfig(),
            'view_helpers'    => $provider->getViewHelperConfig(),
        ];
    }

    /**
     * Register a specification for the TranslatorPluginManager with the ServiceListener.
     *
     * @param ModuleManager $moduleManager
     * @return void
     */
    public function init($moduleManager)
    {
        $event           = $moduleManager->getEvent();
        $container       = $event->getParam('ServiceManager');
        $serviceListener = $container->get('ServiceListener');

        $serviceListener->addServiceManager(
            'TranslatorPluginManager',
            'translator_plugins',
            'Laminas\ModuleManager\Feature\TranslatorPluginProviderInterface',
            'getTranslatorPluginConfig'
        );
    }
}