From c4469cb62411321b20fd85b9c61f68315743d859 Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 2 Feb 2025 19:32:17 +0000 Subject: [PATCH] Move getVisibleList() into AddonHelper --- src/Core/Addon.php | 2 ++ src/Core/Addon/AddonHelper.php | 11 +++++++++-- src/Core/Addon/AddonProxy.php | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Core/Addon.php b/src/Core/Addon.php index 8df395baa0..1109bafd2d 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -300,6 +300,8 @@ class Addon /** * Returns the list of non-hidden enabled addon names * + * @deprecated 2025.02 Use `Friendica\Core\Addon\AddonHelper::getVisibleList()` instead + * * @return array * @throws \Exception */ diff --git a/src/Core/Addon/AddonHelper.php b/src/Core/Addon/AddonHelper.php index 3d3824de70..7d71dd0e33 100644 --- a/src/Core/Addon/AddonHelper.php +++ b/src/Core/Addon/AddonHelper.php @@ -20,9 +20,16 @@ interface AddonHelper public function isEnabled(string $addonId): bool; /** - * Returns a list of the enabled addon names + * Returns a list with the IDs of the enabled addons * - * @return array + * @return string[] */ public function getEnabledList(): array; + + /** + * Returns the list of the IDs of the non-hidden enabled addons + * + * @return string[] + */ + public static function getVisibleList(): array; } diff --git a/src/Core/Addon/AddonProxy.php b/src/Core/Addon/AddonProxy.php index 97f90584b6..2e260a40b4 100644 --- a/src/Core/Addon/AddonProxy.php +++ b/src/Core/Addon/AddonProxy.php @@ -27,7 +27,7 @@ final class AddonProxy implements AddonHelper } /** - * Returns a list of the enabled addon names + * Returns a list with the IDs of the enabled addons * * @return string[] */ @@ -35,4 +35,14 @@ final class AddonProxy implements AddonHelper { return Addon::getEnabledList(); } + + /** + * Returns the list of the IDs of the non-hidden enabled addons + * + * @return string[] + */ + public static function getVisibleList(): array + { + return Addon::getVisibleList(); + } }