From fbc525f54a2b5bfcd15d389c412f087be0643286 Mon Sep 17 00:00:00 2001 From: tmikkonen <1330453+tmikkonen@users.noreply.github.com> Date: Fri, 8 Dec 2023 23:50:57 +0200 Subject: [PATCH] [FINNA-1240] Refactor to remove nested if clause --- module/Finna/src/Finna/RecordDriver/SolrQdc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/module/Finna/src/Finna/RecordDriver/SolrQdc.php b/module/Finna/src/Finna/RecordDriver/SolrQdc.php index b450f47bb5e..b97319ab9c0 100644 --- a/module/Finna/src/Finna/RecordDriver/SolrQdc.php +++ b/module/Finna/src/Finna/RecordDriver/SolrQdc.php @@ -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;