CoreFiles by mySites.guru
provider.php50 lines, 1,577 bytes, from Joomla_5.4.6-Stable-Full_Package.zip
Raw History Compare with 5.4.5
md5
4e07f9726c6a8b4f0f1a300f81a71692
sha1
6d7c1901b0216a8b06f51560b183a72bfed68321
sha256
80e2f6a8cc891e1f592bba95c191cc4a63fe13c1559d783063db04567a2a9032
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Workflow.notification
 *
 * @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\Language\LanguageFactoryInterface;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\Workflow\Notification\Extension\Notification;

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 Notification(
                    (array) PluginHelper::getPlugin('workflow', 'notification'),
                    $container->get(LanguageFactoryInterface::class)
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));
                $plugin->setUserFactory($container->get(UserFactoryInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 43 releases, Joomla 5.4.0-beta2 to 6.1.0-alpha3. See them all, or every version of this file.