CoreFiles by mySites.guru
Component.php61 lines, 1,530 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
d6e484ce6ec8cd3667b7d0097672c51e
sha1
b47b09a632c1769bd0a0456c6d6e6fc8d89c1c59
sha256
575576cd169eec17e95f4733c3b07f2add30434ab35ab85d804d07c8970b71a7
<?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\Extension;

use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Dispatcher\DispatcherInterface;

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

/**
 * Access to component specific services.
 *
 * @since  4.0.0
 */
class Component implements ComponentInterface
{
    /**
     * The dispatcher factory.
     *
     * @var ComponentDispatcherFactoryInterface
     *
     * @since  4.0.0
     */
    private $dispatcherFactory;

    /**
     * Component constructor.
     *
     * @param   ComponentDispatcherFactoryInterface  $dispatcherFactory  The dispatcher factory
     *
     * @since   4.0.0
     */
    public function __construct(ComponentDispatcherFactoryInterface $dispatcherFactory)
    {
        $this->dispatcherFactory = $dispatcherFactory;
    }

    /**
     * Returns the dispatcher for the given application.
     *
     * @param   CMSApplicationInterface  $application  The application
     *
     * @return  DispatcherInterface
     *
     * @since   4.0.0
     */
    public function getDispatcher(CMSApplicationInterface $application): DispatcherInterface
    {
        return $this->dispatcherFactory->createDispatcher($application);
    }
}

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.