CoreFiles by mySites.guru
provider.php48 lines, 1,341 bytes, from Joomla_5.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta1
md5
19cc6bd985b97883614a1633af166841
sha1
b49c6cbcfe1a8b9d4beb55395f491d8f9fba5062
sha256
cd07d55f8b5da4ab3463e0d2147a0146aaa33e952dc629a874ec22f8053f9bb2
<?php

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

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) {
                $dispatcher = $container->get(DispatcherInterface::class);
                $plugin     = new JobPosting(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('schemaorg', 'jobposting')
                );

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

                return $plugin;
            }
        );
    }
};

The same content is in 5 releases, Joomla 5.0.0-alpha3 to 5.0.0-beta3. See them all, or every version of this file.