CoreFiles by mySites.guru
Module.php46 lines, 1,217 bytes, from Joomla_4.2.0-Stable-Full_Package.zip
Raw History Compare with 4.1.5
md5
ae0ef193658de381612a9bd221ca40a1
sha1
83c418ef4398350e2b12d546cd9db7675a577585
sha256
a7cdd6a291fee2eb6d56fef91bbdba65f7bb910d8cbddd528c850ccd204d7cc2
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Extension\Service\Provider;

use Joomla\CMS\Dispatcher\ModuleDispatcherFactoryInterface;
use Joomla\CMS\Extension\ModuleInterface;
use Joomla\CMS\Helper\HelperFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the service based modules.
 *
 * @since  4.0.0
 */
class Module implements ServiceProviderInterface
{
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function register(Container $container)
    {
        $container->set(
            ModuleInterface::class,
            function (Container $container) {
                return new \Joomla\CMS\Extension\Module(
                    $container->get(ModuleDispatcherFactoryInterface::class),
                    $container->get(HelperFactoryInterface::class)
                );
            }
        );
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.