CoreFiles by mySites.guru
Mailer.php47 lines, 1,115 bytes, from Joomla_5.2.5-Stable-Full_Package.zip
Raw History Compare with 5.2.4
md5
aa3d011ebfdc30ab6ca58b16376ac7a0
sha1
9e78a8ca6396a17fa4c956097baee45291f4e871
sha256
3557564a0157766e9db8d4b9b10946f36283a0d69311e64a766fc52bd3fe86fb
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Service\Provider;

use Joomla\CMS\Mail\MailerFactory;
use Joomla\CMS\Mail\MailerFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Service provider for the mailer dependency
 *
 * @since  4.4.0
 */
class Mailer 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)
    {
        $container->share(
            MailerFactoryInterface::class,
            function (Container $container) {
                return new MailerFactory($container->get('config'));
            },
            true
        );
    }
}

The same content is in 153 releases, Joomla 5.0.0-alpha3 to 6.2.1-rc1. See them all, or every version of this file.