diff options
author | Hamid Dehnavi <hamid.dev.pro@gmail.com> | 2023-07-07 13:43:21 +0330 |
---|---|---|
committer | Hamid Dehnavi <hamid.dev.pro@gmail.com> | 2023-09-28 17:44:19 +0330 |
commit | ea06cf2f39c5c4e7f1ea20d075c01e3ba0cc6dd0 (patch) | |
tree | 91e5cd5b937877bcc6aafac1c7cff24e6f1589a2 /lib/private/NavigationManager.php | |
parent | 45cac164322d6ce4d10db07b9207b7079694e2a4 (diff) | |
download | nextcloud-server-ea06cf2f39c5c4e7f1ea20d075c01e3ba0cc6dd0.tar.gz nextcloud-server-ea06cf2f39c5c4e7f1ea20d075c01e3ba0cc6dd0.zip |
Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Diffstat (limited to 'lib/private/NavigationManager.php')
-rw-r--r-- | lib/private/NavigationManager.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index ef6e6f4cb74..a651cde379d 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -101,7 +101,7 @@ class NavigationManager implements INavigationManager { } $id = $entry['id']; - $entry['unread'] = isset($this->unreadCounters[$id]) ? $this->unreadCounters[$id] : 0; + $entry['unread'] = $this->unreadCounters[$id] ?? 0; $this->entries[$id] = $entry; } @@ -313,7 +313,7 @@ class NavigationManager implements INavigationManager { if (!isset($nav['route']) && $nav['type'] !== 'settings') { continue; } - $role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all'; + $role = $nav['@attributes']['role'] ?? 'all'; if ($role === 'admin' && !$this->isAdmin()) { continue; } @@ -322,7 +322,7 @@ class NavigationManager implements INavigationManager { $order = $customOrders[$app][$key] ?? $nav['order'] ?? 100; $type = $nav['type']; $route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : ''; - $icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg'; + $icon = $nav['icon'] ?? 'app.svg'; foreach ([$icon, "$app.svg"] as $i) { try { $icon = $this->urlGenerator->imagePath($app, $i); |