CoreFiles by mySites.guru
provider.php42 lines, 1,052 bytes, from Joomla_4.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta3
md5
bf328d55cd1b7e0e889e380bf6d06979
sha1
d10dd331bdf3f9a5bb25b8084c5581f3672bf422
sha256
eae6851b2f775598614e07dab1f7cb6e468e69bb27657497c576f7e2b66e2587
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Multifactorauth.totp
 *
 * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') || die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Multifactorauth\Totp\Extension\Totp;

return new class implements ServiceProviderInterface
{
	/**
	 * Registers the service provider with a DI container.
	 *
	 * @param   Container  $container  The DI container.
	 *
	 * @return  void
	 *
	 * @since 4.2.0
	 */
	public function register(Container $container)
	{
		$container->set(
			PluginInterface::class,
			function (Container $container) {
				$config  = (array) PluginHelper::getPlugin('multifactorauth', 'totp');
				$subject = $container->get(DispatcherInterface::class);

				return new Totp($subject, $config);
			}
		);
	}
};

No other release has this exact content. See every version of this file.