CoreFiles by mySites.guru
provider.php46 lines, 1,304 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
e543477533778c70a33a7e13563680f7
sha1
acbdd6524627e5d41f43e194c6c602c23ffd50f7
sha256
abcc1886a35cb108bd2305a3f3207d12516fadba48c13f5a9ce0c23f6938d1d4
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Schemaorg.organization
 *
 * @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\Organization\Extension\Organization;

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 Organization(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('schemaorg', 'organization')
                );
                $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.