From: Eileen McNaughton Date: Fri, 15 Sep 2023 03:24:49 +0000 (+1200) Subject: Fix some variables to always assign X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5a0c67ab98e832d4b309edab5f27eca56b52dd66;p=civicrm-core.git Fix some variables to always assign --- diff --git a/CRM/UF/Form/AbstractPreview.php b/CRM/UF/Form/AbstractPreview.php index a1e6c0414b..87bd1eaa0b 100644 --- a/CRM/UF/Form/AbstractPreview.php +++ b/CRM/UF/Form/AbstractPreview.php @@ -37,20 +37,11 @@ class CRM_UF_Form_AbstractPreview extends CRM_Core_Form { * @param bool $isSingleField * @param bool $flag */ - public function setProfile($fields, $isSingleField = FALSE, $flag = FALSE) { - if ($isSingleField) { - $this->assign('previewField', $isSingleField); - } - - if ($flag) { - $this->assign('viewOnly', FALSE); - } - else { - $this->assign('viewOnly', TRUE); - } - + public function setProfile(array $fields, bool $isSingleField = FALSE, bool $flag = FALSE): void { + $this->assign('previewField', $isSingleField); + $this->assign('viewOnly', !$flag); $this->set('fieldId', NULL); - $this->assign("fields", $fields); + $this->assign('fields', $fields); $this->_fields = $fields; }