CoreFiles by mySites.guru
RouterServiceTrait.php60 lines, 1,304 bytes, from Joomla_4.1.2-Stable-Full_Package.zip
Raw History Compare with 4.1.1
md5
79ad54350ef073fffc742ee1b4392a94
sha1
fd2efe940a1495c56b421c631ea7a0a26d88df87
sha256
25ccbb049ae001dbfcd267b2c959dfe32b8238868b8ca693a372ae03cd2df258
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @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 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.