CoreFiles by mySites.guru
ModuleDispatcherFactory.php64 lines, 1,321 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
ca85e41cb83ce777e68f1eac5b6719c3
sha1
a4aee2b9a44280cd9ec766ae8242e4a6f9fb3b96
sha256
e1a1e934730620bd6006467b076abc1e668299f88b0b49c1b1a3eb836416214a
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Extension\Service\Provider;

\defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Dispatcher\ModuleDispatcherFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the service dispatcher factory.
 *
 * @since  4.0.0
 */
class ModuleDispatcherFactory implements ServiceProviderInterface
{
	/**
	 * The module namespace
	 *
	 * @var  string
	 *
	 * @since   4.0.0
	 */
	private $namespace;

	/**
	 * ComponentDispatcherFactory constructor.
	 *
	 * @param   string  $namespace  The namespace
	 *
	 * @since   4.0.0
	 */
	public function __construct(string $namespace)
	{
		$this->namespace = $namespace;
	}

	/**
	 * 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(
			ModuleDispatcherFactoryInterface::class,
			function (Container $container)
			{
				return new \Joomla\CMS\Dispatcher\ModuleDispatcherFactory($this->namespace);
			}
		);
	}
}

No other release has this exact content. See every version of this file.