CoreFiles by mySites.guru
Dispatcher.php48 lines, 1,141 bytes, from Joomla_4.0.0-Stable-Full_Package.zip
Raw History Compare with 3.10.12
md5
a22c64ad6b34c045cb343342110b8895
sha1
b40da355e8e72d049793391f0bbd1135bc8cf58b
sha256
177a22fcf1926b819a4f5d2a9f9646c6fe9de744916cde0109641cc31b4efb30
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Service
 *
 * @copyright   (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Service\Provider;

\defined('JPATH_PLATFORM') or die;

use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\Dispatcher as EventDispatcher;
use Joomla\Event\DispatcherInterface as EventDispatcherInterface;

/**
 * Service provider for the application's event dispatcher dependency
 *
 * @since  4.0.0
 */
class Dispatcher 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->alias('dispatcher', EventDispatcherInterface::class)
			->alias(EventDispatcher::class, EventDispatcherInterface::class)
			->share(
				EventDispatcherInterface::class,
				function (Container $container)
				{
					return new EventDispatcher;
				},
				true
			);
	}
}

The same content is in 7 releases, Joomla 4.0.0-rc1 to 4.0.0. See them all, or every version of this file.