]> git.mxchange.org Git - friendica.git/commitdiff
Rename method names in AddonHelper
authorArt4 <art4@wlabs.de>
Mon, 3 Feb 2025 14:27:23 +0000 (14:27 +0000)
committerArt4 <art4@wlabs.de>
Mon, 3 Feb 2025 14:27:23 +0000 (14:27 +0000)
src/App/Router.php
src/Core/Addon/AddonHelper.php
src/Core/Addon/AddonProxy.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Summary.php

index da5acb18acaa7be3db476b1cdc77e2713faa339b..c5abd56c5c394c7f52d6b1d5767f3484abf1f4b9 100644 (file)
@@ -294,7 +294,7 @@ class Router
                } catch (NotFoundException $e) {
                        $moduleName = $this->args->getModuleName();
                        // Then we try addon-provided modules that we wrap in the LegacyModule class
-                       if ($this->addonHelper->isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
+                       if ($this->addonHelper->isAddonEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
                                //Check if module is an app and if public access to apps is allowed or not
                                $privateapps = $this->config->get('config', 'private_addons', false);
                                if (!$this->isLocalUser && Hook::isAddonApp($moduleName) && $privateapps) {
index 6088886ee6e110e035cbd9fe3664b851dcbea64b..76d8eff75f8c5f0f6caf7a10c8b3128452c0f2a1 100644 (file)
@@ -17,19 +17,19 @@ interface AddonHelper
        /**
         * Checks if the provided addon is enabled
         */
-       public function isEnabled(string $addonId): bool;
+       public function isAddonEnabled(string $addonId): bool;
 
        /**
         * Returns a list with the IDs of the enabled addons
         *
         * @return string[]
         */
-       public function getEnabledList(): array;
+       public function getEnabledAddons(): array;
 
        /**
-        * Returns the list of the IDs of the non-hidden enabled addons
+        * Returns a list with the IDs of the non-hidden enabled addons
         *
         * @return string[]
         */
-       public static function getVisibleList(): array;
+       public static function getVisibleEnabledAddons(): array;
 }
index 2e260a40b41be82667d9086d760a2230a15502a3..d53b136060e7cd038394d9ded42a59985cfc8495 100644 (file)
@@ -21,7 +21,7 @@ final class AddonProxy implements AddonHelper
        /**
         * Checks if the provided addon is enabled
         */
-       public function isEnabled(string $addonId): bool
+       public function isAddonEnabled(string $addonId): bool
        {
                return Addon::isEnabled($addonId);
        }
@@ -31,17 +31,17 @@ final class AddonProxy implements AddonHelper
         *
         * @return string[]
         */
-       public function getEnabledList(): array
+       public function getEnabledAddons(): array
        {
                return Addon::getEnabledList();
        }
 
        /**
-        * Returns the list of the IDs of the non-hidden enabled addons
+        * Returns a list with the IDs of the non-hidden enabled addons
         *
         * @return string[]
         */
-       public static function getVisibleList(): array
+       public static function getVisibleEnabledAddons(): array
        {
                return Addon::getVisibleList();
        }
index 5941d76ff642a85cd92cb95c2ef398d820e5cfa8..8f3e82efb145debe2d456942a1f5fa6684101e16 100644 (file)
@@ -38,7 +38,7 @@ class Index extends BaseAdmin
                                        $addonHelper = DI::addonHelper();
 
                                        $addon = $_GET['addon'] ?? '';
-                                       if ($addonHelper->isEnabled($addon)) {
+                                       if ($addonHelper->isAddonEnabled($addon)) {
                                                Addon::uninstall($addon);
                                                DI::sysmsg()->addInfo(DI::l10n()->t('Addon %s disabled.', $addon));
                                        } elseif (Addon::install($addon)) {
index 9b09843d969067e9fdee406f84371ad57fe6d049..72ce10e41817e3d1ec0888331eba3e37c2c531ea 100644 (file)
@@ -186,7 +186,7 @@ class Summary extends BaseAdmin
                        '$platform'       => App::PLATFORM,
                        '$codename'       => App::CODENAME,
                        '$build'          => DI::config()->get('system', 'build'),
-                       '$addons'         => [DI::l10n()->t('Active addons'), DI::addonHelper()->getEnabledList()],
+                       '$addons'         => [DI::l10n()->t('Active addons'), DI::addonHelper()->getEnabledAddons()],
                        '$serversettings' => $server_settings,
                        '$warningtext'    => $warningtext,
                ]);