CoreFiles by mySites.guru
provider.php47 lines, 1,270 bytes, from Joomla_5.2.6-Stable-Full_Package.zip
Raw History Compare with 5.2.5
md5
ebba0d606c056e2250e2b633e2a44651
sha1
26b239c47114a03850f0aca750f4a349a979c0c3
sha256
6f75b43f6e83d8f8fdcf7652ba5ac8627fb8dc60e8d694f5ab105c705e8ab9fa
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Schemaorg.event
 *
 * @copyright   (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

\defined('_JEXEC') or die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Schemaorg\Event\Extension\Event;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   5.0.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin = new Event(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('schemaorg', 'event')
                );

                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 61 releases, Joomla 5.1.0-beta2 to 6.0.0-beta1. See them all, or every version of this file.