aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFaraz Samapoor <f.samapoor@gmail.com>2023-05-31 14:51:52 +0330
committerFaraz Samapoor <fsa@adlas.at>2023-05-31 14:51:52 +0330
commit716a65946896de0ec9197c6cbebaf9b8c8060d6b (patch)
treeab0a0192159c0b08b147f7c7367a2964972f0022
parent2845a04827c457b98ef82148be16b36f5ff8dcd5 (diff)
downloadnextcloud-server-716a65946896de0ec9197c6cbebaf9b8c8060d6b.tar.gz
nextcloud-server-716a65946896de0ec9197c6cbebaf9b8c8060d6b.zip
Uses "Null Coalescing Operator" to improve code readability.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
-rw-r--r--apps/settings/lib/Controller/AppSettingsController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index d0ed408df02..bc84e17535e 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -187,7 +187,7 @@ class AppSettingsController extends Controller {
$formattedCategories[] = [
'id' => $category['id'],
'ident' => $category['id'],
- 'displayName' => isset($category['translations'][$currentLanguage]['name']) ? $category['translations'][$currentLanguage]['name'] : $category['translations']['en']['name'],
+ 'displayName' => $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'],
];
}
@@ -370,9 +370,9 @@ class AppSettingsController extends Controller {
$formattedApps[] = [
'id' => $app['id'],
- 'name' => isset($app['translations'][$currentLanguage]['name']) ? $app['translations'][$currentLanguage]['name'] : $app['translations']['en']['name'],
- 'description' => isset($app['translations'][$currentLanguage]['description']) ? $app['translations'][$currentLanguage]['description'] : $app['translations']['en']['description'],
- 'summary' => isset($app['translations'][$currentLanguage]['summary']) ? $app['translations'][$currentLanguage]['summary'] : $app['translations']['en']['summary'],
+ 'name' => $app['translations'][$currentLanguage]['name'] ?? $app['translations']['en']['name'],
+ 'description' => $app['translations'][$currentLanguage]['description'] ?? $app['translations']['en']['description'],
+ 'summary' => $app['translations'][$currentLanguage]['summary'] ?? $app['translations']['en']['summary'],
'license' => $app['releases'][0]['licenses'],
'author' => $authors,
'shipped' => false,