Skip to content

Commit

Permalink
Use nullsafe operator
Browse files Browse the repository at this point in the history
  • Loading branch information
maccabeelevine committed Nov 21, 2023
1 parent 4c308f9 commit 50809da
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions module/VuFind/src/VuFind/Recommend/Databases.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,16 @@ public function setConfig($settings)
if (!$databasesConfig) {
throw new \Exception("Databases config file $databasesConfigFile must have section 'Databases'.");
}
$this->configFileDatabases = isset($databasesConfig->url) ? $databasesConfig->url->toArray()
: $this->configFileDatabases;
$this->configFileDatabases = $databasesConfig->url?->toArray()
?? $this->configFileDatabases;
array_walk($this->configFileDatabases, function (&$value, $name) {
$value = [
'name' => $name,
'url' => $value,
];
});

$this->resultFacet = isset($databasesConfig->resultFacet)
? $databasesConfig->resultFacet->toArray() : $this->resultFacet;
$this->resultFacet = $databasesConfig->resultFacet?->toArray() ?? $this->resultFacet;
$this->resultFacetNameKey = $databasesConfig->resultFacetNameKey
?? $this->resultFacetNameKey;

Expand Down

0 comments on commit 50809da

Please sign in to comment.