CoreFiles by mySites.guru
RouterServiceTrait.php63 lines, 1,487 bytes, from Joomla_5.1.2-Stable-Full_Package.zip
Raw History Compare with 5.1.1
md5
a440626bb4af067c5cb29bc8b3f5086b
sha1
38103bcd0059845b1c30b3c831541a0e73c0cc32
sha256
f63b0df06a8a970228c1e9b88291126f9e10b0a15234b56477fc50c8c1e9a477
<?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('_JEXEC') 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 155 releases, Joomla 5.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.