mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 16:48:59 -04:00
fix: Handle null checks with the ?? operator
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
614f9ec0a2
commit
c57e684e7b
3 changed files with 3 additions and 3 deletions
2
apps/files_sharing/lib/External/Manager.php
vendored
2
apps/files_sharing/lib/External/Manager.php
vendored
|
|
@ -119,7 +119,7 @@ class Manager {
|
|||
* @throws \Doctrine\DBAL\Exception
|
||||
*/
|
||||
public function addShare($remote, $token, $password, $name, $owner, $shareType, $accepted = false, $user = null, $remoteId = '', $parent = -1) {
|
||||
$user = $user ?: $this->uid;
|
||||
$user = $user ?? $this->uid;
|
||||
$accepted = $accepted ? IShare::STATUS_ACCEPTED : IShare::STATUS_PENDING;
|
||||
$name = Filesystem::normalizePath('/' . $name);
|
||||
|
||||
|
|
|
|||
|
|
@ -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() ?: '--';
|
||||
$user = \OC_User::getUser() ?? '--';
|
||||
} else {
|
||||
$user = '--';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ?: \OCP\Server::get(IEventDispatcher::class);
|
||||
$this->eventDispatcher = $eventDispatcher ?? \OCP\Server::get(IEventDispatcher::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue