CoreFiles by mySites.guru
User.php48 lines, 1,124 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
bda6a35c64bfe604aaad627c17476f16
sha1
c801e9f9cc5a593bcd2adb2bf5713a4806173f3e
sha256
e97d18de7fb57f2b5fe892e535aebd4597ad900d6a732b8f82febc91f4b6684e
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Service\Provider;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\User\UserFactory;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the user dependency
 *
 * @since  4.0
 */
class User implements ServiceProviderInterface
{
	/**
	 * Registers the service provider with a DI container.
	 *
	 * @param   Container  $container  The DI container.
	 *
	 * @return  void
	 *
	 * @since   4.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 4 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha11. See them all, or every version of this file.