CoreFiles by mySites.guru
provider.php46 lines, 1,349 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
a215d0dae69bc07af845696326c3de9d
sha1
a47da09d9a69615d7587a4d8805bb50a02dce622
sha256
7cb9eb84dc9d9912e58f05c317629427876472305935f39c8fee003f3e410cf5
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Editors.codemirror
 *
 * @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\Editors\CodeMirror\Extension\Codemirror;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            $container->lazy(Codemirror::class, function (Container $container) {
                $plugin     = new Codemirror(
                    (array) PluginHelper::getPlugin('editors', 'codemirror')
                );
                $plugin->setDispatcher($container->get(DispatcherInterface::class));
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            })
        );
    }
};

The same content is in 28 releases, Joomla 6.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.