Simplify AddonHelper::getAvailableAddons(), move style logic into Module class

This commit is contained in:
Art4 2025-02-04 13:48:04 +00:00
parent af1894504d
commit a80bf0ddf1
4 changed files with 30 additions and 8 deletions

View file

@ -22,11 +22,12 @@ interface AddonHelper
public function getAddonPath(): string;
/**
* Returns the list of available addons with their current status and info.
* Returns the list of available addons.
*
* This list is made from scanning the addon/ folder.
* Unsupported addons are excluded unless they already are enabled or system.show_unsupported_addon is set.
*
* @return array<array<string|string|array>>
* @return string[]
*/
public function getAvailableAddons(): array;

View file

@ -36,15 +36,21 @@ final class AddonProxy implements AddonHelper
}
/**
* Returns the list of available addons with their current status and info.
* Returns the list of available addons.
*
* This list is made from scanning the addon/ folder.
* Unsupported addons are excluded unless they already are enabled or system.show_unsupported_addon is set.
*
* @return array<array<string|string|array>>
* @return string[]
*/
public function getAvailableAddons(): array
{
return Addon::getAvailableList();
return array_map(
function(array $item) {
return $item[0];
},
Addon::getAvailableList()
);
}
/**