CoreFiles by mySites.guru
RouterServiceTrait.php63 lines, 1,495 bytes, from Joomla_4.4.9-Stable-Full_Package.zip
Raw History Compare with 4.4.8
md5
c90dcd97634d6091f54be1abb83b7977
sha1
c6c9726e597c371fbcd5e1fd1f87442066e61f6b
sha256
f27a75255ba9c12100a28d787510f2b77ae8d44a42c695102502a8365bab3d72
<?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;

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

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * 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 70 releases, Joomla 4.2.1 to 4.4.14. See them all, or every version of this file.