Remove unused variable
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 7 Dec 2023 19:38:38 +0000 (08:38 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 7 Dec 2023 19:38:38 +0000 (08:38 +1300)
CRM/Member/Form/Task/Label.php

index 2162dd0d071524a58098b82c2d6aa12eafee3444..a25d9e4382967f5b32e3794399c2c575fadc087a 100644 (file)
@@ -26,7 +26,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    *
    * @return void
    */
-  public function preProcess() {
+  public function preProcess(): void {
     parent::preProcess();
     $this->setContactIDs();
     CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Member/Form/Task/Label.js');
@@ -38,7 +38,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    *
    * @return void
    */
-  public function buildQuickForm() {
+  public function buildQuickForm(): void {
     CRM_Contact_Form_Task_Label::buildLabelForm($this);
     $this->addElement('checkbox', 'per_membership', ts('Print one label per Membership (rather than per contact)'));
   }
@@ -49,7 +49,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    * @return array
    *   array of default values
    */
-  public function setDefaultValues() {
+  public function setDefaultValues(): array {
     $defaults = [];
     $format = CRM_Core_BAO_LabelFormat::getDefaultValues();
     $defaults['label_name'] = $format['name'] ?? NULL;
@@ -65,7 +65,7 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
    *
    * @return void
    */
-  public function postProcess() {
+  public function postProcess(): void {
     $formValues = $this->controller->exportValues($this->_name);
     $locationTypeID = $formValues['location_type_id'];
     $respectDoNotMail = $formValues['do_not_mail'] ?? NULL;
@@ -81,16 +81,13 @@ class CRM_Member_Form_Task_Label extends CRM_Member_Form_Task {
     // so no-one is tempted to refer to this again after relevant values are extracted
     unset($formValues);
 
-    list($rows, $tokenFields) = CRM_Contact_Form_Task_LabelCommon::getRows($this->_contactIds, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold);
+    [$rows, $tokenFields] = CRM_Contact_Form_Task_LabelCommon::getRows($this->_contactIds, $locationTypeID, $respectDoNotMail, $mergeSameAddress, $mergeSameHousehold);
 
-    $individualFormat = FALSE;
     if ($mergeSameAddress) {
       CRM_Core_BAO_Address::mergeSameAddress($rows);
-      $individualFormat = TRUE;
     }
     if ($mergeSameHousehold) {
       $rows = CRM_Contact_Form_Task_LabelCommon::mergeSameHousehold($rows);
-      $individualFormat = TRUE;
     }
     // format the addresses according to CIVICRM_ADDRESS_FORMAT (CRM-1327)
     foreach ((array) $rows as $id => $row) {