CoreFiles by mySites.guru
RouterServiceTrait.php60 lines, 1,316 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
2d79f2f14eb918900d3b3404be374809
sha1
a418c3cdb7cda029a05932a0c183e53f4cc94151
sha256
7a3542c1f07fd952b5dff20efba575e6b4c4b9198defc1aac1312997144bdee3
<?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\Component\Router;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Menu\AbstractMenu;

/**
 * Trait to implement AssociationServiceInterface
 *
 * @since  4.0.0
 */
trait RouterServiceTrait
{
	/**
	 * The router factory.
	 *
	 * @var RouterFactoryInterface
	 *
	 * @since  4.0.0
	 */
	private $routerFactory = null;

	/**
	 * Returns the router.
	 *
	 * @param   CMSApplicationInterface  $application  The application object
	 * @param   AbstractMenu             $menu         The menu object to work with
	 *
	 * @return  RouterInterface
	 *
	 * @since  4.0.0
	 */
	public function createRouter(CMSApplicationInterface $application, AbstractMenu $menu): RouterInterface
	{
		return $this->routerFactory->createRouter($application, $menu);
	}

	/**
	 * The router factory.
	 *
	 * @param   RouterFactoryInterface  $routerFactory  The router factory
	 *
	 * @return  void
	 *
	 * @since  4.0.0
	 */
	public function setRouterFactory(RouterFactoryInterface $routerFactory)
	{
		$this->routerFactory = $routerFactory;
	}
}

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