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 <hamid.dev.pro@gmail.com>
  • Loading branch information
shdehnavi committed Jul 7, 2023
1 parent 9bf6911 commit 9e790eb
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 9e790eb

Please sign in to comment.