(NFC) Update CRM/Contact to match new coder style
[civicrm-core.git] / CRM / Contact / Form / Task / RemoveFromGroup.php
index 4d0f878589d7aaf41a3b2c5f2b3db6a7def1d54d..d803f436e7b6d8d15147e9b9c1abf1bc30f4ec69 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.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
  */
 
 /**
@@ -43,8 +43,8 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task {
    */
   public function buildQuickForm() {
     // add select for groups
-    $group = array('' => ts('- select group -')) + CRM_Core_PseudoConstant::nestedGroup();
-    $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE, array('class' => 'crm-select2 huge'));
+    $group = ['' => ts('- select group -')] + CRM_Core_PseudoConstant::nestedGroup();
+    $groupElement = $this->add('select', 'group_id', ts('Select Group'), $group, TRUE, ['class' => 'crm-select2 huge']);
 
     CRM_Utils_System::setTitle(ts('Remove Contacts from Group'));
     $this->addDefaultButtons(ts('Remove from Group'));
@@ -58,7 +58,7 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task {
    *   the default array reference
    */
   public function setDefaultValues() {
-    $defaults = array();
+    $defaults = [];
 
     if ($this->get('context') === 'smog') {
       $defaults['group_id'] = $this->get('gid');
@@ -75,24 +75,24 @@ class CRM_Contact_Form_Task_RemoveFromGroup extends CRM_Contact_Form_Task {
 
     list($total, $removed, $notRemoved) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($this->_contactIds, $groupId);
 
-    $status = array(
-      ts("%count contact removed from '%2'", array(
+    $status = [
+      ts("%count contact removed from '%2'", [
         'count' => $removed,
         'plural' => "%count contacts removed from '%2'",
         2 => $group[$groupId],
-      )),
-    );
+      ]),
+    ];
     if ($notRemoved) {
-      $status[] = ts('1 contact was already not in this group', array(
-          'count' => $notRemoved,
-          'plural' => '%count contacts were already not in this group',
-        ));
+      $status[] = ts('1 contact was already not in this group', [
+        'count' => $notRemoved,
+        'plural' => '%count contacts were already not in this group',
+      ]);
     }
     $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
-    CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", array(
-          'plural' => "Removed Contacts From Group",
-          'count' => $removed,
-        )), 'success', array('expires' => 0));
+    CRM_Core_Session::setStatus($status, ts("Removed Contact From Group", [
+      'plural' => "Removed Contacts From Group",
+      'count' => $removed,
+    ]), 'success', ['expires' => 0]);
   }
 
 }