return $this->lastSection;
}
list( $dbName, ) = $this->getDBNameAndPrefix( $domain );
- if ( isset( $this->sectionsByDB[$dbName] ) ) {
- $section = $this->sectionsByDB[$dbName];
- } else {
- $section = 'DEFAULT';
- }
+ $section = $this->sectionsByDB[$dbName] ?? 'DEFAULT';
$this->lastSection = $section;
$this->lastDomain = $domain;
public function newMainLB( $domain = false ) {
list( $dbName, ) = $this->getDBNameAndPrefix( $domain );
$section = $this->getSectionForDomain( $domain );
- if ( isset( $this->groupLoadsByDB[$dbName] ) ) {
- $groupLoads = $this->groupLoadsByDB[$dbName];
- } else {
- $groupLoads = [];
- }
+ $groupLoads = $this->groupLoadsByDB[$dbName] ?? [];
if ( isset( $this->groupLoadsBySection[$section] ) ) {
$groupLoads = array_merge_recursive(
if ( isset( $groupLoadsByServer[$serverName] ) ) {
$serverInfo['groupLoads'] = $groupLoadsByServer[$serverName];
}
- if ( isset( $this->hostsByName[$serverName] ) ) {
- $serverInfo['host'] = $this->hostsByName[$serverName];
- } else {
- $serverInfo['host'] = $serverName;
- }
+ $serverInfo['host'] = $this->hostsByName[$serverName] ?? $serverName;
$serverInfo['hostName'] = $serverName;
$serverInfo['load'] = $load;
$serverInfo += [ 'flags' => IDatabase::DBO_DEFAULT ];