(NFC) Update CRM/Contact to match new coder style
[civicrm-core.git] / CRM / Contact / Form / Task / RemoveFromTag.php
index bc30fa4a6ec7c80dc29537bacd3c73c2d4fa403c..3c18e5b3e2e36a731ebb270c5d2bb30c74d00c06 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 
 /**
@@ -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]);
     }
   }