CoreFiles by mySites.guru
Document.php47 lines, 1,048 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
d6b4ed1b87b13066e9289bd8e21f1f3a
sha1
01beb8d212d908baa8d2b3bd8690a78d9de5a9e1
sha256
7e1d340ad9ee46bec149b2285846cbfbdfa768bcb6a85299380404527b214a35
<?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\Document\Factory;
use Joomla\CMS\Document\FactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the application's document dependency
 *
 * @since  4.0
 */
class Document 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('document.factory', FactoryInterface::class)
			->alias(Factory::class, FactoryInterface::class)
			->share(
				FactoryInterface::class,
				function (Container $container)
				{
					return new Factory;
				},
				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.