(NFC) Update CRM/Contact to match new coder style
[civicrm-core.git] / CRM / Contact / Form / Task / RemoveFromTag.php
index 3d5025ccdbb01d12f54971fda6fa08cb9a36e6a2..3c18e5b3e2e36a731ebb270c5d2bb30c74d00c06 100644 (file)
@@ -67,7 +67,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
   }
 
   public function addRules() {
-    $this->addFormRule(array('CRM_Contact_Form_Task_RemoveFromTag', 'formRule'));
+    $this->addFormRule(['CRM_Contact_Form_Task_RemoveFromTag', 'formRule']);
   }
 
   /**
@@ -77,7 +77,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
    * @return array
    */
   public static function formRule($form, $rule) {
-    $errors = array();
+    $errors = [];
     if (empty($form['tag']) && empty($form['contact_taglist'])) {
       $errors['_qf_default'] = "Please select atleast one tag.";
     }
@@ -91,7 +91,7 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
     //get the submitted values in an array
     $params = $this->controller->exportValues($this->_name);
 
-    $contactTags = $tagList = array();
+    $contactTags = $tagList = [];
 
     // check if contact tags exists
     if (!empty($params['tag'])) {
@@ -120,27 +120,27 @@ class CRM_Contact_Form_Task_RemoveFromTag extends CRM_Contact_Form_Task {
     // merge contact and taglist tags
     $allTags = CRM_Utils_Array::crmArrayMerge($contactTags, $tagList);
 
-    $this->_name = array();
+    $this->_name = [];
     foreach ($allTags as $key => $dnc) {
       $this->_name[] = $this->_tags[$key];
 
       list($total, $removed, $notRemoved) = CRM_Core_BAO_EntityTag::removeEntitiesFromTag($this->_contactIds, $key,
         'civicrm_contact', FALSE);
 
-      $status = array(
-        ts('%count contact un-tagged', array(
-            'count' => $removed,
-            'plural' => '%count contacts un-tagged',
-           )),
-      );
+      $status = [
+        ts('%count contact un-tagged', [
+          'count' => $removed,
+          'plural' => '%count contacts un-tagged',
+        ]),
+      ];
       if ($notRemoved) {
-        $status[] = ts('1 contact already did not have this tag', array(
-            'count' => $notRemoved,
-            'plural' => '%count contacts already did not have this tag',
-          ));
+        $status[] = ts('1 contact already did not have this tag', [
+          'count' => $notRemoved,
+          'plural' => '%count contacts already did not have this tag',
+        ]);
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-      CRM_Core_Session::setStatus($status, ts("Removed Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
+      CRM_Core_Session::setStatus($status, ts("Removed Tag <em>%1</em>", [1 => $this->_tags[$key]]), 'success', ['expires' => 0]);
     }
   }