CoreFiles by mySites.guru
provider.php44 lines, 1,226 bytes, from Joomla_6.2.1-Stable-Full_Package.zip
Raw History Compare with 6.2.0
md5
fcf844bf8204f55b8a4a9907a838d8ee
sha1
d956602def1b9491b25c8dc27e04e2e0130642a6
sha256
d887671ad2b1e883935f69eaca57ca8396d317ad964300476a436d19ec2fb4b6
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Webservices.contact
 *
 * @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\Plugin\WebServices\Contact\Extension\Contact;

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,
            $container->lazy(Contact::class, function (Container $container) {
                $plugin     = new Contact(
                    (array) PluginHelper::getPlugin('webservices', 'contact')
                );
                $plugin->setApplication(Factory::getApplication());

                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.