CoreFiles by mySites.guru
RouterServiceTrait.php59 lines, 1,380 bytes, from Joomla_4.2.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta2
md5
cc1f40316c75d1aad8a686805d77f76d
sha1
b6e6c5420abe305ae63be35558d9b1a0ed550680
sha256
2f6f991eb0a0f55fa613a81db36b273d46e2e15736f647d04233f8502bcf1bf0
<?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;

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