CoreFiles by mySites.guru
User.php50 lines, 1,316 bytes, from Joomla_5.4.2-Stable-Full_Package.zip
Raw History Compare with 5.4.1
md5
1305bea02fb1bae80bf4c5ebf670d9af
sha1
05fecf0b16cd78de1993d8003854f5e560d4d378
sha256
2a59e2450a4ea8b7307183c2ca07ff9d1c7d9bc463490123604f4b0c0eb302f1
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2019 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\User\UserFactory;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
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 user dependency
 *
 * @since  4.0.0
 */
class User implements ServiceProviderInterface
{
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function register(Container $container)
    {
        $container->alias('user.factory', UserFactoryInterface::class)
            ->alias(UserFactory::class, UserFactoryInterface::class)
            ->share(
                UserFactoryInterface::class,
                function (Container $container) {
                    return new UserFactory($container->get(DatabaseInterface::class));
                },
                true
            );
    }
}

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