diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2024-09-16 10:04:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 10:04:37 +0200 |
commit | 0a7b4b597e6dc6824f5ccedfe40ca4fd86dea07d (patch) | |
tree | b6843298d1f8478c16ce7a8e98c09b135491c133 /lib/private | |
parent | 54b162f10e436ad9a80c6fbf3ea97c50b5930826 (diff) | |
parent | c57e684e7b22a02c7017450d1fdaaec9afc83d62 (diff) | |
download | nextcloud-server-0a7b4b597e6dc6824f5ccedfe40ca4fd86dea07d.tar.gz nextcloud-server-0a7b4b597e6dc6824f5ccedfe40ca4fd86dea07d.zip |
Merge pull request #48042 from nextcloud/refactor/elvis
refactor: Use the elvis operator + fix: Handle null checks with the ?? operator
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Log/LogDetails.php | 2 | ||||
-rw-r--r-- | lib/private/User/Database.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index 95b09c0a181..bd18eb983db 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -37,7 +37,7 @@ abstract class LogDetails { $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; $method = is_string($request->getMethod()) ? $request->getMethod() : '--'; if ($this->config->getValue('installed', false)) { - $user = \OC_User::getUser() ? \OC_User::getUser() : '--'; + $user = \OC_User::getUser() ?? '--'; } else { $user = '--'; } diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index a80cc39a732..2d3808e9dc7 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -64,7 +64,7 @@ class Database extends ABackend implements public function __construct($eventDispatcher = null, $table = 'users') { $this->cache = new CappedMemoryCache(); $this->table = $table; - $this->eventDispatcher = $eventDispatcher ? $eventDispatcher : \OCP\Server::get(IEventDispatcher::class); + $this->eventDispatcher = $eventDispatcher ?? \OCP\Server::get(IEventDispatcher::class); } /** |