CoreFiles by mySites.guru
Dispatcher.php48 lines, 1,149 bytes, from Joomla_4.0.0-alpha10-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha9
md5
d82b441abb4ba60420ec0d4313c36d55
sha1
7aed6c362ba51aa06110ca3c5a72a8841b100737
sha256
b8118234583b878715e9b36e59f289eb5662836917793318dcf914fa4486f9ec
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Service
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @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
 */
class Dispatcher implements ServiceProviderInterface
{
	/**
	 * Registers the service provider with a DI container.
	 *
	 * @param   Container  $container  The DI container.
	 *
	 * @return  void
	 *
	 * @since   4.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 5 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha11. See them all, or every version of this file.