diff options
author | Simon L <szaimen@e.mail.de> | 2023-06-12 09:42:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 09:42:43 +0200 |
commit | c93be182dc0172eed377ba70ce54cd7c83689764 (patch) | |
tree | bde4a8070112dec29b367caeb935424dfcb83186 /apps | |
parent | a85831a59708491a01594e2c1aab930c49476570 (diff) | |
parent | 716a65946896de0ec9197c6cbebaf9b8c8060d6b (diff) | |
download | nextcloud-server-c93be182dc0172eed377ba70ce54cd7c83689764.tar.gz nextcloud-server-c93be182dc0172eed377ba70ce54cd7c83689764.zip |
Merge pull request #38543 from fsamapoor/use_null_coalescing_operator
Uses "Null Coalescing Operator" to improve code readability.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Controller/AppSettingsController.php | 8 |
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, |