CoreFiles by mySites.guru
Dispatcher.php45 lines, 1,216 bytes, from Joomla_4.2.0-Stable-Full_Package.zip
Raw History Compare with 4.1.5
md5
0c9cc89e14005f77ad48ab6815ff3a57
sha1
3bbaa581ffa99f50d169b1e74cfd0cf7af8521e9
sha256
5c4b7d1e26e14401d13009d6fce15f13b2df9bd2906cd94f4b48318a404685c4
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Service\Provider;

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 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.