CoreFiles by mySites.guru
Form.php47 lines, 1,042 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
c3d2c29831c911654cf986a848112740
sha1
ae225c8f9f2a5fc8feadac6fdfd33d8cc0415f6f
sha256
f3dfd0da68c114cf1f696a19f8779a72370d9edccc63a14a34cf57727ca7cb5e
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2018 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\Form\FormFactory;
use Joomla\CMS\Form\FormFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the form dependency
 *
 * @since  4.0
 */
class Form 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('form.factory', FormFactoryInterface::class)
			->alias(FormFactory::class, FormFactoryInterface::class)
			->share(
				FormFactoryInterface::class,
				function (Container $container)
				{
					return new FormFactory;
				},
				true
			);
	}
}

The same content is in 3 releases, Joomla 4.0.0-alpha3 to 4.0.0-alpha6. See them all, or every version of this file.