* * This file is part of a Moko Consulting project. * * SPDX-LICENSE-IDENTIFIER: GPL-3.0-or-later * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License (./LICENSE.md). * * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS * REPO: https://github.com/mokoconsulting-tech/mokowaas * VERSION: 02.01.08 * PATH: /src/services/provider.php * BRIEF: Service provider for dependency injection in Joomla 5.x * NOTE: Registers the plugin with Joomla's DI container */ 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 Moko\Plugin\System\MokoWaaS\Extension\MokoWaaS; return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 01.04.00 */ public function register(Container $container) { $container->set( PluginInterface::class, function (Container $container) { $plugin = new MokoWaaS( $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'mokowaas') ); $plugin->setApplication(Factory::getApplication()); return $plugin; } ); } };