CoreFiles by mySites.guru
Dispatcher.php49 lines, 1,335 bytes, from Joomla_4.3.3-Stable-Full_Package.zip
Raw History Compare with 4.3.2
md5
f4453a493217aa623bb9ba1c7408e508
sha1
4a350c695fe9194f3cd5bb7cbd4ce11cc7c14c64
sha256
22f1647b5edee93fa962e38e187a488e3985e6b5a7ec06f29914c3e09b65eb1e
<?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.txt
 */

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;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * 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 43 releases, Joomla 4.3.2-rc1 to 4.4.14. See them all, or every version of this file.