CoreFiles by mySites.guru
Dispatcher.php47 lines, 1,089 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
73828883db5b0340750feb30a661d304
sha1
d9f1d127feb8c276125dd0df37b8bcc6f534f277
sha256
b325a3c9e4f03d1fe134722b88d3c923cbce1e97f4d0977eb9204a8fe313a85e
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Service
 *
 * @copyright   Copyright (C) 2005 - 2018 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;

/**
 * Service provider for the application's 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', 'Joomla\Event\DispatcherInterface')
			->alias('Joomla\Event\Dispatcher', 'Joomla\Event\DispatcherInterface')
			->share(
				'Joomla\Event\DispatcherInterface',
				function (Container $container)
				{
					return new EventDispatcher;
				},
				true
			);
	}
}

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