CoreFiles by mySites.guru
Component.php61 lines, 1,538 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
50d78f586db49d24a29a3e2a587fa6ff
sha1
81807f038bb41ea1d947504d4ac875fb75fca72f
sha256
d58098c8768701ff65d84e050a745a88a0724e8534a108adbdbf2c82dd648615
<?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('JPATH_PLATFORM') 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 70 releases, Joomla 4.2.1 to 4.4.14. See them all, or every version of this file.