Skip to content

Commit 271e63e

Browse files
shdehnavisusnux
authored andcommitted
Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
1 parent 00a3ab9 commit 271e63e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/lib/Util/User/Dummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function setDisplayName($uid, $displayName) {
168168
}
169169

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

174174
/**

tests/lib/UtilCheckServerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function getConfig($systemOptions) {
3030
$config->expects($this->any())
3131
->method('getValue')
3232
->willReturnCallback(function ($key, $default) use ($systemOptions) {
33-
return isset($systemOptions[$key]) ? $systemOptions[$key] : $default;
33+
return $systemOptions[$key] ?? $default;
3434
});
3535
return $config;
3636
}

0 commit comments

Comments
 (0)