(NFC) Apply upcoming civicrm/coder policies (batch 1)
[civicrm-core.git] / CRM / ACL / Form / ACL.php
index b66122ea709bee930b26fb2c50c09d7fb10ea892..b119f7503aedd1435100bd42ade6a72267597037 100644 (file)
@@ -114,24 +114,24 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
 
     $this->add('text', 'name', ts('Description'), CRM_Core_DAO::getAttribute('CRM_ACL_DAO_ACL', 'name'), TRUE);
 
-    $operations = array('' => ts('- select -')) + CRM_ACL_BAO_ACL::operation();
+    $operations = ['' => ts('- select -')] + CRM_ACL_BAO_ACL::operation();
     $this->add('select',
       'operation',
       ts('Operation'),
       $operations, TRUE
     );
 
-    $objTypes = array(
+    $objTypes = [
       '1' => ts('A group of contacts'),
       '2' => ts('A profile'),
       '3' => ts('A set of custom data fields'),
-    );
+    ];
 
     if (CRM_Core_Permission::access('CiviEvent')) {
       $objTypes['4'] = ts('Events');
     }
 
-    $extra = array('onclick' => "showObjectSelect();");
+    $extra = ['onclick' => "showObjectSelect();"];
     $this->addRadio('object_type',
       ts('Type of Data'),
       $objTypes,
@@ -140,31 +140,31 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
     );
 
     $label = ts('Role');
-    $role = array(
+    $role = [
       '-1' => ts('- select role -'),
       '0' => ts('Everyone'),
-    ) + CRM_Core_OptionGroup::values('acl_role');
+    ] + CRM_Core_OptionGroup::values('acl_role');
     $this->add('select', 'entity_id', $label, $role, TRUE);
 
-    $group = array(
+    $group = [
       '-1' => ts('- select -'),
       '0' => ts('All Groups'),
-    ) + CRM_Core_PseudoConstant::group();
+    ] + CRM_Core_PseudoConstant::group();
 
-    $customGroup = array(
+    $customGroup = [
       '-1' => ts('- select -'),
       '0' => ts('All Custom Groups'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
+    ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
 
-    $ufGroup = array(
+    $ufGroup = [
       '-1' => ts('- select -'),
       '0' => ts('All Profiles'),
-    ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
+    ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
 
-    $event = array(
+    $event = [
       '-1' => ts('- select -'),
       '0' => ts('All Events'),
-    ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
+    ] + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
 
     $this->add('select', 'group_id', ts('Group'), $group);
     $this->add('select', 'custom_group_id', ts('Custom Data'), $customGroup);
@@ -173,7 +173,7 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
 
     $this->add('checkbox', 'is_active', ts('Enabled?'));
 
-    $this->addFormRule(array('CRM_ACL_Form_ACL', 'formRule'));
+    $this->addFormRule(['CRM_ACL_Form_ACL', 'formRule']);
   }
 
   /**
@@ -189,7 +189,7 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
       $errors['entity_id'] = ts('Please assign this permission to a Role.');
     }
 
-    $validOperations = array('View', 'Edit');
+    $validOperations = ['View', 'Edit'];
     $operationMessage = ts("Only 'View' and 'Edit' operations are valid for this type of data");
 
     // Figure out which type of object we're permissioning on and make sure user has selected a value.