diff --git a/administrator/components/com_finder/src/Indexer/Adapter.php b/administrator/components/com_finder/src/Indexer/Adapter.php index d554f0c5b6799..0f25a148d22d7 100644 --- a/administrator/components/com_finder/src/Indexer/Adapter.php +++ b/administrator/components/com_finder/src/Indexer/Adapter.php @@ -131,15 +131,21 @@ abstract class Adapter extends CMSPlugin /** * Method to instantiate the indexer adapter. * - * @param DispatcherInterface $dispatcher The object to observe. * @param array $config An array that holds the plugin configuration. * * @since 2.5 */ - public function __construct(DispatcherInterface $dispatcher, array $config) + public function __construct($config) { // Call the parent constructor. - parent::__construct($dispatcher, $config); + if ($config instanceof DispatcherInterface) { + $dispatcher = $config; + $config = \func_num_args() > 1 ? func_get_arg(1) : []; + + parent::__construct($dispatcher, $config); + } else { + parent::__construct($config); + } // Get the type id. $this->type_id = $this->getTypeId(); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f33fcdb2d7e93..c185ade8549b9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -17387,6 +17387,16 @@ parameters: count: 2 path: plugins/content/confirmconsent/src/Field/ConsentBoxField.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\Content\\Finder\\Extension\\Finder\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/content/finder/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\Content\\Finder\\Extension\\Finder\: @@ -17490,6 +17500,16 @@ parameters: count: 2 path: plugins/editors/codemirror/layouts/editors/codemirror/codemirror.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\Editors\\CodeMirror\\Extension\\Codemirror\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/editors/codemirror/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\Editors\\CodeMirror\\Extension\\Codemirror\: @@ -17500,6 +17520,16 @@ parameters: count: 1 path: plugins/editors/codemirror/src/Extension/Codemirror.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\Editors\\None\\Extension\\None\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/editors/none/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\Editors\\None\\Extension\\None\: @@ -17510,6 +17540,16 @@ parameters: count: 1 path: plugins/editors/none/src/Extension/None.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\Editors\\TinyMCE\\Extension\\TinyMCE\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/editors/tinymce/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\Editors\\TinyMCE\\Extension\\TinyMCE\: @@ -17723,6 +17763,16 @@ parameters: count: 2 path: plugins/system/actionlogs/src/Extension/ActionLogs.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\System\\Cache\\Extension\\Cache\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/system/cache/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\System\\Cache\\Extension\\Cache\: @@ -17926,6 +17976,16 @@ parameters: count: 1 path: plugins/system/languagefilter/src/Extension/LanguageFilter.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\System\\Schemaorg\\Extension\\Schemaorg\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/system/schemaorg/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\System\\Schemaorg\\Extension\\Schemaorg\: @@ -17936,6 +17996,16 @@ parameters: count: 4 path: plugins/system/schemaorg/src/Extension/Schemaorg.php + - + message: ''' + #^Call to deprecated method setDispatcher\(\) of class Joomla\\Plugin\\System\\Shortcut\\Extension\\Shortcut\: + 5\.2 will be removed in 7\.0 + Plugin should implement DispatcherAwareInterface on its own, when it is needed\.$# + ''' + identifier: method.deprecated + count: 1 + path: plugins/system/shortcut/services/provider.php + - message: ''' #^Call to deprecated method getDispatcher\(\) of class Joomla\\Plugin\\System\\Shortcut\\Extension\\Shortcut\: diff --git a/plugins/actionlog/joomla/services/provider.php b/plugins/actionlog/joomla/services/provider.php index 08dd6fee295f7..de8f527bef365 100644 --- a/plugins/actionlog/joomla/services/provider.php +++ b/plugins/actionlog/joomla/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Actionlog\Joomla\Extension\Joomla; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Joomla( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('actionlog', 'joomla') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/actionlog/joomla/src/Extension/Joomla.php b/plugins/actionlog/joomla/src/Extension/Joomla.php index 9069342fcfc70..e67ea42e671bb 100644 --- a/plugins/actionlog/joomla/src/Extension/Joomla.php +++ b/plugins/actionlog/joomla/src/Extension/Joomla.php @@ -24,7 +24,6 @@ use Joomla\Component\Actionlogs\Administrator\Plugin\ActionLogPlugin; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\Exception\ExecutionFailureException; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Event; use Joomla\Event\SubscriberInterface; use Joomla\Utilities\ArrayHelper; @@ -78,14 +77,13 @@ final class Joomla extends ActionLogPlugin implements SubscriberInterface /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * * @since 3.9.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config) + public function __construct(array $config) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $params = ComponentHelper::getComponent('com_actionlogs')->getParams(); diff --git a/plugins/api-authentication/basic/services/provider.php b/plugins/api-authentication/basic/services/provider.php index 6110f24b81b5f..d91e83ca2b636 100644 --- a/plugins/api-authentication/basic/services/provider.php +++ b/plugins/api-authentication/basic/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\ApiAuthentication\Basic\Extension\Basic; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Basic( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('api-authentication', 'basic'), ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/api-authentication/token/services/provider.php b/plugins/api-authentication/token/services/provider.php index b6cef2bf3393c..d0dcf44cdb6dd 100644 --- a/plugins/api-authentication/token/services/provider.php +++ b/plugins/api-authentication/token/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Filter\InputFilter; use Joomla\Plugin\ApiAuthentication\Token\Extension\Token; @@ -37,7 +36,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Token( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('api-authentication', 'token'), new InputFilter() ); diff --git a/plugins/api-authentication/token/src/Extension/Token.php b/plugins/api-authentication/token/src/Extension/Token.php index 2e82cacf35d9c..9831071472cca 100644 --- a/plugins/api-authentication/token/src/Extension/Token.php +++ b/plugins/api-authentication/token/src/Extension/Token.php @@ -17,7 +17,6 @@ use Joomla\CMS\User\UserFactoryAwareTrait; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\ParameterType; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filter\InputFilter; @@ -74,15 +73,14 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param InputFilter $filter The input filter * * @since 4.2.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, InputFilter $filter) + public function __construct(array $config, InputFilter $filter) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->filter = $filter; } diff --git a/plugins/authentication/cookie/services/provider.php b/plugins/authentication/cookie/services/provider.php index 7e54ac4747021..0515874f251ba 100644 --- a/plugins/authentication/cookie/services/provider.php +++ b/plugins/authentication/cookie/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Authentication\Cookie\Extension\Cookie; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Cookie( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('authentication', 'cookie') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/authentication/joomla/services/provider.php b/plugins/authentication/joomla/services/provider.php index 2cd702eee4b4b..fd5fbaa3f62d4 100644 --- a/plugins/authentication/joomla/services/provider.php +++ b/plugins/authentication/joomla/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Authentication\Joomla\Extension\Joomla; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Joomla( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('authentication', 'joomla') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/authentication/ldap/services/provider.php b/plugins/authentication/ldap/services/provider.php index ded1cfb43a019..f8e9361e9ac3e 100644 --- a/plugins/authentication/ldap/services/provider.php +++ b/plugins/authentication/ldap/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Authentication\Ldap\Extension\Ldap; use Joomla\Plugin\Authentication\Ldap\Factory\LdapFactory; @@ -36,7 +35,6 @@ public function register(Container $container) function (Container $container) { $plugin = new Ldap( new LdapFactory(), - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('authentication', 'ldap') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/authentication/ldap/src/Extension/Ldap.php b/plugins/authentication/ldap/src/Extension/Ldap.php index 5d11a818df7a4..64eb035b0dc28 100644 --- a/plugins/authentication/ldap/src/Extension/Ldap.php +++ b/plugins/authentication/ldap/src/Extension/Ldap.php @@ -14,7 +14,6 @@ use Joomla\CMS\Event\User\AuthenticationEvent; use Joomla\CMS\Log\Log; use Joomla\CMS\Plugin\CMSPlugin; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\Authentication\Ldap\Factory\LdapFactoryInterface; use Symfony\Component\Ldap\Entry; @@ -45,16 +44,15 @@ final class Ldap extends CMSPlugin implements SubscriberInterface * Constructor * * @param LdapFactoryInterface $factory The Ldap factory - * @param DispatcherInterface $dispatcher The object to observe * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' * (this list is not meant to be comprehensive). * * @since 4.3.0 */ - public function __construct(LdapFactoryInterface $factory, DispatcherInterface $dispatcher, array $config = []) + public function __construct(LdapFactoryInterface $factory, array $config = []) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->factory = $factory; } diff --git a/plugins/behaviour/compat/services/provider.php b/plugins/behaviour/compat/services/provider.php index b239608b70959..50eee2a0739da 100644 --- a/plugins/behaviour/compat/services/provider.php +++ b/plugins/behaviour/compat/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Behaviour\Compat\Extension\Compat; return new class () implements ServiceProviderInterface { @@ -32,10 +31,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = PluginHelper::getPlugin('behaviour', 'compat'); - $dispatcher = $container->get(DispatcherInterface::class); - - $plugin = new Compat($dispatcher, (array) $plugin); + $plugin = new Compat((array) PluginHelper::getPlugin('behaviour', 'compat')); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index 7232a8866269a..8e9b5545436d7 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -12,7 +12,6 @@ use Joomla\CMS\Event\Application\AfterInitialiseDocumentEvent; use Joomla\CMS\Plugin\CMSPlugin; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Priority; use Joomla\Event\SubscriberInterface; @@ -49,16 +48,15 @@ public static function getSubscribedEvents(): array /** * Constructor * - * @param DispatcherInterface $dispatcher The event dispatcher * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' * (this list is not meant to be comprehensive). * * @since 1.5 */ - public function __construct(DispatcherInterface $dispatcher, array $config = []) + public function __construct(array $config = []) { - parent::__construct($dispatcher, $config); + parent::__construct($config); /** * Normally we should never use the constructor to execute any logic which would diff --git a/plugins/behaviour/compat6/services/provider.php b/plugins/behaviour/compat6/services/provider.php index cf9708aca13c4..ca691df3a40f5 100644 --- a/plugins/behaviour/compat6/services/provider.php +++ b/plugins/behaviour/compat6/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Behaviour\Compat6\Extension\Compat6; return new class () implements ServiceProviderInterface { @@ -32,10 +31,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = PluginHelper::getPlugin('behaviour', 'compat6'); - $dispatcher = $container->get(DispatcherInterface::class); - - $plugin = new Compat6($dispatcher, (array) $plugin); + $plugin = new Compat6((array) PluginHelper::getPlugin('behaviour', 'compat6')); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/behaviour/taggable/services/provider.php b/plugins/behaviour/taggable/services/provider.php index ab99b82347cb2..507c7c0b0da6e 100644 --- a/plugins/behaviour/taggable/services/provider.php +++ b/plugins/behaviour/taggable/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Behaviour\Taggable\Extension\Taggable; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Taggable( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('behaviour', 'taggable') ); diff --git a/plugins/behaviour/versionable/services/provider.php b/plugins/behaviour/versionable/services/provider.php index c3ad1000b9fd7..a94f53cfadf9a 100644 --- a/plugins/behaviour/versionable/services/provider.php +++ b/plugins/behaviour/versionable/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Filter\InputFilter; use Joomla\Plugin\Behaviour\Versionable\Extension\Versionable; @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Versionable( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('behaviour', 'versionable'), new InputFilter(), new CMSHelper() diff --git a/plugins/behaviour/versionable/src/Extension/Versionable.php b/plugins/behaviour/versionable/src/Extension/Versionable.php index 3f5f5bc3b974d..0f4b57d59b1e0 100644 --- a/plugins/behaviour/versionable/src/Extension/Versionable.php +++ b/plugins/behaviour/versionable/src/Extension/Versionable.php @@ -17,7 +17,6 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Versioning\VersionableTableInterface; use Joomla\CMS\Versioning\Versioning; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filter\InputFilter; @@ -68,16 +67,15 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param InputFilter $filter The input filter * @param CMSHelper $helper The CMS helper * * @since 4.0.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, InputFilter $filter, CMSHelper $helper) + public function __construct(array $config, InputFilter $filter, CMSHelper $helper) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->filter = $filter; $this->helper = $helper; diff --git a/plugins/content/confirmconsent/services/provider.php b/plugins/content/confirmconsent/services/provider.php index edc2e8ddf404c..e7826f7f8051a 100644 --- a/plugins/content/confirmconsent/services/provider.php +++ b/plugins/content/confirmconsent/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\ConfirmConsent\Extension\ConfirmConsent; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new ConfirmConsent( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'confirmconsent') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/contact/services/provider.php b/plugins/content/contact/services/provider.php index 799e59318595c..bec48f2e46c03 100644 --- a/plugins/content/contact/services/provider.php +++ b/plugins/content/contact/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\Contact\Extension\Contact; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Contact( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'contact') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/emailcloak/services/provider.php b/plugins/content/emailcloak/services/provider.php index a0f7a4bfe14f4..18408035f6073 100644 --- a/plugins/content/emailcloak/services/provider.php +++ b/plugins/content/emailcloak/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\EmailCloak\Extension\EmailCloak; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new EmailCloak( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'emailcloak') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/fields/services/provider.php b/plugins/content/fields/services/provider.php index 83ac648494aa1..2e1d55bf734a0 100644 --- a/plugins/content/fields/services/provider.php +++ b/plugins/content/fields/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\Fields\Extension\Fields; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Fields( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'fields') ); diff --git a/plugins/content/finder/services/provider.php b/plugins/content/finder/services/provider.php index 2625c3054ad40..cbe8d01ba857c 100644 --- a/plugins/content/finder/services/provider.php +++ b/plugins/content/finder/services/provider.php @@ -34,9 +34,9 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Finder( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'finder') ); + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/content/joomla/services/provider.php b/plugins/content/joomla/services/provider.php index 73958756fb20a..8e4eb33cdabd8 100644 --- a/plugins/content/joomla/services/provider.php +++ b/plugins/content/joomla/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\Joomla\Extension\Joomla; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Joomla( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'joomla') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/loadmodule/services/provider.php b/plugins/content/loadmodule/services/provider.php index ce15a1ebe5137..043544d6f705d 100644 --- a/plugins/content/loadmodule/services/provider.php +++ b/plugins/content/loadmodule/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\LoadModule\Extension\LoadModule; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new LoadModule( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'loadmodule') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/pagebreak/services/provider.php b/plugins/content/pagebreak/services/provider.php index 8f03e7c6f1bd3..572be7829f318 100644 --- a/plugins/content/pagebreak/services/provider.php +++ b/plugins/content/pagebreak/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\PageBreak\Extension\PageBreak; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new PageBreak( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'pagebreak') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/pagenavigation/services/provider.php b/plugins/content/pagenavigation/services/provider.php index 5ea2240690c95..868b90a5fcb87 100644 --- a/plugins/content/pagenavigation/services/provider.php +++ b/plugins/content/pagenavigation/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\PageNavigation\Extension\PageNavigation; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new PageNavigation( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'pagenavigation') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/content/vote/services/provider.php b/plugins/content/vote/services/provider.php index 5c64f931467c3..7220ed3455f5d 100644 --- a/plugins/content/vote/services/provider.php +++ b/plugins/content/vote/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Content\Vote\Extension\Vote; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Vote( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('content', 'vote') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/article/services/provider.php b/plugins/editors-xtd/article/services/provider.php index 282174966158c..0d21165e8714b 100644 --- a/plugins/editors-xtd/article/services/provider.php +++ b/plugins/editors-xtd/article/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Article\Extension\Article; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Article( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'article') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/contact/services/provider.php b/plugins/editors-xtd/contact/services/provider.php index ca60a759ed1fb..705a373bcb77c 100644 --- a/plugins/editors-xtd/contact/services/provider.php +++ b/plugins/editors-xtd/contact/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Contact\Extension\Contact; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Contact( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'contact') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/fields/services/provider.php b/plugins/editors-xtd/fields/services/provider.php index f164457254ae8..efde3bcb44d54 100644 --- a/plugins/editors-xtd/fields/services/provider.php +++ b/plugins/editors-xtd/fields/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Fields\Extension\Fields; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Fields( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'fields') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/image/services/provider.php b/plugins/editors-xtd/image/services/provider.php index eaea7692a4c3a..7577f695e1dc3 100644 --- a/plugins/editors-xtd/image/services/provider.php +++ b/plugins/editors-xtd/image/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Image\Extension\Image; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Image( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'image') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/menu/services/provider.php b/plugins/editors-xtd/menu/services/provider.php index 5afb2df74a9a5..ef88e920ea38e 100644 --- a/plugins/editors-xtd/menu/services/provider.php +++ b/plugins/editors-xtd/menu/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Menu\Extension\Menu; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Menu( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'menu') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/module/services/provider.php b/plugins/editors-xtd/module/services/provider.php index fcd5199f16590..c70ca868478c9 100644 --- a/plugins/editors-xtd/module/services/provider.php +++ b/plugins/editors-xtd/module/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\Module\Extension\Module; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Module( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'module') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/pagebreak/services/provider.php b/plugins/editors-xtd/pagebreak/services/provider.php index e7c1b733ccae5..ed8cbdabfb92b 100644 --- a/plugins/editors-xtd/pagebreak/services/provider.php +++ b/plugins/editors-xtd/pagebreak/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\PageBreak\Extension\PageBreak; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new PageBreak( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'pagebreak') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors-xtd/readmore/services/provider.php b/plugins/editors-xtd/readmore/services/provider.php index c713036c86def..22b77dd280aa8 100644 --- a/plugins/editors-xtd/readmore/services/provider.php +++ b/plugins/editors-xtd/readmore/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\EditorsXtd\ReadMore\Extension\ReadMore; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new ReadMore( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors-xtd', 'readmore') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/editors/codemirror/services/provider.php b/plugins/editors/codemirror/services/provider.php index 74ff09c3f2d16..e3d55f98bb181 100644 --- a/plugins/editors/codemirror/services/provider.php +++ b/plugins/editors/codemirror/services/provider.php @@ -34,9 +34,9 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Codemirror( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors', 'codemirror') ); + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/editors/none/services/provider.php b/plugins/editors/none/services/provider.php index d4174182f11d3..6e5663ee93702 100644 --- a/plugins/editors/none/services/provider.php +++ b/plugins/editors/none/services/provider.php @@ -34,9 +34,9 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new None( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors', 'none') ); + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/editors/tinymce/services/provider.php b/plugins/editors/tinymce/services/provider.php index b210f970f356f..564028247624b 100644 --- a/plugins/editors/tinymce/services/provider.php +++ b/plugins/editors/tinymce/services/provider.php @@ -35,9 +35,9 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new TinyMCE( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('editors', 'tinymce') ); + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); $plugin->setDatabase($container->get(DatabaseInterface::class)); diff --git a/plugins/extension/finder/services/provider.php b/plugins/extension/finder/services/provider.php index 76cf69793b9a7..a6290c7215aa2 100644 --- a/plugins/extension/finder/services/provider.php +++ b/plugins/extension/finder/services/provider.php @@ -15,7 +15,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Extension\Finder\Extension\Finder; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Finder( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('extension', 'finder') ); $plugin->setDatabase($container->get(DatabaseInterface::class)); diff --git a/plugins/extension/joomla/services/provider.php b/plugins/extension/joomla/services/provider.php index 074a9475e31ef..90afe8e07c70d 100644 --- a/plugins/extension/joomla/services/provider.php +++ b/plugins/extension/joomla/services/provider.php @@ -15,7 +15,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Extension\Joomla\Extension\Joomla; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Joomla( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('extension', 'joomla') ); $plugin->setDatabase($container->get(DatabaseInterface::class)); diff --git a/plugins/extension/joomlaupdate/services/provider.php b/plugins/extension/joomlaupdate/services/provider.php index 93520836cb062..95b0849177066 100644 --- a/plugins/extension/joomlaupdate/services/provider.php +++ b/plugins/extension/joomlaupdate/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Extension\Joomlaupdate\Extension\Joomlaupdate; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Joomlaupdate( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('extension', 'joomlaupdate') ); diff --git a/plugins/extension/namespacemap/services/provider.php b/plugins/extension/namespacemap/services/provider.php index ba5918d804c79..c38ce38bcb864 100644 --- a/plugins/extension/namespacemap/services/provider.php +++ b/plugins/extension/namespacemap/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Extension\NamespaceMap\Extension\NamespaceMap; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new NamespaceMap( - $container->get(DispatcherInterface::class), new JNamespacePsr4Map(), (array) PluginHelper::getPlugin('extension', 'namespacemap') ); diff --git a/plugins/extension/namespacemap/src/Extension/NamespaceMap.php b/plugins/extension/namespacemap/src/Extension/NamespaceMap.php index aa3fe2613ce26..f98e54a2f1b8e 100644 --- a/plugins/extension/namespacemap/src/Extension/NamespaceMap.php +++ b/plugins/extension/namespacemap/src/Extension/NamespaceMap.php @@ -14,7 +14,6 @@ use Joomla\CMS\Event\Extension\AfterUninstallEvent; use Joomla\CMS\Event\Extension\AfterUpdateEvent; use Joomla\CMS\Plugin\CMSPlugin; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects @@ -38,7 +37,6 @@ final class NamespaceMap extends CMSPlugin implements SubscriberInterface /** * Constructor * - * @param DispatcherInterface $subject The object to observe * @param \JNamespacePsr4Map $map The namespace map creator * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' @@ -46,11 +44,11 @@ final class NamespaceMap extends CMSPlugin implements SubscriberInterface * * @since 4.0.0 */ - public function __construct(DispatcherInterface $dispatcher, \JNamespacePsr4Map $map, array $config = []) + public function __construct(\JNamespacePsr4Map $map, array $config = []) { $this->fileCreator = $map; - parent::__construct($dispatcher, $config); + parent::__construct($config); } /** diff --git a/plugins/fields/calendar/services/provider.php b/plugins/fields/calendar/services/provider.php index 80018d57b9ec7..f105481348fa9 100644 --- a/plugins/fields/calendar/services/provider.php +++ b/plugins/fields/calendar/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Calendar\Extension\Calendar; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Calendar( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'calendar') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/checkboxes/services/provider.php b/plugins/fields/checkboxes/services/provider.php index e72fffcdf754c..a2a0d531fb1b1 100644 --- a/plugins/fields/checkboxes/services/provider.php +++ b/plugins/fields/checkboxes/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Checkboxes\Extension\Checkboxes; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Checkboxes( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'checkboxes') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/color/services/provider.php b/plugins/fields/color/services/provider.php index 2e0da96d8f1b8..fc57bbf5da905 100644 --- a/plugins/fields/color/services/provider.php +++ b/plugins/fields/color/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Color\Extension\Color; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Color( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'color') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/editor/services/provider.php b/plugins/fields/editor/services/provider.php index d584186f6256f..bdea266365567 100644 --- a/plugins/fields/editor/services/provider.php +++ b/plugins/fields/editor/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Editor\Extension\Editor; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Editor( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'editor') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/imagelist/services/provider.php b/plugins/fields/imagelist/services/provider.php index 0c45fe6ee797a..3d9161d36c39b 100644 --- a/plugins/fields/imagelist/services/provider.php +++ b/plugins/fields/imagelist/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Imagelist\Extension\Imagelist; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Imagelist( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'imagelist') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/integer/services/provider.php b/plugins/fields/integer/services/provider.php index c66e1fe298128..037b1d9b10391 100644 --- a/plugins/fields/integer/services/provider.php +++ b/plugins/fields/integer/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Integer\Extension\Integer; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Integer( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'integer') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/list/services/provider.php b/plugins/fields/list/services/provider.php index 08a0135136d5f..8742cb6419ca9 100644 --- a/plugins/fields/list/services/provider.php +++ b/plugins/fields/list/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\ListField\Extension\ListPlugin; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new ListPlugin( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'list') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/media/services/provider.php b/plugins/fields/media/services/provider.php index fe6432758d89a..2ac6bdb752fe4 100644 --- a/plugins/fields/media/services/provider.php +++ b/plugins/fields/media/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Media\Extension\Media; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Media( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'media') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/radio/services/provider.php b/plugins/fields/radio/services/provider.php index d7136857ac448..b5128b3835510 100644 --- a/plugins/fields/radio/services/provider.php +++ b/plugins/fields/radio/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Radio\Extension\Radio; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Radio( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'radio') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/sql/services/provider.php b/plugins/fields/sql/services/provider.php index cd12b047ee08d..afa643bd755de 100644 --- a/plugins/fields/sql/services/provider.php +++ b/plugins/fields/sql/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\SQL\Extension\SQL; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new SQL( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'sql') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/subform/services/provider.php b/plugins/fields/subform/services/provider.php index 29435a4ca7f43..672fd7bbfe6c9 100644 --- a/plugins/fields/subform/services/provider.php +++ b/plugins/fields/subform/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Subform\Extension\Subform; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Subform( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'subform') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/text/services/provider.php b/plugins/fields/text/services/provider.php index e1b2d6a341f08..913145a60bf79 100644 --- a/plugins/fields/text/services/provider.php +++ b/plugins/fields/text/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Text\Extension\Text; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Text( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'text') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/textarea/services/provider.php b/plugins/fields/textarea/services/provider.php index aba666dc1fbc1..546250ca1e4d8 100644 --- a/plugins/fields/textarea/services/provider.php +++ b/plugins/fields/textarea/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Textarea\Extension\Textarea; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Textarea( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'textarea') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/url/services/provider.php b/plugins/fields/url/services/provider.php index 8690edb5d05c9..48762014b9124 100644 --- a/plugins/fields/url/services/provider.php +++ b/plugins/fields/url/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\Url\Extension\Url; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Url( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'url') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/user/services/provider.php b/plugins/fields/user/services/provider.php index 786646c88f5f5..2bc2f919885de 100644 --- a/plugins/fields/user/services/provider.php +++ b/plugins/fields/user/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\User\UserFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\User\Extension\User; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new User( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'user') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/fields/usergrouplist/services/provider.php b/plugins/fields/usergrouplist/services/provider.php index e7e37bdfd29cf..779769eaf5554 100644 --- a/plugins/fields/usergrouplist/services/provider.php +++ b/plugins/fields/usergrouplist/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\UsergroupList\Extension\UsergroupList; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new UsergroupList( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('fields', 'usergrouplist') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/filesystem/local/services/provider.php b/plugins/filesystem/local/services/provider.php index 21fa89e1a2d35..cfbeb6fc6cb37 100644 --- a/plugins/filesystem/local/services/provider.php +++ b/plugins/filesystem/local/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Filesystem\Local\Extension\Local; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Local( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('filesystem', 'local'), JPATH_ROOT ); diff --git a/plugins/filesystem/local/src/Extension/Local.php b/plugins/filesystem/local/src/Extension/Local.php index 43496cea33312..1dfbd4da9d051 100644 --- a/plugins/filesystem/local/src/Extension/Local.php +++ b/plugins/filesystem/local/src/Extension/Local.php @@ -13,7 +13,6 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Component\Media\Administrator\Event\MediaProviderEvent; use Joomla\Component\Media\Administrator\Provider\ProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter; @@ -63,15 +62,14 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param string $rootDirectory The root directory to look for images * * @since 4.3.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, string $rootDirectory) + public function __construct(array $config, string $rootDirectory) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->rootDirectory = $rootDirectory; } diff --git a/plugins/finder/categories/services/provider.php b/plugins/finder/categories/services/provider.php index 1098415ee1ce0..ef2a6e05a4463 100644 --- a/plugins/finder/categories/services/provider.php +++ b/plugins/finder/categories/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Finder\Categories\Extension\Categories; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Categories( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('finder', 'categories') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/finder/contacts/services/provider.php b/plugins/finder/contacts/services/provider.php index 7331744e4f946..99d8e72a23a9f 100644 --- a/plugins/finder/contacts/services/provider.php +++ b/plugins/finder/contacts/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Finder\Contacts\Extension\Contacts; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Contacts( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('finder', 'contacts') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/finder/content/services/provider.php b/plugins/finder/content/services/provider.php index 5bff5b4ec2737..3b0511600990c 100644 --- a/plugins/finder/content/services/provider.php +++ b/plugins/finder/content/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Finder\Content\Extension\Content; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Content( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('finder', 'content') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/finder/newsfeeds/services/provider.php b/plugins/finder/newsfeeds/services/provider.php index 11ba71f25230d..bc968f74e5aa0 100644 --- a/plugins/finder/newsfeeds/services/provider.php +++ b/plugins/finder/newsfeeds/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Finder\Newsfeeds\Extension\Newsfeeds; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Newsfeeds( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('finder', 'newsfeeds') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/finder/tags/services/provider.php b/plugins/finder/tags/services/provider.php index 89448c9e0cfb0..d1910e2931d72 100644 --- a/plugins/finder/tags/services/provider.php +++ b/plugins/finder/tags/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Finder\Tags\Extension\Tags; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Tags( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('finder', 'tags') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/installer/folderinstaller/services/provider.php b/plugins/installer/folderinstaller/services/provider.php index 1941398bb2424..c86043ea9a4f3 100644 --- a/plugins/installer/folderinstaller/services/provider.php +++ b/plugins/installer/folderinstaller/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Installer\Folder\Extension\FolderInstaller; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new FolderInstaller( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('installer', 'folderinstaller') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/installer/override/services/provider.php b/plugins/installer/override/services/provider.php index 57d9818834d06..7b51b5fba7fd5 100644 --- a/plugins/installer/override/services/provider.php +++ b/plugins/installer/override/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Installer\Override\Extension\Override; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Override( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('installer', 'override') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/installer/packageinstaller/services/provider.php b/plugins/installer/packageinstaller/services/provider.php index 3f492e7f70009..1765d00be5255 100644 --- a/plugins/installer/packageinstaller/services/provider.php +++ b/plugins/installer/packageinstaller/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Installer\Package\Extension\PackageInstaller; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new PackageInstaller( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('installer', 'packageinstaller') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/installer/urlinstaller/services/provider.php b/plugins/installer/urlinstaller/services/provider.php index 483fd6ba0bf59..0eb54406d1507 100644 --- a/plugins/installer/urlinstaller/services/provider.php +++ b/plugins/installer/urlinstaller/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Installer\Url\Extension\UrlInstaller; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new UrlInstaller( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('installer', 'urlinstaller') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/installer/webinstaller/services/provider.php b/plugins/installer/webinstaller/services/provider.php index d7e5d9102c1f9..a8e2886996834 100644 --- a/plugins/installer/webinstaller/services/provider.php +++ b/plugins/installer/webinstaller/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Installer\Web\Extension\WebInstaller; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new WebInstaller( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('installer', 'webinstaller') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/media-action/crop/services/provider.php b/plugins/media-action/crop/services/provider.php index 8ce949af99d32..320edca8f04e2 100644 --- a/plugins/media-action/crop/services/provider.php +++ b/plugins/media-action/crop/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\MediaAction\Crop\Extension\Crop; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Crop( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('media-action', 'crop') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/media-action/resize/services/provider.php b/plugins/media-action/resize/services/provider.php index 4cb4e3c57f8a5..9b9ac84fb9273 100644 --- a/plugins/media-action/resize/services/provider.php +++ b/plugins/media-action/resize/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\MediaAction\Resize\Extension\Resize; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Resize( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('media-action', 'resize') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/media-action/rotate/services/provider.php b/plugins/media-action/rotate/services/provider.php index 545b2af63403b..a3d0f9b022cfc 100644 --- a/plugins/media-action/rotate/services/provider.php +++ b/plugins/media-action/rotate/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\MediaAction\Rotate\Extension\Rotate; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Rotate( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('media-action', 'rotate') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/multifactorauth/email/services/provider.php b/plugins/multifactorauth/email/services/provider.php index ff683aff571e0..d9ff5dc0b0e44 100644 --- a/plugins/multifactorauth/email/services/provider.php +++ b/plugins/multifactorauth/email/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\User\UserFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Multifactorauth\Email\Extension\Email; return new class () implements ServiceProviderInterface { @@ -34,7 +33,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = new Email($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('multifactorauth', 'email')); + $plugin = new Email((array) PluginHelper::getPlugin('multifactorauth', 'email')); $plugin->setApplication(Factory::getApplication()); $plugin->setUserFactory($container->get(UserFactoryInterface::class)); diff --git a/plugins/multifactorauth/fixed/services/provider.php b/plugins/multifactorauth/fixed/services/provider.php index dfff1eee57461..71922538f10e0 100644 --- a/plugins/multifactorauth/fixed/services/provider.php +++ b/plugins/multifactorauth/fixed/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Multifactorauth\Fixed\Extension\Fixed; return new class () implements ServiceProviderInterface { @@ -32,7 +31,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - return new Fixed($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('multifactorauth', 'fixed')); + return new Fixed((array) PluginHelper::getPlugin('multifactorauth', 'fixed')); } ); } diff --git a/plugins/multifactorauth/totp/services/provider.php b/plugins/multifactorauth/totp/services/provider.php index 9a6b7b0ab810c..bda0724c0b4bb 100644 --- a/plugins/multifactorauth/totp/services/provider.php +++ b/plugins/multifactorauth/totp/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\User\UserFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Multifactorauth\Totp\Extension\Totp; return new class () implements ServiceProviderInterface { @@ -34,7 +33,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = new Totp($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('multifactorauth', 'totp')); + $plugin = new Totp((array) PluginHelper::getPlugin('multifactorauth', 'totp')); $plugin->setApplication(Factory::getApplication()); $plugin->setUserFactory($container->get(UserFactoryInterface::class)); diff --git a/plugins/multifactorauth/webauthn/services/provider.php b/plugins/multifactorauth/webauthn/services/provider.php index 8d7046be7168b..eaf13c16c8230 100644 --- a/plugins/multifactorauth/webauthn/services/provider.php +++ b/plugins/multifactorauth/webauthn/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\User\UserFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Multifactorauth\Webauthn\Extension\Webauthn; return new class () implements ServiceProviderInterface { @@ -34,7 +33,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = new Webauthn($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('multifactorauth', 'webauthn')); + $plugin = new Webauthn((array) PluginHelper::getPlugin('multifactorauth', 'webauthn')); $plugin->setApplication(Factory::getApplication()); $plugin->setUserFactory($container->get(UserFactoryInterface::class)); diff --git a/plugins/multifactorauth/yubikey/services/provider.php b/plugins/multifactorauth/yubikey/services/provider.php index cb3a9a1062128..ea824c6f2b296 100644 --- a/plugins/multifactorauth/yubikey/services/provider.php +++ b/plugins/multifactorauth/yubikey/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Multifactorauth\Yubikey\Extension\Yubikey; return new class () implements ServiceProviderInterface { @@ -33,7 +32,7 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - $plugin = new Yubikey($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('multifactorauth', 'yubikey')); + $plugin = new Yubikey((array) PluginHelper::getPlugin('multifactorauth', 'yubikey')); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/privacy/actionlogs/services/provider.php b/plugins/privacy/actionlogs/services/provider.php index 1dbad56beab0b..3702b288b9147 100644 --- a/plugins/privacy/actionlogs/services/provider.php +++ b/plugins/privacy/actionlogs/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\Actionlogs\Extension\Actionlogs; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Actionlogs( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'actionlogs') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/privacy/consents/services/provider.php b/plugins/privacy/consents/services/provider.php index abef011b6170e..07aef738d61ef 100644 --- a/plugins/privacy/consents/services/provider.php +++ b/plugins/privacy/consents/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\Consents\Extension\Consents; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Consents( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'consents') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/privacy/contact/services/provider.php b/plugins/privacy/contact/services/provider.php index 498047ade2f37..8f243981ecc47 100644 --- a/plugins/privacy/contact/services/provider.php +++ b/plugins/privacy/contact/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\Contact\Extension\Contact; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Contact( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'contact') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/privacy/content/services/provider.php b/plugins/privacy/content/services/provider.php index b6778c6c1c608..53bf509ea22de 100644 --- a/plugins/privacy/content/services/provider.php +++ b/plugins/privacy/content/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\Content\Extension\Content; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Content( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'content') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/privacy/message/services/provider.php b/plugins/privacy/message/services/provider.php index bd11c78482439..175785f6902cf 100644 --- a/plugins/privacy/message/services/provider.php +++ b/plugins/privacy/message/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\Message\Extension\Message; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Message( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'message') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/privacy/user/services/provider.php b/plugins/privacy/user/services/provider.php index 8f35cfe21a4c8..edfb88323f6f0 100644 --- a/plugins/privacy/user/services/provider.php +++ b/plugins/privacy/user/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Privacy\User\Extension\UserPlugin; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new UserPlugin( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('privacy', 'user') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/autoupdate/services/provider.php b/plugins/quickicon/autoupdate/services/provider.php index 5904fd5c1116a..1b4a9224a682f 100644 --- a/plugins/quickicon/autoupdate/services/provider.php +++ b/plugins/quickicon/autoupdate/services/provider.php @@ -12,9 +12,9 @@ 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\Quickicon\Autoupdate\Extension\Autoupdate; return new class () implements ServiceProviderInterface { @@ -32,13 +32,9 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - // @Todo This needs to be changed to a proper factory - $plugin = \Joomla\CMS\Plugin\PluginHelper::getPlugin('quickicon', 'autoupdate'); - $plugin = new Autoupdate( - $container->get(DispatcherInterface::class), Factory::getApplication()->getDocument(), - (array) $plugin + (array) PluginHelper::getPlugin('quickicon', 'autoupdate') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/autoupdate/src/Extension/Autoupdate.php b/plugins/quickicon/autoupdate/src/Extension/Autoupdate.php index 3b55eecc49a19..989ae5360ed0d 100644 --- a/plugins/quickicon/autoupdate/src/Extension/Autoupdate.php +++ b/plugins/quickicon/autoupdate/src/Extension/Autoupdate.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Module\Quickicon\Administrator\Event\QuickIconsEvent; @@ -64,7 +63,6 @@ public static function getSubscribedEvents(): array /** * Constructor * - * @param DispatcherInterface $dispatcher The object to observe * @param Document $document The document * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' @@ -72,9 +70,9 @@ public static function getSubscribedEvents(): array * * @since 5.4.0 */ - public function __construct($dispatcher, Document $document, array $config = []) + public function __construct(Document $document, array $config = []) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->document = $document; } diff --git a/plugins/quickicon/downloadkey/services/provider.php b/plugins/quickicon/downloadkey/services/provider.php index f6ebf73d7fc8c..6ec77f993c5cf 100644 --- a/plugins/quickicon/downloadkey/services/provider.php +++ b/plugins/quickicon/downloadkey/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\Downloadkey\Extension\Downloadkey; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Downloadkey( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'downloadkey') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/eos/services/provider.php b/plugins/quickicon/eos/services/provider.php index 10f7afc54b321..f84aeac72e3fd 100644 --- a/plugins/quickicon/eos/services/provider.php +++ b/plugins/quickicon/eos/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\Eos\Extension\Eos; return new class () implements ServiceProviderInterface { @@ -37,7 +36,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Eos( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'eos') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/extensionupdate/services/provider.php b/plugins/quickicon/extensionupdate/services/provider.php index 4cf6b9ecad01c..536d972d0a98d 100644 --- a/plugins/quickicon/extensionupdate/services/provider.php +++ b/plugins/quickicon/extensionupdate/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\Extensionupdate\Extension\Extensionupdate; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Extensionupdate( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'extensionupdate') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/joomlaupdate/services/provider.php b/plugins/quickicon/joomlaupdate/services/provider.php index 8a9fd14d5f53a..2cb1f8b1f5f0d 100644 --- a/plugins/quickicon/joomlaupdate/services/provider.php +++ b/plugins/quickicon/joomlaupdate/services/provider.php @@ -12,9 +12,9 @@ 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\Quickicon\Joomlaupdate\Extension\Joomlaupdate; return new class () implements ServiceProviderInterface { @@ -32,13 +32,9 @@ public function register(Container $container) $container->set( PluginInterface::class, function (Container $container) { - // @Todo This needs to be changed to a proper factory - $plugin = \Joomla\CMS\Plugin\PluginHelper::getPlugin('quickicon', 'joomlaupdate'); - $plugin = new Joomlaupdate( - $container->get(DispatcherInterface::class), Factory::getApplication()->getDocument(), - (array) $plugin + (array) PluginHelper::getPlugin('quickicon', 'joomlaupdate') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/joomlaupdate/src/Extension/Joomlaupdate.php b/plugins/quickicon/joomlaupdate/src/Extension/Joomlaupdate.php index b9ad120d24e6a..0851850a7c06d 100644 --- a/plugins/quickicon/joomlaupdate/src/Extension/Joomlaupdate.php +++ b/plugins/quickicon/joomlaupdate/src/Extension/Joomlaupdate.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Module\Quickicon\Administrator\Event\QuickIconsEvent; @@ -64,7 +63,6 @@ public static function getSubscribedEvents(): array /** * Constructor * - * @param DispatcherInterface $dispatcher The object to observe * @param Document $document The document * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' @@ -72,9 +70,9 @@ public static function getSubscribedEvents(): array * * @since 4.0.0 */ - public function __construct($dispatcher, Document $document, array $config = []) + public function __construct(Document $document, array $config = []) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->document = $document; } diff --git a/plugins/quickicon/overridecheck/services/provider.php b/plugins/quickicon/overridecheck/services/provider.php index 85412acdd8f73..db1cde666918b 100644 --- a/plugins/quickicon/overridecheck/services/provider.php +++ b/plugins/quickicon/overridecheck/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\OverrideCheck\Extension\OverrideCheck; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new OverrideCheck( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'overridecheck') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/phpversioncheck/services/provider.php b/plugins/quickicon/phpversioncheck/services/provider.php index e5970df3434ab..c9cbc42035c3b 100644 --- a/plugins/quickicon/phpversioncheck/services/provider.php +++ b/plugins/quickicon/phpversioncheck/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\PhpVersionCheck\Extension\PhpVersionCheck; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new PhpVersionCheck( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'phpversioncheck') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/quickicon/privacycheck/services/provider.php b/plugins/quickicon/privacycheck/services/provider.php index 29b2c56178110..f16617ba900d6 100644 --- a/plugins/quickicon/privacycheck/services/provider.php +++ b/plugins/quickicon/privacycheck/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Quickicon\PrivacyCheck\Extension\PrivacyCheck; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new PrivacyCheck( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('quickicon', 'privacycheck') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/sampledata/blog/services/provider.php b/plugins/sampledata/blog/services/provider.php index 877dfd09f62d9..30997e372a533 100644 --- a/plugins/sampledata/blog/services/provider.php +++ b/plugins/sampledata/blog/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\SampleData\Blog\Extension\Blog; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Blog( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('sampledata', 'blog') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/sampledata/multilang/services/provider.php b/plugins/sampledata/multilang/services/provider.php index 2972f07592824..05b03e6acba28 100644 --- a/plugins/sampledata/multilang/services/provider.php +++ b/plugins/sampledata/multilang/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\SampleData\MultiLanguage\Extension\MultiLanguage; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new MultiLanguage( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('sampledata', 'multilang') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/sampledata/testing/services/provider.php b/plugins/sampledata/testing/services/provider.php index a37dc62f2c45b..285c8d865acdf 100644 --- a/plugins/sampledata/testing/services/provider.php +++ b/plugins/sampledata/testing/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\SampleData\Testing\Extension\Testing; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Testing( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('sampledata', 'testing') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/schemaorg/article/services/provider.php b/plugins/schemaorg/article/services/provider.php index e5ffab99673bd..35fc6aee06ef8 100644 --- a/plugins/schemaorg/article/services/provider.php +++ b/plugins/schemaorg/article/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Article\Extension\Article; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Article( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'article') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/schemaorg/blogposting/services/provider.php b/plugins/schemaorg/blogposting/services/provider.php index a19c667a0a295..0db56a9bda580 100644 --- a/plugins/schemaorg/blogposting/services/provider.php +++ b/plugins/schemaorg/blogposting/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\BlogPosting\Extension\BlogPosting; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new BlogPosting( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'blogposting') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/schemaorg/book/services/provider.php b/plugins/schemaorg/book/services/provider.php index e581060d641f8..74932f1c1bbc3 100644 --- a/plugins/schemaorg/book/services/provider.php +++ b/plugins/schemaorg/book/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Book\Extension\Book; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Book( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'book') ); diff --git a/plugins/schemaorg/custom/services/provider.php b/plugins/schemaorg/custom/services/provider.php index 801881acf11b3..c7ca2a863767c 100644 --- a/plugins/schemaorg/custom/services/provider.php +++ b/plugins/schemaorg/custom/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Custom\Extension\Custom; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Custom( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'custom') ); diff --git a/plugins/schemaorg/event/services/provider.php b/plugins/schemaorg/event/services/provider.php index 7ca8ecfacae94..43bffec09faa1 100644 --- a/plugins/schemaorg/event/services/provider.php +++ b/plugins/schemaorg/event/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Event\Extension\Event; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Event( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'event') ); diff --git a/plugins/schemaorg/jobposting/services/provider.php b/plugins/schemaorg/jobposting/services/provider.php index ce2190f6bab76..5a84557111a8c 100644 --- a/plugins/schemaorg/jobposting/services/provider.php +++ b/plugins/schemaorg/jobposting/services/provider.php @@ -15,7 +15,6 @@ 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 { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new JobPosting( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'jobposting') ); diff --git a/plugins/schemaorg/organization/services/provider.php b/plugins/schemaorg/organization/services/provider.php index cc31ceeb03952..d52add10cea07 100644 --- a/plugins/schemaorg/organization/services/provider.php +++ b/plugins/schemaorg/organization/services/provider.php @@ -15,7 +15,6 @@ 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 { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Organization( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'organization') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/schemaorg/person/services/provider.php b/plugins/schemaorg/person/services/provider.php index 523f654700f52..1c71c03892e4f 100644 --- a/plugins/schemaorg/person/services/provider.php +++ b/plugins/schemaorg/person/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Person\Extension\Person; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Person( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'person') ); diff --git a/plugins/schemaorg/recipe/services/provider.php b/plugins/schemaorg/recipe/services/provider.php index 2b6e0262876df..2b53d63612348 100644 --- a/plugins/schemaorg/recipe/services/provider.php +++ b/plugins/schemaorg/recipe/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Schemaorg\Recipe\Extension\Recipe; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Recipe( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('schemaorg', 'recipe') ); diff --git a/plugins/system/accessibility/services/provider.php b/plugins/system/accessibility/services/provider.php index 5c93e84091827..345efbc664074 100644 --- a/plugins/system/accessibility/services/provider.php +++ b/plugins/system/accessibility/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Accessibility\Extension\Accessibility; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Accessibility( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'accessibility') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/actionlogs/services/provider.php b/plugins/system/actionlogs/services/provider.php index 74933490bcfc4..811539b552016 100644 --- a/plugins/system/actionlogs/services/provider.php +++ b/plugins/system/actionlogs/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\ActionLogs\Extension\ActionLogs; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new ActionLogs( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'actionlogs') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/cache/services/provider.php b/plugins/system/cache/services/provider.php index bd2b5377520ab..4d7527d09bd58 100644 --- a/plugins/system/cache/services/provider.php +++ b/plugins/system/cache/services/provider.php @@ -42,7 +42,8 @@ function (Container $container) { $profiler = (\defined('JDEBUG') && JDEBUG) ? Profiler::getInstance('Application') : null; $router = $container->has(SiteRouter::class) ? $container->get(SiteRouter::class) : null; - $plugin = new Cache($dispatcher, (array) $plugin, $documentFactory, $cacheControllerFactory, $profiler, $router); + $plugin = new Cache((array) $plugin, $documentFactory, $cacheControllerFactory, $profiler, $router); + $plugin->setDispatcher($dispatcher); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/system/cache/src/Extension/Cache.php b/plugins/system/cache/src/Extension/Cache.php index 6e9d04c7e812e..1f3bd1f39b487 100644 --- a/plugins/system/cache/src/Extension/Cache.php +++ b/plugins/system/cache/src/Extension/Cache.php @@ -26,7 +26,6 @@ use Joomla\CMS\Uri\Uri; use Joomla\Event\DispatcherAwareInterface; use Joomla\Event\DispatcherAwareTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Priority; use Joomla\Event\SubscriberInterface; @@ -86,7 +85,6 @@ final class Cache extends CMSPlugin implements SubscriberInterface, DispatcherAw /** * Constructor * - * @param DispatcherInterface $dispatcher The object to observe * @param array $config An optional associative * array of configuration * settings. Recognized key @@ -104,14 +102,13 @@ final class Cache extends CMSPlugin implements SubscriberInterface, DispatcherAw * @since 4.2.0 */ public function __construct( - DispatcherInterface $dispatcher, array $config, DocumentFactoryInterface $documentFactory, CacheControllerFactoryInterface $cacheControllerFactory, ?Profiler $profiler, ?SiteRouter $router ) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->documentFactory = $documentFactory; $this->cacheControllerFactory = $cacheControllerFactory; diff --git a/plugins/system/debug/services/provider.php b/plugins/system/debug/services/provider.php index 540d9f98f52a9..1adb606bffba4 100644 --- a/plugins/system/debug/services/provider.php +++ b/plugins/system/debug/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Debug\Extension\Debug; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { return new Debug( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'debug'), Factory::getApplication(), $container->get(DatabaseInterface::class) diff --git a/plugins/system/debug/src/Extension/Debug.php b/plugins/system/debug/src/Extension/Debug.php index 924d957b70bd4..b15918d112ded 100644 --- a/plugins/system/debug/src/Extension/Debug.php +++ b/plugins/system/debug/src/Extension/Debug.php @@ -31,7 +31,6 @@ use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\DatabaseInterface; use Joomla\Database\Event\ConnectionEvent; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Priority; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\System\Debug\DataCollector\InfoCollector; @@ -162,16 +161,15 @@ public static function getSubscribedEvents(): array } /** - * @param DispatcherInterface $dispatcher The object to observe -- event dispatcher. * @param array $config An optional associative array of configuration settings. * @param CMSApplicationInterface $app The app * @param DatabaseInterface $db The db * * @since 1.5 */ - public function __construct(DispatcherInterface $dispatcher, array $config, CMSApplicationInterface $app, DatabaseInterface $db) + public function __construct(array $config, CMSApplicationInterface $app, DatabaseInterface $db) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->setApplication($app); $this->setDatabase($db); diff --git a/plugins/system/fields/services/provider.php b/plugins/system/fields/services/provider.php index 4d373ac287f6a..a11cfa03a9e41 100644 --- a/plugins/system/fields/services/provider.php +++ b/plugins/system/fields/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\User\UserFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Fields\Extension\Fields; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Fields( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'fields') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/guidedtours/services/provider.php b/plugins/system/guidedtours/services/provider.php index d372a3a0c2de9..a573b33eab419 100644 --- a/plugins/system/guidedtours/services/provider.php +++ b/plugins/system/guidedtours/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\GuidedTours\Extension\GuidedTours; return new class () implements ServiceProviderInterface { @@ -38,7 +37,6 @@ function (Container $container) { $app = Factory::getApplication(); $plugin = new GuidedTours( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'guidedtours'), $app->isClient('administrator') ); diff --git a/plugins/system/guidedtours/src/Extension/GuidedTours.php b/plugins/system/guidedtours/src/Extension/GuidedTours.php index 6598411423d2f..8f014fa71a5f5 100644 --- a/plugins/system/guidedtours/src/Extension/GuidedTours.php +++ b/plugins/system/guidedtours/src/Extension/GuidedTours.php @@ -21,7 +21,6 @@ use Joomla\Component\Guidedtours\Administrator\Model\TourModel; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\ParameterType; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Event; use Joomla\Event\SubscriberInterface; @@ -77,17 +76,16 @@ final class GuidedTours extends CMSPlugin implements SubscriberInterface /** * Constructor * - * @param DispatcherInterface $dispatcher The object to observe * @param array $config An optional associative array of configuration settings. * @param boolean $enabled An internal flag whether plugin should listen any event. * * @since 4.3.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config = [], bool $enabled = false) + public function __construct(array $config = [], bool $enabled = false) { self::$enabled = $enabled; - parent::__construct($dispatcher, $config); + parent::__construct($config); } /** diff --git a/plugins/system/highlight/services/provider.php b/plugins/system/highlight/services/provider.php index ac91d9227ee46..304468d28cf96 100644 --- a/plugins/system/highlight/services/provider.php +++ b/plugins/system/highlight/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Highlight\Extension\Highlight; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Highlight( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'highlight') ); diff --git a/plugins/system/httpheaders/services/provider.php b/plugins/system/httpheaders/services/provider.php index dd40240e00fc7..90e0147d3372b 100644 --- a/plugins/system/httpheaders/services/provider.php +++ b/plugins/system/httpheaders/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Httpheaders\Extension\Httpheaders; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Httpheaders( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'httpheaders'), Factory::getApplication() ); diff --git a/plugins/system/httpheaders/src/Extension/Httpheaders.php b/plugins/system/httpheaders/src/Extension/Httpheaders.php index 93d9c3d3ba7cf..76a26cf695173 100644 --- a/plugins/system/httpheaders/src/Extension/Httpheaders.php +++ b/plugins/system/httpheaders/src/Extension/Httpheaders.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Uri\Uri; use Joomla\Database\DatabaseAwareTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\Event; use Joomla\Event\SubscriberInterface; @@ -119,15 +118,14 @@ final class Httpheaders extends CMSPlugin implements SubscriberInterface ]; /** - * @param DispatcherInterface $dispatcher The object to observe -- event dispatcher. * @param array $config An optional associative array of configuration settings. * @param CMSApplicationInterface $app The app * * @since 4.0.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, CMSApplicationInterface $app) + public function __construct(array $config, CMSApplicationInterface $app) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->setApplication($app); diff --git a/plugins/system/jooa11y/services/provider.php b/plugins/system/jooa11y/services/provider.php index 4bf355dea9965..070e3eec33be2 100644 --- a/plugins/system/jooa11y/services/provider.php +++ b/plugins/system/jooa11y/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Jooa11y\Extension\Jooa11y; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Jooa11y( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'jooa11y') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/languagecode/services/provider.php b/plugins/system/languagecode/services/provider.php index a021326433d89..a4caedef63469 100644 --- a/plugins/system/languagecode/services/provider.php +++ b/plugins/system/languagecode/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\LanguageCode\Extension\LanguageCode; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new LanguageCode( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'languagecode') ); diff --git a/plugins/system/languagefilter/services/provider.php b/plugins/system/languagefilter/services/provider.php index c72423242b9da..3b1a3533e464c 100644 --- a/plugins/system/languagefilter/services/provider.php +++ b/plugins/system/languagefilter/services/provider.php @@ -17,7 +17,6 @@ use Joomla\CMS\Router\SiteRouter; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\LanguageFilter\Extension\LanguageFilter; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new LanguageFilter( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'languagefilter'), Factory::getApplication(), $container->get(LanguageFactoryInterface::class) diff --git a/plugins/system/languagefilter/src/Extension/LanguageFilter.php b/plugins/system/languagefilter/src/Extension/LanguageFilter.php index 477cfc1dc2a44..a12216362705c 100644 --- a/plugins/system/languagefilter/src/Extension/LanguageFilter.php +++ b/plugins/system/languagefilter/src/Extension/LanguageFilter.php @@ -33,7 +33,6 @@ use Joomla\CMS\Router\SiteRouterAwareTrait; use Joomla\CMS\Uri\Uri; use Joomla\Component\Menus\Administrator\Helper\MenusHelper; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\Path; use Joomla\Registry\Registry; @@ -112,7 +111,6 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param CMSApplicationInterface $app The language factory * @param LanguageFactoryInterface $languageFactory The language factory @@ -120,12 +118,11 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @since 1.6.0 */ public function __construct( - DispatcherInterface $dispatcher, array $config, CMSApplicationInterface $app, LanguageFactoryInterface $languageFactory ) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->languageFactory = $languageFactory; diff --git a/plugins/system/log/services/provider.php b/plugins/system/log/services/provider.php index 669bd216596b4..37ee33b02ce74 100644 --- a/plugins/system/log/services/provider.php +++ b/plugins/system/log/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Log\Extension\Log; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Log( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'log') ); diff --git a/plugins/system/logout/services/provider.php b/plugins/system/logout/services/provider.php index d4b52cba55f4a..6825a09cdab59 100644 --- a/plugins/system/logout/services/provider.php +++ b/plugins/system/logout/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Logout\Extension\Logout; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { return new Logout( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'logout'), Factory::getApplication() ); diff --git a/plugins/system/logout/src/Extension/Logout.php b/plugins/system/logout/src/Extension/Logout.php index 48ee2b2c7ed0d..d07e129ffa495 100644 --- a/plugins/system/logout/src/Extension/Logout.php +++ b/plugins/system/logout/src/Extension/Logout.php @@ -14,7 +14,6 @@ use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Event\User\LogoutEvent; use Joomla\CMS\Plugin\CMSPlugin; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects @@ -29,15 +28,14 @@ final class Logout extends CMSPlugin implements SubscriberInterface { /** - * @param DispatcherInterface $dispatcher The object to observe -- event dispatcher. * @param array $config An optional associative array of configuration settings. * @param CMSApplicationInterface $app The object to observe -- event dispatcher. * * @since 1.6 */ - public function __construct(DispatcherInterface $dispatcher, array $config, CMSApplicationInterface $app) + public function __construct(array $config, CMSApplicationInterface $app) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->setApplication($app); diff --git a/plugins/system/privacyconsent/services/provider.php b/plugins/system/privacyconsent/services/provider.php index b2c1a95359598..46f589a691224 100644 --- a/plugins/system/privacyconsent/services/provider.php +++ b/plugins/system/privacyconsent/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\PrivacyConsent\Extension\PrivacyConsent; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new PrivacyConsent( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'privacyconsent') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/redirect/services/provider.php b/plugins/system/redirect/services/provider.php index 27e073852c851..36179b4c7fbda 100644 --- a/plugins/system/redirect/services/provider.php +++ b/plugins/system/redirect/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Redirect\Extension\Redirect; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Redirect( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'redirect') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/remember/services/provider.php b/plugins/system/remember/services/provider.php index b1528763a22c6..acfa358859756 100644 --- a/plugins/system/remember/services/provider.php +++ b/plugins/system/remember/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Remember\Extension\Remember; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Remember( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'remember') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/schedulerunner/services/provider.php b/plugins/system/schedulerunner/services/provider.php index a8ff358f768e1..446cf366e4511 100644 --- a/plugins/system/schedulerunner/services/provider.php +++ b/plugins/system/schedulerunner/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\ScheduleRunner\Extension\ScheduleRunner; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new ScheduleRunner( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'schedulerunner') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/schemaorg/services/provider.php b/plugins/system/schemaorg/services/provider.php index 76dc49108eb10..06ce84cdbbd66 100644 --- a/plugins/system/schemaorg/services/provider.php +++ b/plugins/system/schemaorg/services/provider.php @@ -36,10 +36,9 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Schemaorg( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'schemaorg') ); - + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); $plugin->setDatabase($container->get(DatabaseInterface::class)); $plugin->setUserFactory($container->get(UserFactoryInterface::class)); diff --git a/plugins/system/sef/services/provider.php b/plugins/system/sef/services/provider.php index 99ec7b707907d..bea5a6f20b7f7 100644 --- a/plugins/system/sef/services/provider.php +++ b/plugins/system/sef/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\Router\SiteRouter; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Sef\Extension\Sef; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Sef( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'sef') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/shortcut/services/provider.php b/plugins/system/shortcut/services/provider.php index d81da573e5f7c..2e8e5bc4b7307 100644 --- a/plugins/system/shortcut/services/provider.php +++ b/plugins/system/shortcut/services/provider.php @@ -34,9 +34,9 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Shortcut( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'shortcut') ); + $plugin->setDispatcher($container->get(DispatcherInterface::class)); $plugin->setApplication(Factory::getApplication()); return $plugin; diff --git a/plugins/system/skipto/services/provider.php b/plugins/system/skipto/services/provider.php index 84efa5e700f97..38650139861c9 100644 --- a/plugins/system/skipto/services/provider.php +++ b/plugins/system/skipto/services/provider.php @@ -14,7 +14,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Skipto\Extension\Skipto; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Skipto( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'skipto') ); diff --git a/plugins/system/stats/services/provider.php b/plugins/system/stats/services/provider.php index 7e2eb12803c4a..a5cadb036178f 100644 --- a/plugins/system/stats/services/provider.php +++ b/plugins/system/stats/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Stats\Extension\Stats; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Stats( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'stats') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/tasknotification/services/provider.php b/plugins/system/tasknotification/services/provider.php index c0cfbcd564d85..2f5d54b0f8fb3 100644 --- a/plugins/system/tasknotification/services/provider.php +++ b/plugins/system/tasknotification/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\TaskNotification\Extension\TaskNotification; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new TaskNotification( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'tasknotification') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/system/webauthn/services/provider.php b/plugins/system/webauthn/services/provider.php index c9517c55385b2..1b10b823a7f82 100644 --- a/plugins/system/webauthn/services/provider.php +++ b/plugins/system/webauthn/services/provider.php @@ -18,7 +18,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\System\Webauthn\Authentication; use Joomla\Plugin\System\Webauthn\CredentialRepository; use Joomla\Plugin\System\Webauthn\Extension\Webauthn; @@ -64,7 +63,6 @@ function (Container $container) { : new Authentication($app, $session, $credentialsRepository, $metadataRepository); $plugin = new Webauthn( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('system', 'webauthn'), $authenticationHelper ); diff --git a/plugins/system/webauthn/src/Extension/Webauthn.php b/plugins/system/webauthn/src/Extension/Webauthn.php index 4f468bdaae40d..5ac91c372e34e 100644 --- a/plugins/system/webauthn/src/Extension/Webauthn.php +++ b/plugins/system/webauthn/src/Extension/Webauthn.php @@ -14,7 +14,6 @@ use Joomla\CMS\Factory; use Joomla\CMS\Log\Log; use Joomla\CMS\Plugin\CMSPlugin; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\System\Webauthn\Authentication; use Joomla\Plugin\System\Webauthn\PluginTraits\AdditionalLoginButtons; @@ -96,7 +95,6 @@ final class Webauthn extends CMSPlugin implements SubscriberInterface /** * Constructor. Loads the language files as well. * - * @param DispatcherInterface $dispatcher The object to observe * @param array $config An optional associative array of configuration * settings. Recognized key values include 'name', * 'group', 'params', 'language (this list is not meant @@ -105,9 +103,9 @@ final class Webauthn extends CMSPlugin implements SubscriberInterface * * @since 4.0.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config = [], ?Authentication $authHelper = null) + public function __construct(array $config = [], ?Authentication $authHelper = null) { - parent::__construct($dispatcher, $config); + parent::__construct($config); /** * Note: Do NOT try to load the language in the constructor. This is called before Joomla initializes the diff --git a/plugins/task/checkfiles/services/provider.php b/plugins/task/checkfiles/services/provider.php index 1afafe3051cb6..705884ddebd8e 100644 --- a/plugins/task/checkfiles/services/provider.php +++ b/plugins/task/checkfiles/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\Checkfiles\Extension\Checkfiles; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Checkfiles( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'checkfiles'), JPATH_ROOT . '/images/' ); diff --git a/plugins/task/checkfiles/src/Extension/Checkfiles.php b/plugins/task/checkfiles/src/Extension/Checkfiles.php index a85f4c73b183c..13f43245d51f9 100644 --- a/plugins/task/checkfiles/src/Extension/Checkfiles.php +++ b/plugins/task/checkfiles/src/Extension/Checkfiles.php @@ -15,7 +15,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status as TaskStatus; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\Folder; use Joomla\Filesystem\Path; @@ -80,15 +79,14 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param string $rootDirectory The root directory to look for images * * @since 4.2.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, string $rootDirectory) + public function __construct(array $config, string $rootDirectory) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->rootDirectory = $rootDirectory; } diff --git a/plugins/task/deleteactionlogs/services/provider.php b/plugins/task/deleteactionlogs/services/provider.php index 83e33b9e94439..9c720792dbd1d 100644 --- a/plugins/task/deleteactionlogs/services/provider.php +++ b/plugins/task/deleteactionlogs/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\DeleteActionLogs\Extension\DeleteActionLogs; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new DeleteActionLogs( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'deleteactionlogs') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/task/globalcheckin/services/provider.php b/plugins/task/globalcheckin/services/provider.php index f1985e013d2e2..31d557d1124a1 100644 --- a/plugins/task/globalcheckin/services/provider.php +++ b/plugins/task/globalcheckin/services/provider.php @@ -15,7 +15,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\Globalcheckin\Extension\Globalcheckin; return new class () implements ServiceProviderInterface { @@ -33,7 +32,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $checkin = new Globalcheckin( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'globalcheckin') ); $checkin->setDatabase($container->get(DatabaseInterface::class)); diff --git a/plugins/task/privacyconsent/services/provider.php b/plugins/task/privacyconsent/services/provider.php index 59520ef4f211d..e18155de47218 100644 --- a/plugins/task/privacyconsent/services/provider.php +++ b/plugins/task/privacyconsent/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\PrivacyConsent\Extension\PrivacyConsent; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new PrivacyConsent( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'privacyconsent') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/task/requests/services/provider.php b/plugins/task/requests/services/provider.php index 2d11ccb9e9142..d75b12af73c45 100644 --- a/plugins/task/requests/services/provider.php +++ b/plugins/task/requests/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Http\HttpFactory; use Joomla\Plugin\Task\Requests\Extension\Requests; @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new Requests( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'requests'), new HttpFactory(), JPATH_ROOT . '/tmp' diff --git a/plugins/task/requests/src/Extension/Requests.php b/plugins/task/requests/src/Extension/Requests.php index a8cd6820022a6..01509f63bc8fd 100644 --- a/plugins/task/requests/src/Extension/Requests.php +++ b/plugins/task/requests/src/Extension/Requests.php @@ -14,7 +14,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status as TaskStatus; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\File; use Joomla\Filesystem\Path; @@ -87,16 +86,15 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param HttpFactory $httpFactory The http factory * @param string $rootDirectory The root directory to store the output file in * * @since 4.2.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, HttpFactory $httpFactory, string $rootDirectory) + public function __construct(array $config, HttpFactory $httpFactory, string $rootDirectory) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->httpFactory = $httpFactory; $this->rootDirectory = $rootDirectory; diff --git a/plugins/task/rotatelogs/services/provider.php b/plugins/task/rotatelogs/services/provider.php index d55575b387a7d..a69fe6d34c557 100644 --- a/plugins/task/rotatelogs/services/provider.php +++ b/plugins/task/rotatelogs/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\RotateLogs\Extension\RotateLogs; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new RotateLogs( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'rotatelogs') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/task/sessiongc/services/provider.php b/plugins/task/sessiongc/services/provider.php index 36a22a926df38..fc2b244368342 100644 --- a/plugins/task/sessiongc/services/provider.php +++ b/plugins/task/sessiongc/services/provider.php @@ -16,7 +16,6 @@ use Joomla\CMS\Session\MetadataManager; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\SessionGC\Extension\SessionGC; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new SessionGC( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'sessiongc'), $container->get(MetadataManager::class) ); diff --git a/plugins/task/sessiongc/src/Extension/SessionGC.php b/plugins/task/sessiongc/src/Extension/SessionGC.php index 0440ef90864e7..61a8b6816b52b 100644 --- a/plugins/task/sessiongc/src/Extension/SessionGC.php +++ b/plugins/task/sessiongc/src/Extension/SessionGC.php @@ -15,7 +15,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects @@ -62,15 +61,14 @@ final class SessionGC extends CMSPlugin implements SubscriberInterface /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param MetadataManager $metadataManager The user factory * * @since 4.4.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, MetadataManager $metadataManager) + public function __construct(array $config, MetadataManager $metadataManager) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->metadataManager = $metadataManager; } diff --git a/plugins/task/sitestatus/services/provider.php b/plugins/task/sitestatus/services/provider.php index ac478bf487ace..34ef4b92c11a1 100644 --- a/plugins/task/sitestatus/services/provider.php +++ b/plugins/task/sitestatus/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\SiteStatus\Extension\SiteStatus; use Joomla\Utilities\ArrayHelper; @@ -35,7 +34,6 @@ public function register(Container $container) PluginInterface::class, function (Container $container) { $plugin = new SiteStatus( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'sitestatus'), ArrayHelper::fromObject(new JConfig()), JPATH_CONFIGURATION . '/configuration.php' diff --git a/plugins/task/sitestatus/src/Extension/SiteStatus.php b/plugins/task/sitestatus/src/Extension/SiteStatus.php index 6bf6064da0806..43187ac8528a4 100644 --- a/plugins/task/sitestatus/src/Extension/SiteStatus.php +++ b/plugins/task/sitestatus/src/Extension/SiteStatus.php @@ -14,7 +14,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\File; use Joomla\Filesystem\Path; @@ -98,16 +97,15 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param array $oldConfig The old config * @param string $configFile The config * * @since 4.2.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, array $oldConfig, string $configFile) + public function __construct(array $config, array $oldConfig, string $configFile) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->oldConfig = $oldConfig; $this->configFile = $configFile; diff --git a/plugins/task/updatenotification/services/provider.php b/plugins/task/updatenotification/services/provider.php index 376ce1ce9dddf..3898556ffe4be 100644 --- a/plugins/task/updatenotification/services/provider.php +++ b/plugins/task/updatenotification/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\UpdateNotification\Extension\UpdateNotification; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new UpdateNotification( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'updatenotification') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/user/contactcreator/services/provider.php b/plugins/user/contactcreator/services/provider.php index f7bdde68af52f..e2096d743b139 100644 --- a/plugins/user/contactcreator/services/provider.php +++ b/plugins/user/contactcreator/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\User\ContactCreator\Extension\ContactCreator; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new ContactCreator( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('user', 'contactcreator') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/user/joomla/services/provider.php b/plugins/user/joomla/services/provider.php index b78611c23ebe0..77df09c207b08 100644 --- a/plugins/user/joomla/services/provider.php +++ b/plugins/user/joomla/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\User\Joomla\Extension\Joomla; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Joomla( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('user', 'joomla') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/user/profile/services/provider.php b/plugins/user/profile/services/provider.php index ba7439d66e156..37f1aba8043a8 100644 --- a/plugins/user/profile/services/provider.php +++ b/plugins/user/profile/services/provider.php @@ -16,7 +16,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\User\Profile\Extension\Profile; return new class () implements ServiceProviderInterface { @@ -35,7 +34,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Profile( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('user', 'profile') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/user/terms/services/provider.php b/plugins/user/terms/services/provider.php index 3f2570da357a0..4418a9b38ab27 100644 --- a/plugins/user/terms/services/provider.php +++ b/plugins/user/terms/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\User\Terms\Extension\Terms; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Terms( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('user', 'terms') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/user/token/services/provider.php b/plugins/user/token/services/provider.php index 6c520737c8d03..f186eb0897fc4 100644 --- a/plugins/user/token/services/provider.php +++ b/plugins/user/token/services/provider.php @@ -17,7 +17,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\User\Token\Extension\Token; return new class () implements ServiceProviderInterface { @@ -36,7 +35,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Token( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('user', 'token') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/banners/services/provider.php b/plugins/webservices/banners/services/provider.php index 105a7f634636e..1f1bfc3c5994e 100644 --- a/plugins/webservices/banners/services/provider.php +++ b/plugins/webservices/banners/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Banners\Extension\Banners; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Banners( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'banners') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/config/services/provider.php b/plugins/webservices/config/services/provider.php index 51546c4846991..22576a29bd22d 100644 --- a/plugins/webservices/config/services/provider.php +++ b/plugins/webservices/config/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Config\Extension\Config; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Config( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'config') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/contact/services/provider.php b/plugins/webservices/contact/services/provider.php index 387e2dd44ad49..eb47facf55ca3 100644 --- a/plugins/webservices/contact/services/provider.php +++ b/plugins/webservices/contact/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Contact\Extension\Contact; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Contact( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'contact') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/content/services/provider.php b/plugins/webservices/content/services/provider.php index 88adc5ff3c9f2..258c06a85880d 100644 --- a/plugins/webservices/content/services/provider.php +++ b/plugins/webservices/content/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Content\Extension\Content; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Content( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'content') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/installer/services/provider.php b/plugins/webservices/installer/services/provider.php index 0f25b85a9d701..b1479f3def5ea 100644 --- a/plugins/webservices/installer/services/provider.php +++ b/plugins/webservices/installer/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Installer\Extension\Installer; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Installer( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'installer') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/joomlaupdate/services/provider.php b/plugins/webservices/joomlaupdate/services/provider.php index be000c607608f..60bd5123c3fcd 100644 --- a/plugins/webservices/joomlaupdate/services/provider.php +++ b/plugins/webservices/joomlaupdate/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Joomlaupdate\Extension\Joomlaupdate; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Joomlaupdate( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'joomlaupdate') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/languages/services/provider.php b/plugins/webservices/languages/services/provider.php index e44589215c155..129c5164c0ba6 100644 --- a/plugins/webservices/languages/services/provider.php +++ b/plugins/webservices/languages/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Languages\Extension\Languages; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Languages( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'languages') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/media/services/provider.php b/plugins/webservices/media/services/provider.php index 93bf2800a84aa..34b61c6e668d5 100644 --- a/plugins/webservices/media/services/provider.php +++ b/plugins/webservices/media/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Media\Extension\Media; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Media( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'media') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/menus/services/provider.php b/plugins/webservices/menus/services/provider.php index a9d079e7b0dc5..39bc043351f4c 100644 --- a/plugins/webservices/menus/services/provider.php +++ b/plugins/webservices/menus/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Menus\Extension\Menus; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Menus( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'menus') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/messages/services/provider.php b/plugins/webservices/messages/services/provider.php index 5e72c1095b008..c94e11df4df31 100644 --- a/plugins/webservices/messages/services/provider.php +++ b/plugins/webservices/messages/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Messages\Extension\Messages; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Messages( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'messages') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/modules/services/provider.php b/plugins/webservices/modules/services/provider.php index 96de439c504d8..3b08a5aa00f8c 100644 --- a/plugins/webservices/modules/services/provider.php +++ b/plugins/webservices/modules/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Modules\Extension\Modules; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Modules( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'modules') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/newsfeeds/services/provider.php b/plugins/webservices/newsfeeds/services/provider.php index 3f9445f9c5e3a..a98d357d21cfa 100644 --- a/plugins/webservices/newsfeeds/services/provider.php +++ b/plugins/webservices/newsfeeds/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Newsfeeds\Extension\Newsfeeds; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Newsfeeds( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'newsfeeds') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/plugins/services/provider.php b/plugins/webservices/plugins/services/provider.php index 48a4a2ecc8ddb..5d9b283f2ba5d 100644 --- a/plugins/webservices/plugins/services/provider.php +++ b/plugins/webservices/plugins/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Plugins\Extension\Plugins; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Plugins( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'plugins') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/privacy/services/provider.php b/plugins/webservices/privacy/services/provider.php index 9577bedafa89b..cf9630e79f959 100644 --- a/plugins/webservices/privacy/services/provider.php +++ b/plugins/webservices/privacy/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Privacy\Extension\Privacy; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Privacy( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'privacy') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/redirect/services/provider.php b/plugins/webservices/redirect/services/provider.php index efd5d4a1d2b01..d1140afd21a59 100644 --- a/plugins/webservices/redirect/services/provider.php +++ b/plugins/webservices/redirect/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Redirect\Extension\Redirect; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Redirect( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'redirect') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/tags/services/provider.php b/plugins/webservices/tags/services/provider.php index e126db661907e..a110593807fbe 100644 --- a/plugins/webservices/tags/services/provider.php +++ b/plugins/webservices/tags/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Tags\Extension\Tags; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Tags( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'tags') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/templates/services/provider.php b/plugins/webservices/templates/services/provider.php index 1f1f9b32ef218..b01eec6d98d2d 100644 --- a/plugins/webservices/templates/services/provider.php +++ b/plugins/webservices/templates/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Templates\Extension\Templates; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Templates( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'templates') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/webservices/users/services/provider.php b/plugins/webservices/users/services/provider.php index 9a94684d9a41c..414b18450ec18 100644 --- a/plugins/webservices/users/services/provider.php +++ b/plugins/webservices/users/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\WebServices\Users\Extension\Users; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Users( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'users') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/workflow/featuring/services/provider.php b/plugins/workflow/featuring/services/provider.php index c5b3ef4ef9167..69b1208720d24 100644 --- a/plugins/workflow/featuring/services/provider.php +++ b/plugins/workflow/featuring/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Workflow\Featuring\Extension\Featuring; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Featuring( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('workflow', 'featuring') ); $plugin->setApplication(Factory::getApplication()); diff --git a/plugins/workflow/notification/services/provider.php b/plugins/workflow/notification/services/provider.php index 172091cf85f62..ed4e9f34eb14a 100644 --- a/plugins/workflow/notification/services/provider.php +++ b/plugins/workflow/notification/services/provider.php @@ -18,7 +18,6 @@ use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Workflow\Notification\Extension\Notification; return new class () implements ServiceProviderInterface { @@ -37,7 +36,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Notification( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('workflow', 'notification'), $container->get(LanguageFactoryInterface::class) ); diff --git a/plugins/workflow/notification/src/Extension/Notification.php b/plugins/workflow/notification/src/Extension/Notification.php index ff8d83a053fe7..ca9c1facc8225 100644 --- a/plugins/workflow/notification/src/Extension/Notification.php +++ b/plugins/workflow/notification/src/Extension/Notification.php @@ -19,7 +19,6 @@ use Joomla\CMS\Workflow\WorkflowPluginTrait; use Joomla\CMS\Workflow\WorkflowServiceInterface; use Joomla\Database\DatabaseAwareTrait; -use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Utilities\ArrayHelper; @@ -73,15 +72,14 @@ public static function getSubscribedEvents(): array /** * Constructor. * - * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param LanguageFactoryInterface $languageFactory The language factory * * @since 4.2.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config, LanguageFactoryInterface $languageFactory) + public function __construct(array $config, LanguageFactoryInterface $languageFactory) { - parent::__construct($dispatcher, $config); + parent::__construct($config); $this->languageFactory = $languageFactory; } diff --git a/plugins/workflow/publishing/services/provider.php b/plugins/workflow/publishing/services/provider.php index 0f861d5950d93..02267c5f7c608 100644 --- a/plugins/workflow/publishing/services/provider.php +++ b/plugins/workflow/publishing/services/provider.php @@ -15,7 +15,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Workflow\Publishing\Extension\Publishing; return new class () implements ServiceProviderInterface { @@ -34,7 +33,6 @@ public function register(Container $container): void PluginInterface::class, function (Container $container) { $plugin = new Publishing( - $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('workflow', 'publishing') ); $plugin->setApplication(Factory::getApplication()); diff --git a/tests/Integration/Plugin/Authentication/Ldap/LdapPluginTest.php b/tests/Integration/Plugin/Authentication/Ldap/LdapPluginTest.php index a32ac2babf715..dd391df4dd789 100644 --- a/tests/Integration/Plugin/Authentication/Ldap/LdapPluginTest.php +++ b/tests/Integration/Plugin/Authentication/Ldap/LdapPluginTest.php @@ -15,7 +15,6 @@ use Joomla\CMS\Authentication\AuthenticationResponse; use Joomla\CMS\Event\User\AuthenticationEvent; use Joomla\CMS\Language\Language; -use Joomla\Event\Dispatcher; use Joomla\Plugin\Authentication\Ldap\Extension\Ldap as LdapPlugin; use Joomla\Plugin\Authentication\Ldap\Factory\LdapFactory; use Joomla\Tests\Integration\IntegrationTestCase; @@ -72,7 +71,7 @@ private function getPlugin($options): LdapPlugin 'type' => 'authentication', ]; - $plugin = new LdapPlugin(new LdapFactory(), new Dispatcher(), $pluginObject); + $plugin = new LdapPlugin(new LdapFactory(), $pluginObject); $plugin->setApplication($app); return $plugin; diff --git a/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php b/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php index 14cc1a844a86c..35a60b75ea513 100644 --- a/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php +++ b/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php @@ -15,7 +15,6 @@ use Joomla\CMS\Authentication\AuthenticationResponse; use Joomla\CMS\Event\User\AuthenticationEvent; use Joomla\CMS\Language\Language; -use Joomla\Event\Dispatcher; use Joomla\Plugin\Authentication\Ldap\Extension\Ldap; use Joomla\Plugin\Authentication\Ldap\Factory\LdapFactoryInterface; use Joomla\Tests\Unit\UnitTestCase; @@ -47,7 +46,7 @@ class LdapPluginTest extends UnitTestCase */ public function testNoHost() { - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => []]); + $plugin = new Ldap($this->createFactory(), ['params' => []]); $plugin->setApplication($this->createStub(CMSApplicationInterface::class)); $response = new AuthenticationResponse(); @@ -72,7 +71,7 @@ public function testNoCredentials() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => ['host' => 'test']]); + $plugin = new Ldap($this->createFactory(), ['params' => ['host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -97,7 +96,7 @@ public function testNoAuthenticationMethod() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => ['host' => 'test']]); + $plugin = new Ldap($this->createFactory(), ['params' => ['host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -117,7 +116,7 @@ public function testNoAuthenticationMethod() */ public function testSearchAuthenticationMethod() { - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => ['auth_method' => 'search', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(), ['params' => ['auth_method' => 'search', 'host' => 'test']]); $response = new AuthenticationResponse(); $credentials = ['username' => 'unit', 'password' => 'test']; @@ -142,7 +141,7 @@ public function testSearchAuthenticationMethodNoEntry() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(false, false, false), new Dispatcher(), ['params' => ['auth_method' => 'search', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(false, false, false), ['params' => ['auth_method' => 'search', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -168,7 +167,7 @@ public function testSearchAuthenticationMethodWithBindException() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(true, false), new Dispatcher(), ['params' => ['auth_method' => 'search', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(true, false), ['params' => ['auth_method' => 'search', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -194,7 +193,7 @@ public function testSearchAuthenticationMethodWithQueryException() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(false, true), new Dispatcher(), ['params' => ['auth_method' => 'search', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(false, true), ['params' => ['auth_method' => 'search', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -214,7 +213,7 @@ public function testSearchAuthenticationMethodWithQueryException() */ public function testBindAuthenticationMethod() { - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); $response = new AuthenticationResponse(); $credentials = ['username' => 'unit', 'password' => 'test']; @@ -239,7 +238,7 @@ public function testBindAuthenticationMethodNoEntry() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(false, false, false), new Dispatcher(), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(false, false, false), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -259,7 +258,7 @@ public function testBindAuthenticationMethodNoEntry() */ public function testBindAuthenticationMethodWithDN() { - $plugin = new Ldap($this->createFactory(), new Dispatcher(), ['params' => ['auth_method' => 'bind', 'users_dn' => 'test', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(), ['params' => ['auth_method' => 'bind', 'users_dn' => 'test', 'host' => 'test']]); $response = new AuthenticationResponse(); $credentials = ['username' => 'unit', 'password' => 'test']; @@ -284,7 +283,7 @@ public function testBindAuthenticationMethodWithBindException() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(true, false), new Dispatcher(), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(true, false), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); @@ -310,7 +309,7 @@ public function testBindAuthenticationMethodWithQueryException() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Ldap($this->createFactory(false, true), new Dispatcher(), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); + $plugin = new Ldap($this->createFactory(false, true), ['params' => ['auth_method' => 'bind', 'host' => 'test']]); $plugin->setApplication($app); $response = new AuthenticationResponse(); diff --git a/tests/Unit/Plugin/Filesystem/Local/Extension/LocalPluginTest.php b/tests/Unit/Plugin/Filesystem/Local/Extension/LocalPluginTest.php index b04fc71038f99..7bad2a7685ece 100644 --- a/tests/Unit/Plugin/Filesystem/Local/Extension/LocalPluginTest.php +++ b/tests/Unit/Plugin/Filesystem/Local/Extension/LocalPluginTest.php @@ -15,7 +15,6 @@ use Joomla\CMS\User\User; use Joomla\Component\Media\Administrator\Event\MediaProviderEvent; use Joomla\Component\Media\Administrator\Provider\ProviderManager; -use Joomla\Event\Dispatcher; use Joomla\Plugin\Filesystem\Local\Extension\Local; use Joomla\Tests\Unit\UnitTestCase; @@ -40,9 +39,7 @@ class LocalPluginTest extends UnitTestCase */ public function testID() { - $dispatcher = new Dispatcher(); - - $plugin = new Local($dispatcher, ['name' => 'test'], __DIR__); + $plugin = new Local(['name' => 'test'], __DIR__); $this->assertEquals('test', $plugin->getID()); } @@ -56,15 +53,13 @@ public function testID() */ public function testDisplayName() { - $dispatcher = new Dispatcher(); - $language = $this->createStub(Language::class); $language->method('_')->willReturn('test'); $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Local($dispatcher, [], __DIR__); + $plugin = new Local([], __DIR__); $plugin->setApplication($app); $this->assertEquals('test', $plugin->getDisplayName()); @@ -79,14 +74,12 @@ public function testDisplayName() */ public function testSetupProviders() { - $dispatcher = new Dispatcher(); - $manager = new ProviderManager(); $event = new MediaProviderEvent('test'); $event->setProviderManager($manager); - $plugin = new Local($dispatcher, ['name' => 'test'], __DIR__); + $plugin = new Local(['name' => 'test'], __DIR__); $plugin->onSetupProviders($event); $this->assertEquals(['test' => $plugin], $manager->getProviders()); @@ -102,12 +95,10 @@ public function testSetupProviders() */ public function testAdapters() { - $dispatcher = new Dispatcher(); - $app = $this->createStub(CMSApplicationInterface::class); $app->method('getIdentity')->willReturn(new User()); - $plugin = new Local($dispatcher, ['params' => ['directories' => '[{"directory": "tests"}]']], JPATH_ROOT); + $plugin = new Local(['params' => ['directories' => '[{"directory": "tests"}]']], JPATH_ROOT); $plugin->setApplication($app); $adapters = $plugin->getAdapters(); @@ -125,9 +116,8 @@ public function testAdapters() public function testAdaptersInvalidDirectory() { $this->expectException(\InvalidArgumentException::class); - $dispatcher = new Dispatcher(); - $plugin = new Local($dispatcher, ['params' => ['directories' => '[{"directory": "invalid"}]']], __DIR__); + $plugin = new Local(['params' => ['directories' => '[{"directory": "invalid"}]']], __DIR__); $plugin->getAdapters(); } } diff --git a/tests/Unit/Plugin/Task/Checkfiles/Extension/CheckfilesPluginTest.php b/tests/Unit/Plugin/Task/Checkfiles/Extension/CheckfilesPluginTest.php index 4f077a126a689..1608c0e605b21 100644 --- a/tests/Unit/Plugin/Task/Checkfiles/Extension/CheckfilesPluginTest.php +++ b/tests/Unit/Plugin/Task/Checkfiles/Extension/CheckfilesPluginTest.php @@ -15,7 +15,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Task\Task; -use Joomla\Event\Dispatcher; use Joomla\Filesystem\Folder; use Joomla\Plugin\Task\Checkfiles\Extension\Checkfiles; use Joomla\Tests\Unit\UnitTestCase; @@ -92,7 +91,7 @@ public function testResize() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Checkfiles(new Dispatcher(), [], $this->tmpFolder); + $plugin = new Checkfiles([], $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -131,7 +130,7 @@ public function testResizeWithLimit() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Checkfiles(new Dispatcher(), [], $this->tmpFolder); + $plugin = new Checkfiles([], $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -172,7 +171,7 @@ public function testIgnoreResize() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Checkfiles(new Dispatcher(), [], $this->tmpFolder); + $plugin = new Checkfiles([], $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -209,7 +208,7 @@ public function testInvalidFolder() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Checkfiles(new Dispatcher(), [], $this->tmpFolder); + $plugin = new Checkfiles([], $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); diff --git a/tests/Unit/Plugin/Task/Requests/Extension/RequestsPluginTest.php b/tests/Unit/Plugin/Task/Requests/Extension/RequestsPluginTest.php index 55e0d7fa4799d..614c326930d56 100644 --- a/tests/Unit/Plugin/Task/Requests/Extension/RequestsPluginTest.php +++ b/tests/Unit/Plugin/Task/Requests/Extension/RequestsPluginTest.php @@ -10,14 +10,12 @@ namespace Joomla\Tests\Unit\Plugin\Task\Requests\Extension; -use Exception; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Http\Http; use Joomla\CMS\Language\Language; use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Task\Task; -use Joomla\Event\Dispatcher; use Joomla\Filesystem\Folder; use Joomla\Http\HttpFactory; use Joomla\Http\Response; @@ -116,7 +114,7 @@ public static function isSupported() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Requests(new Dispatcher(), [], $factory, $this->tmpFolder); + $plugin = new Requests([], $factory, $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -175,7 +173,7 @@ public static function isSupported() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Requests(new Dispatcher(), [], $factory, $this->tmpFolder); + $plugin = new Requests([], $factory, $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -234,7 +232,7 @@ public static function isSupported() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Requests(new Dispatcher(), [], $factory, $this->tmpFolder); + $plugin = new Requests([], $factory, $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -283,7 +281,7 @@ public static function isSupported() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Requests(new Dispatcher(), [], $factory, $this->tmpFolder); + $plugin = new Requests([], $factory, $this->tmpFolder); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -334,7 +332,7 @@ public static function isSupported() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new Requests(new Dispatcher(), [], $factory, '/proc/invalid'); + $plugin = new Requests([], $factory, '/proc/invalid'); $plugin->setApplication($app); $task = $this->createStub(Task::class); diff --git a/tests/Unit/Plugin/Task/SiteStatus/Extension/SiteStatusPluginTest.php b/tests/Unit/Plugin/Task/SiteStatus/Extension/SiteStatusPluginTest.php index 88b3e289820be..d972bdfc63470 100644 --- a/tests/Unit/Plugin/Task/SiteStatus/Extension/SiteStatusPluginTest.php +++ b/tests/Unit/Plugin/Task/SiteStatus/Extension/SiteStatusPluginTest.php @@ -15,7 +15,6 @@ use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Task\Task; -use Joomla\Event\Dispatcher; use Joomla\Filesystem\Folder; use Joomla\Plugin\Task\SiteStatus\Extension\SiteStatus; use Joomla\Tests\Unit\UnitTestCase; @@ -89,7 +88,7 @@ public function testSetOnlineWhenOffline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => true], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => true], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -117,7 +116,7 @@ public function testSetOnlineWhenOnline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => false], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => false], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -145,7 +144,7 @@ public function testSetOfflineWhenOnline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => false], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => false], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -173,7 +172,7 @@ public function testSetOfflineWhenOffline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => true], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => true], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -201,7 +200,7 @@ public function testToggleOffline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => false], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => false], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -229,7 +228,7 @@ public function testToggleOnline() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => true], $this->tmpFolder . '/config.php'); + $plugin = new SiteStatus([], ['offline' => true], $this->tmpFolder . '/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class); @@ -257,7 +256,7 @@ public function testInvalidConfigFile() $app = $this->createStub(CMSApplicationInterface::class); $app->method('getLanguage')->willReturn($language); - $plugin = new SiteStatus(new Dispatcher(), [], ['offline' => true], '/proc/invalid/config.php'); + $plugin = new SiteStatus([], ['offline' => true], '/proc/invalid/config.php'); $plugin->setApplication($app); $task = $this->createStub(Task::class);