Skip to content

Commit

Permalink
[FINNA-1240] Refactor to remove nested if clause
Browse files Browse the repository at this point in the history
  • Loading branch information
tmikkonen committed Dec 8, 2023
1 parent 7e8fbe5 commit fbc525f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions module/Finna/src/Finna/RecordDriver/SolrQdc.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,8 @@ public function getAccessRights(): array
$strRight = trim((string)$right);
$type = trim((string)$right->attributes()->type);
$rightLanguage = trim((string)$right->attributes()->lang);
if ('accessrights' === $type) {
if (!$rightLanguage || $rightLanguage === $locale) {
$result[] = $strRight;
}
if (('accessrights' === $type) && (!$rightLanguage || $rightLanguage === $locale)) {
$result[] = $strRight;
}
}
return $result;
Expand Down

0 comments on commit fbc525f

Please sign in to comment.