Skip to content

Commit

Permalink
Convert isset ternary to null coalescing operator
Browse files Browse the repository at this point in the history
Signed-off-by: Hamid Dehnavi <[email protected]>
  • Loading branch information
shdehnavi authored and susnux committed Aug 16, 2023
1 parent 00a3ab9 commit 271e63e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/lib/Util/User/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function setDisplayName($uid, $displayName) {
}

public function getDisplayName($uid) {
return isset($this->displayNames[$uid])? $this->displayNames[$uid]: $uid;
return $this->displayNames[$uid] ?? $uid;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/UtilCheckServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function getConfig($systemOptions) {
$config->expects($this->any())
->method('getValue')
->willReturnCallback(function ($key, $default) use ($systemOptions) {
return isset($systemOptions[$key]) ? $systemOptions[$key] : $default;
return $systemOptions[$key] ?? $default;
});
return $config;
}
Expand Down

0 comments on commit 271e63e

Please sign in to comment.