CoreFiles by mySites.guru
provider.php45 lines, 1,261 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
5c0836e43e258e1bf400281e24cbce0e
sha1
1d3bdc081d67ea8767d44bfd0a4d8c8b42bcd34c
sha256
bd58eb9860b210fd07517f0802defd995e29bdb1961c7f41b58f03d7027d95c6
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Extension.namespacemap
 *
 * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

\defined('_JEXEC') or die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Extension\NamespaceMap\Extension\NamespaceMap;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new NamespaceMap(
                    $container->get(DispatcherInterface::class),
                    new JNamespacePsr4Map(),
                    (array) PluginHelper::getPlugin('extension', 'namespacemap')
                );

                return $plugin;
            }
        );
    }
};

The same content is in 77 releases, Joomla 5.0.0-rc to 6.0.0-beta1. See them all, or every version of this file.