CoreFiles by mySites.guru
provider.php46 lines, 1,308 bytes, from Joomla_5.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha2
md5
8c3414440aba56c43934af9f0c6c6141
sha1
ddd6087eb52468a198acc2cc084913d08d0b3bbe
sha256
8bb6767ee8b63779927d4ece24494e53458e8029df2978cb90acfc028368de1b
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  User.contactcreator
 *
 * @copyright   (C) 2023 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\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\User\ContactCreator\Extension\ContactCreator;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function register(Container $container): void
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new ContactCreator(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('user', 'contactcreator')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 6 releases, Joomla 5.0.0-alpha2 to 5.0.0-beta3. See them all, or every version of this file.