CoreFiles by mySites.guru
Dispatcher.php48 lines, 1,137 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
038178733c334e5b32c02b7e675458d1
sha1
c062cf0bd66c599cba5b7dbabe95506ce11ae4b8
sha256
4da133f043ae95b0938d5a95609dd10b662fccfa909b7c7156cfb85c5c1f30f0
<?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
 */
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 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.