Merge pull request #14170 from mlutfy/cart-emails
[civicrm-core.git] / CRM / Core / SelectValues.php
index c467903aed1ab92bf711edcb46919a34eca3b9e8..18af287821b791be21296cfdbae67200d1eb63ab 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.                                    |
  |                                                                    |
@@ -31,7 +31,7 @@
  * smart caching scheme on a per domain basis
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  * $Id$
  *
  */
@@ -43,10 +43,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function boolean() {
-    return array(
+    return [
       1 => ts('Yes'),
       0 => ts('No'),
-    );
+    ];
   }
 
   /**
@@ -55,11 +55,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function pmf() {
-    return array(
+    return [
       'Both' => ts('Both'),
       'HTML' => ts('HTML'),
       'Text' => ts('Text'),
-    );
+    ];
   }
 
   /**
@@ -68,14 +68,14 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function privacy() {
-    return array(
+    return [
       'do_not_phone' => ts('Do not phone'),
       'do_not_email' => ts('Do not email'),
       'do_not_mail' => ts('Do not mail'),
       'do_not_sms' => ts('Do not sms'),
       'do_not_trade' => ts('Do not trade'),
       'is_opt_out' => ts('No bulk emails (User Opt Out)'),
-    );
+    ];
   }
 
   /**
@@ -98,11 +98,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function unitList($unitType = NULL) {
-    $unitList = array(
+    $unitList = [
       'day' => ts('day'),
       'month' => ts('month'),
       'year' => ts('year'),
-    );
+    ];
     if ($unitType == 'duration') {
       $unitList['lifetime'] = ts('lifetime');
     }
@@ -124,10 +124,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function periodType() {
-    return array(
+    return [
       'rolling' => ts('Rolling'),
       'fixed' => ts('Fixed'),
-    );
+    ];
   }
 
   /**
@@ -136,12 +136,12 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function emailSelectMethods() {
-    return array(
+    return [
       'automatic' => ts("Automatic"),
       'location-only' => ts("Only send to email addresses assigned to the specified location"),
       'location-prefer' => ts("Prefer email addresses assigned to the specified location"),
       'location-exclude' => ts("Exclude email addresses assigned to the specified location"),
-    );
+    ];
   }
 
   /**
@@ -150,10 +150,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function memberVisibility() {
-    return array(
+    return [
       'Public' => ts('Public'),
       'Admin' => ts('Admin'),
-    );
+    ];
   }
 
   /**
@@ -162,11 +162,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function memberAutoRenew() {
-    return array(
+    return [
       ts('No auto-renew option'),
       ts('Give option, but not required'),
       ts('Auto-renew required'),
-    );
+    ];
   }
 
   /**
@@ -175,11 +175,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function eventDate() {
-    return array(
+    return [
       'start_date' => ts('start date'),
       'end_date' => ts('end date'),
       'join_date' => ts('member since'),
-    );
+    ];
   }
 
   /**
@@ -188,7 +188,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function customHtmlType() {
-    return array(
+    return [
       'Text' => ts('Single-line input field (text or numeric)'),
       'TextArea' => ts('Multi-line text box (textarea)'),
       'Select' => ts('Drop-down (select list)'),
@@ -205,7 +205,7 @@ class CRM_Core_SelectValues {
       'Multi-Select' => ts('Multi-Select'),
       'Link' => ts('Link'),
       'ContactReference' => ts('Autocomplete-Select'),
-    );
+    ];
   }
 
   /**
@@ -215,7 +215,7 @@ class CRM_Core_SelectValues {
    *
    */
   public static function customGroupExtends() {
-    $customGroupExtends = array(
+    $customGroupExtends = [
       'Activity' => ts('Activities'),
       'Relationship' => ts('Relationships'),
       'Contribution' => ts('Contributions'),
@@ -231,9 +231,9 @@ class CRM_Core_SelectValues {
       'Grant' => ts('Grants'),
       'Address' => ts('Addresses'),
       'Campaign' => ts('Campaigns'),
-    );
+    ];
     $contactTypes = self::contactType();
-    $contactTypes = !empty($contactTypes) ? array('Contact' => 'Contacts') + $contactTypes : array();
+    $contactTypes = !empty($contactTypes) ? ['Contact' => 'Contacts'] + $contactTypes : [];
     $extendObjs = CRM_Core_OptionGroup::values('cg_extend_objects');
     $customGroupExtends = array_merge($contactTypes, $customGroupExtends, $extendObjs);
     return $customGroupExtends;
@@ -245,11 +245,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function customGroupStyle() {
-    return array(
+    return [
       'Tab' => ts('Tab'),
       'Inline' => ts('Inline'),
       'Tab with table' => ts('Tab with table'),
-    );
+    ];
   }
 
   /**
@@ -258,16 +258,16 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function ufGroupTypes() {
-    $ufGroupType = array(
+    $ufGroupType = [
       'Profile' => ts('Standalone Form or Directory'),
       'Search Profile' => ts('Search Views'),
-    );
+    ];
 
     if (CRM_Core_Config::singleton()->userSystem->supports_form_extensions) {
-      $ufGroupType += array(
+      $ufGroupType += [
         'User Registration' => ts('Drupal User Registration'),
         'User Account' => ts('View/Edit Drupal User Account'),
-      );
+      ];
     }
     return $ufGroupType;
   }
@@ -278,11 +278,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function groupContactStatus() {
-    return array(
+    return [
       'Added' => ts('Added'),
       'Removed' => ts('Removed'),
       'Pending' => ts('Pending'),
-    );
+    ];
   }
 
   /**
@@ -291,10 +291,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function groupType() {
-    return array(
+    return [
       'query' => ts('Dynamic'),
       'static' => ts('Static'),
-    );
+    ];
   }
 
   /**
@@ -306,17 +306,17 @@ class CRM_Core_SelectValues {
    *   date format (QF format)
    * @param null $minOffset
    * @param null $maxOffset
-   *
+   * @param string $context
    * @return array
    *   the date array
    */
   public static function date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL, $context = 'display') {
     // These options are deprecated. Definitely not used in datepicker. Possibly not even in jcalendar+addDateTime.
-    $date = array(
+    $date = [
       'addEmptyOption' => TRUE,
       'emptyOptionText' => ts('- select -'),
       'emptyOptionValue' => '',
-    );
+    ];
 
     if ($format) {
       $date['format'] = $format;
@@ -366,11 +366,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function ufVisibility() {
-    return array(
+    return [
       'User and User Admin Only' => ts('User and User Admin Only'),
       'Public Pages' => ts('Expose Publicly'),
       'Public Pages and Listings' => ts('Expose Publicly and for Listings'),
-    );
+    ];
   }
 
   /**
@@ -379,10 +379,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function groupVisibility() {
-    return array(
+    return [
       'User and User Admin Only' => ts('User and User Admin Only'),
       'Public Pages' => ts('Public Pages'),
-    );
+    ];
   }
 
   /**
@@ -391,7 +391,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function mailingComponents() {
-    return array(
+    return [
       'Header' => ts('Header'),
       'Footer' => ts('Footer'),
       'Reply' => ts('Reply Auto-responder'),
@@ -400,7 +400,7 @@ class CRM_Core_SelectValues {
       'Welcome' => ts('Welcome Message'),
       'Unsubscribe' => ts('Unsubscribe Message'),
       'Resubscribe' => ts('Resubscribe Message'),
-    );
+    ];
   }
 
   /**
@@ -409,7 +409,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public function getHours() {
-    $hours = array();
+    $hours = [];
     for ($i = 0; $i <= 6; $i++) {
       $hours[$i] = $i;
     }
@@ -422,7 +422,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public function getMinutes() {
-    $minutes = array();
+    $minutes = [];
     for ($i = 0; $i < 60; $i = $i + 15) {
       $minutes[$i] = $i;
     }
@@ -438,7 +438,7 @@ class CRM_Core_SelectValues {
   public static function mapProvider() {
     static $map = NULL;
     if (!$map) {
-      $map = array('' => '- select -') + CRM_Utils_System::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
+      $map = ['' => '- select -'] + CRM_Utils_System::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
     }
     return $map;
   }
@@ -452,7 +452,7 @@ class CRM_Core_SelectValues {
   public static function geoProvider() {
     static $geo = NULL;
     if (!$geo) {
-      $geo = array('' => '- select -') + CRM_Utils_System::getPluginList('CRM/Utils/Geocode');
+      $geo = ['' => '- select -'] + CRM_Utils_System::getPluginList('CRM/Utils/Geocode');
     }
     return $geo;
   }
@@ -466,7 +466,7 @@ class CRM_Core_SelectValues {
   public static function addressProvider() {
     static $addr = NULL;
     if (!$addr) {
-      $addr = array_merge(['' => '- select -'], CRM_Utils_System::getPluginList('CRM/Utils/Address', '.php', array('BatchUpdate')));
+      $addr = array_merge(['' => '- select -'], CRM_Utils_System::getPluginList('CRM/Utils/Address', '.php', ['BatchUpdate']));
     }
     return $addr;
   }
@@ -477,7 +477,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function mailingTokens() {
-    return array(
+    return [
       '{action.unsubscribe}' => ts('Unsubscribe via email'),
       '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'),
       '{action.resubscribe}' => ts('Resubscribe via email'),
@@ -494,7 +494,7 @@ class CRM_Core_SelectValues {
       '{mailing.name}' => ts('Mailing name'),
       '{mailing.group}' => ts('Mailing group'),
       '{mailing.viewUrl}' => ts('Mailing permalink'),
-    );
+    ];
   }
 
   /**
@@ -503,12 +503,12 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function activityTokens() {
-    return array(
+    return [
       '{activity.activity_id}' => ts('Activity ID'),
       '{activity.subject}' => ts('Activity Subject'),
       '{activity.details}' => ts('Activity Details'),
       '{activity.activity_date_time}' => ts('Activity Date Time'),
-    );
+    ];
   }
 
   /**
@@ -517,7 +517,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function membershipTokens() {
-    return array(
+    return [
       '{membership.id}' => ts('Membership ID'),
       '{membership.status}' => ts('Membership Status'),
       '{membership.type}' => ts('Membership Type'),
@@ -525,7 +525,7 @@ class CRM_Core_SelectValues {
       '{membership.join_date}' => ts('Membership Join Date'),
       '{membership.end_date}' => ts('Membership End Date'),
       '{membership.fee}' => ts('Membership Fee'),
-    );
+    ];
   }
 
   /**
@@ -534,7 +534,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function eventTokens() {
-    return array(
+    return [
       '{event.event_id}' => ts('Event ID'),
       '{event.title}' => ts('Event Title'),
       '{event.start_date}' => ts('Event Start Date'),
@@ -549,7 +549,7 @@ class CRM_Core_SelectValues {
       '{event.info_url}' => ts('Event Info URL'),
       '{event.registration_url}' => ts('Event Registration URL'),
       '{event.balance}' => ts('Event Balance'),
-    );
+    ];
   }
 
   /**
@@ -558,7 +558,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function contributionTokens() {
-    return array_merge(array(
+    return array_merge([
       '{contribution.contribution_id}' => ts('Contribution ID'),
       '{contribution.total_amount}' => ts('Total Amount'),
       '{contribution.fee_amount}' => ts('Fee Amount'),
@@ -582,7 +582,7 @@ class CRM_Core_SelectValues {
       //'{contribution.address_id}' => ts('Address ID'),
       '{contribution.check_number}' => ts('Check Number'),
       '{contribution.campaign}' => ts('Contribution Campaign'),
-    ), CRM_Utils_Token::getCustomFieldTokens('contribution', TRUE));
+    ], CRM_Utils_Token::getCustomFieldTokens('contribution', TRUE));
   }
 
   /**
@@ -593,17 +593,17 @@ class CRM_Core_SelectValues {
   public static function contactTokens() {
     static $tokens = NULL;
     if (!$tokens) {
-      $additionalFields = array(
-        'checksum' => array('title' => ts('Checksum')),
-        'contact_id' => array('title' => ts('Internal Contact ID')),
-      );
+      $additionalFields = [
+        'checksum' => ['title' => ts('Checksum')],
+        'contact_id' => ['title' => ts('Internal Contact ID')],
+      ];
       $exportFields = array_merge(CRM_Contact_BAO_Contact::exportableFields(), $additionalFields);
 
       $values = array_merge(array_keys($exportFields));
       unset($values[0]);
 
       //FIXME:skipping some tokens for time being.
-      $skipTokens = array(
+      $skipTokens = [
         'is_bulkmail',
         'group',
         'tag',
@@ -614,9 +614,9 @@ class CRM_Core_SelectValues {
         'legal_identifier',
         'contact_sub_type',
         'user_unique_id',
-      );
+      ];
 
-      $customFields = CRM_Core_BAO_CustomField::getFields(array('Individual', 'Address'));
+      $customFields = CRM_Core_BAO_CustomField::getFields(['Individual', 'Address']);
       $legacyTokenNames = array_flip(CRM_Utils_Token::legacyContactTokens());
 
       foreach ($values as $val) {
@@ -639,7 +639,7 @@ class CRM_Core_SelectValues {
       }
 
       // Get all the hook tokens too
-      $hookTokens = array();
+      $hookTokens = [];
       CRM_Utils_Hook::tokens($hookTokens);
       foreach ($hookTokens as $tokenValues) {
         foreach ($tokenValues as $key => $value) {
@@ -674,7 +674,7 @@ class CRM_Core_SelectValues {
       unset($values[0]);
 
       // skipping some tokens for time being.
-      $skipTokens = array(
+      $skipTokens = [
         'event_id',
         'participant_is_pay_later',
         'participant_is_test',
@@ -683,7 +683,7 @@ class CRM_Core_SelectValues {
         'participant_campaign_id',
         'participant_status',
         'participant_discount_name',
-      );
+      ];
 
       $customFields = CRM_Core_BAO_CustomField::getFields('Participant');
 
@@ -728,7 +728,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getDatePluginInputFormats() {
-    $dateInputFormats = array(
+    $dateInputFormats = [
       "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'),
       "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'),
       "yy-mm-dd" => ts('yyyy-mm-dd (2009-12-31)'),
@@ -744,7 +744,7 @@ class CRM_Core_SelectValues {
       "yy-mm" => ts('yyyy-mm (2009-12)'),
       'M yy' => ts('M yyyy (Dec 2009)'),
       "yy" => ts('yyyy (2009)'),
-    );
+    ];
 
     /*
     Year greater than 2000 get wrong result for following format
@@ -768,10 +768,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getTimeFormats() {
-    return array(
+    return [
       '1' => ts('12 Hours'),
       '2' => ts('24 Hours'),
-    );
+    ];
   }
 
   /**
@@ -783,7 +783,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getNumericOptions($start = 0, $end = 10) {
-    $numericOptions = array();
+    $numericOptions = [];
     for ($i = $start; $i <= $end; $i++) {
       $numericOptions[$i] = $i;
     }
@@ -796,10 +796,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getBarcodeTypes() {
-    return array(
+    return [
       'barcode' => ts('Linear (1D)'),
       'qrcode' => ts('QR code'),
-    );
+    ];
   }
 
   /**
@@ -808,11 +808,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getDedupeRuleTypes() {
-    return array(
+    return [
       'Unsupervised' => ts('Unsupervised'),
       'Supervised' => ts('Supervised'),
       'General' => ts('General'),
-    );
+    ];
   }
 
   /**
@@ -821,10 +821,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getCampaignGroupTypes() {
-    return array(
+    return [
       'Include' => ts('Include'),
       'Exclude' => ts('Exclude'),
-    );
+    ];
   }
 
   /**
@@ -833,12 +833,12 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getSubscriptionHistoryMethods() {
-    return array(
+    return [
       'Admin' => ts('Admin'),
       'Email' => ts('Email'),
       'Web' => ts('Web'),
       'API' => ts('API'),
-    );
+    ];
   }
 
   /**
@@ -847,12 +847,12 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getPremiumUnits() {
-    return array(
+    return [
       'day' => ts('Day'),
       'week' => ts('Week'),
       'month' => ts('Month'),
       'year' => ts('Year'),
-    );
+    ];
   }
 
   /**
@@ -861,13 +861,13 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getExtensionTypes() {
-    return array(
+    return [
       'payment' => ts('Payment'),
       'search' => ts('Search'),
       'report' => ts('Report'),
       'module' => ts('Module'),
       'sms' => ts('SMS'),
-    );
+    ];
   }
 
   /**
@@ -876,7 +876,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getJobFrequency() {
-    return array(
+    return [
       // CRM-17669
       'Yearly' => ts('Yearly'),
       'Quarter' => ts('Quarterly'),
@@ -886,7 +886,7 @@ class CRM_Core_SelectValues {
       'Daily' => ts('Daily'),
       'Hourly' => ts('Hourly'),
       'Always' => ts('Every time cron job is run'),
-    );
+    ];
   }
 
   /**
@@ -920,30 +920,29 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getProfileGroupType() {
-    $profileGroupType = array(
+    $profileGroupType = [
       'Activity' => ts('Activities'),
       'Contribution' => ts('Contributions'),
       'Membership' => ts('Memberships'),
       'Participant' => ts('Participants'),
-    );
+    ];
     $contactTypes = self::contactType();
-    $contactTypes = !empty($contactTypes) ? array('Contact' => 'Contacts') + $contactTypes : array();
+    $contactTypes = !empty($contactTypes) ? ['Contact' => 'Contacts'] + $contactTypes : [];
     $profileGroupType = array_merge($contactTypes, $profileGroupType);
 
     return $profileGroupType;
   }
 
-
   /**
    * Word replacement match type.
    *
    * @return array
    */
   public static function getWordReplacementMatchType() {
-    return array(
+    return [
       'exactMatch' => ts('Exact Match'),
       'wildcardMatch' => ts('Wildcard Match'),
-    );
+    ];
   }
 
   /**
@@ -952,11 +951,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getMailingGroupTypes() {
-    return array(
+    return [
       'Include' => ts('Include'),
       'Exclude' => ts('Exclude'),
       'Base' => ts('Base'),
-    );
+    ];
   }
 
   /**
@@ -965,35 +964,35 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getMailingJobStatus() {
-    return array(
+    return [
       'Scheduled' => ts('Scheduled'),
       'Running' => ts('Running'),
       'Complete' => ts('Complete'),
       'Paused' => ts('Paused'),
       'Canceled' => ts('Canceled'),
-    );
+    ];
   }
 
   /**
    * @return array
    */
   public static function billingMode() {
-    return array(
+    return [
       CRM_Core_Payment::BILLING_MODE_FORM => 'form',
       CRM_Core_Payment::BILLING_MODE_BUTTON => 'button',
       CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify',
-    );
+    ];
   }
 
   /**
    * @return array
    */
   public static function contributeMode() {
-    return array(
+    return [
       CRM_Core_Payment::BILLING_MODE_FORM => 'direct',
       CRM_Core_Payment::BILLING_MODE_BUTTON => 'directIPN',
       CRM_Core_Payment::BILLING_MODE_NOTIFY => 'notify',
-    );
+    ];
   }
 
   /**
@@ -1007,13 +1006,13 @@ class CRM_Core_SelectValues {
     // @todo this used to refer to the 'recur_frequency_unit' option_values which
     // is for recurring payments and probably not good to re-use for recurring entities.
     // If something other than a hard-coded list is desired, add a new option_group.
-    return array(
-      'hour' => ts('hour', array('plural' => 'hours', 'count' => $count)),
-      'day' => ts('day', array('plural' => 'days', 'count' => $count)),
-      'week' => ts('week', array('plural' => 'weeks', 'count' => $count)),
-      'month' => ts('month', array('plural' => 'months', 'count' => $count)),
-      'year' => ts('year', array('plural' => 'years', 'count' => $count)),
-    );
+    return [
+      'hour' => ts('hour', ['plural' => 'hours', 'count' => $count]),
+      'day' => ts('day', ['plural' => 'days', 'count' => $count]),
+      'week' => ts('week', ['plural' => 'weeks', 'count' => $count]),
+      'month' => ts('month', ['plural' => 'months', 'count' => $count]),
+      'year' => ts('year', ['plural' => 'years', 'count' => $count]),
+    ];
   }
 
   /**
@@ -1022,7 +1021,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getRelativeDateTerms() {
-    return array(
+    return [
       'previous' => ts('Previous'),
       'previous_2' => ts('Previous 2'),
       'previous_before' => ts('Prior to Previous'),
@@ -1038,7 +1037,7 @@ class CRM_Core_SelectValues {
       'starting' => ts('Upcoming'),
       'less' => ts('To End of'),
       'next' => ts('Next'),
-    );
+    ];
   }
 
   /**
@@ -1047,14 +1046,14 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getRelativeDateUnits() {
-    return array(
+    return [
       'year' => ts('Years'),
       'fiscal_year' => ts('Fiscal Years'),
       'quarter' => ts('Quarters'),
       'month' => ts('Months'),
       'week' => ts('Weeks'),
       'day' => ts('Days'),
-    );
+    ];
   }
 
   /**
@@ -1063,12 +1062,12 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function documentFormat() {
-    return array(
+    return [
       'pdf' => ts('Portable Document Format (.pdf)'),
       'docx' => ts('MS Word (.docx)'),
       'odt' => ts('Open Office (.odt)'),
       'html' => ts('Webpage (.html)'),
-    );
+    ];
   }
 
   /**
@@ -1077,10 +1076,10 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function documentApplicationType() {
-    return array(
+    return [
       'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
       'odt' => 'application/vnd.oasis.opendocument.text',
-    );
+    ];
   }
 
   /**
@@ -1089,11 +1088,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function activityTextOptions() {
-    return array(
+    return [
       2 => ts('Details Only'),
       3 => ts('Subject Only'),
       6 => ts('Both'),
-    );
+    ];
   }
 
   /**
@@ -1102,11 +1101,11 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function getPermissionedRelationshipOptions() {
-    return array(
+    return [
       CRM_Contact_BAO_Relationship::NONE => ts('None'),
       CRM_Contact_BAO_Relationship::VIEW => ts('View only'),
       CRM_Contact_BAO_Relationship::EDIT => ts('View and update'),
-    );
+    ];
   }
 
   /**
@@ -1130,7 +1129,7 @@ class CRM_Core_SelectValues {
    * @return array
    */
   public static function quicksearchOptions() {
-    $includeEmail = civicrm_api3('setting', 'getvalue', array('name' => 'includeEmailInName', 'group' => 'Search Preferences'));
+    $includeEmail = civicrm_api3('setting', 'getvalue', ['name' => 'includeEmailInName', 'group' => 'Search Preferences']);
     $options = [
       'sort_name' => $includeEmail ? ts('Name/Email') : ts('Name'),
       'contact_id' => ts('Contact ID'),