From 9577e060eb367ab340b19b483c19bfed3aa49743 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <1+jmiller@noreply.git.mokoconsulting.tech> Date: Sat, 27 Jun 2026 20:41:10 +0000 Subject: [PATCH] fix: add RouterFactoryInterface to component provider --- .../admin/services/provider.php | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/source/packages/com_mokosuitestorage/admin/services/provider.php b/source/packages/com_mokosuitestorage/admin/services/provider.php index a7e02a6..1ee00c8 100644 --- a/source/packages/com_mokosuitestorage/admin/services/provider.php +++ b/source/packages/com_mokosuitestorage/admin/services/provider.php @@ -1,30 +1,28 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ defined('_JEXEC') or die; -use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\Extension\ComponentInterface; use Joomla\CMS\Extension\MVCComponent; +use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; -use Joomla\CMS\Router\ApiRouter; +use Joomla\CMS\Component\Router\RouterFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -return new class implements ServiceProviderInterface -{ - public function register(Container $container): void - { - $container->set( - ComponentInterface::class, - function (Container $container) { - $component = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); - $component->setMVCFactory($container->get(MVCFactoryInterface::class)); - return $component; - } - ); +return new class implements ServiceProviderInterface { + public function register(Container $container): void { + $container->set(ComponentInterface::class, function (Container $container) { + $c = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); + $c->setMVCFactory($container->get(MVCFactoryInterface::class)); + $c->setRouterFactory($container->get(RouterFactoryInterface::class)); + return $c; + }); } };