Browse Source

Convert isset ternary to null coalescing operator

Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
pull/39226/head
Hamid Dehnavi 3 years ago
committed by Ferdinand Thiessen
parent
commit
271e63e41c
  1. 2
      tests/lib/Util/User/Dummy.php
  2. 2
      tests/lib/UtilCheckServerTest.php

2
tests/lib/Util/User/Dummy.php

@ -168,7 +168,7 @@ class Dummy extends Backend implements \OCP\IUserBackend {
}
public function getDisplayName($uid) {
return isset($this->displayNames[$uid])? $this->displayNames[$uid]: $uid;
return $this->displayNames[$uid] ?? $uid;
}
/**

2
tests/lib/UtilCheckServerTest.php

@ -30,7 +30,7 @@ class UtilCheckServerTest extends \Test\TestCase {
$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;
}

Loading…
Cancel
Save