CoreFiles by mySites.guru
provider.php43 lines, 1,197 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
c8e13cff0fa4378620a0b44b07467348
sha1
78626bdf663539b9da37c84c4b2ea9f39fbba560
sha256
67a516348ba963d691b3cbc08b220e8273a8794785783344bd1cd4c35d9ce20e
<?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\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,
            $container->lazy(NamespaceMap::class, function (Container $container) {
                $plugin     = new NamespaceMap(
                    new JNamespacePsr4Map(),
                    (array) PluginHelper::getPlugin('extension', 'namespacemap')
                );

                return $plugin;
            })
        );
    }
};

The same content is in 30 releases, Joomla 6.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.