CoreFiles by mySites.guru
Dispatcher.php48 lines, 1,150 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
990abe2d2da03a1e0b285954c1aeb437
sha1
a58081d040ad673c58c3475959ea8feacd0dcf41
sha256
845cebf0fd734334d1e2dee63a5b316132444727b9abdd157ffa882f3fa74f90
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Service
 *
 * @copyright   Copyright (C) 2005 - 2020 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-beta to 4.0.0-beta5. See them all, or every version of this file.