aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/lib/Controller')
-rw-r--r--apps/settings/lib/Controller/AppSettingsController.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index 1e4387bdcfd..ac98677d0c9 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -184,17 +184,11 @@ class AppSettingsController extends Controller {
private function getAllCategories() {
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
- $formattedCategories = [];
$categories = $this->categoryFetcher->get();
- foreach ($categories as $category) {
- $formattedCategories[] = [
- 'id' => $category['id'],
- 'ident' => $category['id'],
- 'displayName' => $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'],
- ];
- }
-
- return $formattedCategories;
+ return array_map(fn ($category) => [
+ 'id' => $category['id'],
+ 'displayName' => $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'],
+ ], $categories);
}
private function fetchApps() {