Short array syntax - auto-convert api dir
authorColeman Watts <coleman@civicrm.org>
Thu, 28 Mar 2019 23:47:17 +0000 (19:47 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 28 Mar 2019 23:47:17 +0000 (19:47 -0400)
378 files changed:
api/Exception.php
api/api.php
api/class.api.php
api/v3/ActionSchedule.php
api/v3/Activity.php
api/v3/ActivityType.php
api/v3/Address.php
api/v3/Attachment.php
api/v3/Case.php
api/v3/CaseContact.php
api/v3/CaseType.php
api/v3/Constant.php
api/v3/ContactType.php
api/v3/Contribution.php
api/v3/ContributionPage.php
api/v3/ContributionRecur.php
api/v3/CustomField.php
api/v3/CustomGroup.php
api/v3/CustomSearch.php
api/v3/CustomValue.php
api/v3/Cxn.php
api/v3/CxnApp.php
api/v3/Dashboard.php
api/v3/DashboardContact.php
api/v3/Domain.php
api/v3/Entity.php
api/v3/EntityTag.php
api/v3/Event.php
api/v3/Extension.php
api/v3/File.php
api/v3/Generic.php
api/v3/Generic/Getactions.php
api/v3/Generic/Getlist.php
api/v3/Generic/Getunique.php
api/v3/Generic/Setvalue.php
api/v3/Generic/Update.php
api/v3/Grant.php
api/v3/Group.php
api/v3/GroupContact.php
api/v3/Job.php
api/v3/LocBlock.php
api/v3/Logging.php
api/v3/Mailing.php
api/v3/MailingAB.php
api/v3/MailingContact.php
api/v3/MailingEventConfirm.php
api/v3/MailingEventQueue.php
api/v3/MailingEventResubscribe.php
api/v3/MailingEventSubscribe.php
api/v3/MailingEventUnsubscribe.php
api/v3/MailingGroup.php
api/v3/Membership.php
api/v3/MembershipPayment.php
api/v3/MembershipStatus.php
api/v3/MembershipType.php
api/v3/MessageTemplate.php
api/v3/Navigation.php
api/v3/Note.php
api/v3/OptionGroup.php
api/v3/OptionValue.php
api/v3/Order.php
api/v3/Participant.php
api/v3/Payment.php
api/v3/PaymentProcessor.php
api/v3/Pledge.php
api/v3/PledgePayment.php
api/v3/Premium.php
api/v3/PriceFieldValue.php
api/v3/Profile.php
api/v3/RecurringEntity.php
api/v3/Relationship.php
api/v3/RelationshipType.php
api/v3/ReportInstance.php
api/v3/ReportTemplate.php
api/v3/SavedSearch.php
api/v3/Setting.php
api/v3/Survey.php
api/v3/SurveyRespondant.php
api/v3/System.php
api/v3/Tag.php
api/v3/UFField.php
api/v3/UFGroup.php
api/v3/User.php
api/v3/examples/Activity/ContactRefCustomField.php
api/v3/examples/Activity/ContactRefCustomFieldGet.php
api/v3/examples/Activity/Create.php
api/v3/examples/Activity/DateTimeHigh.php
api/v3/examples/Activity/DateTimeLow.php
api/v3/examples/Activity/Delete.php
api/v3/examples/Activity/Get.php
api/v3/examples/Activity/GetFields.php
api/v3/examples/Activity/GetTargetandAssignee.php
api/v3/examples/Activity/GetTargetandAssigneeName.php
api/v3/examples/Activity/ReturnAssigneeContact.php
api/v3/examples/ActivityContact/Create.php
api/v3/examples/ActivityContact/Delete.php
api/v3/examples/ActivityType/Create.php
api/v3/examples/ActivityType/Get.php
api/v3/examples/Address/AddressLike.php
api/v3/examples/Address/AddressParse.php
api/v3/examples/Address/AddressSort.php
api/v3/examples/Address/Create.php
api/v3/examples/Address/Delete.php
api/v3/examples/Address/Get.php
api/v3/examples/Address/GetOptions.php
api/v3/examples/Batch/Create.php
api/v3/examples/Batch/Delete.php
api/v3/examples/Batch/Get.php
api/v3/examples/Batch/Update.php
api/v3/examples/Campaign/Create.php
api/v3/examples/Campaign/Delete.php
api/v3/examples/Campaign/Get.php
api/v3/examples/Case/Create.php
api/v3/examples/CaseContact/Get.php
api/v3/examples/Constant/Get.php
api/v3/examples/Contact/APIChainedArray.php
api/v3/examples/Contact/APIChainedArrayFormats.php
api/v3/examples/Contact/APIChainedArrayMultipleCustom.php
api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
api/v3/examples/Contact/ChainTwoWebsites.php
api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php
api/v3/examples/Contact/ContactIDOfLoggedInUserContactAPI.php
api/v3/examples/Contact/Create.php
api/v3/examples/Contact/CreateParticipantPayment.php
api/v3/examples/Contact/CustomFieldGet.php
api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php
api/v3/examples/Contact/Delete.php
api/v3/examples/Contact/FormatIsSuccess_Fail.php
api/v3/examples/Contact/FormatIsSuccess_True.php
api/v3/examples/Contact/FormatOnlyID.php
api/v3/examples/Contact/FormatSingleValue.php
api/v3/examples/Contact/Get.php
api/v3/examples/Contact/GetActions.php
api/v3/examples/Contact/GetCountContact.php
api/v3/examples/Contact/GetFieldsOptions.php
api/v3/examples/Contact/GetOptions.php
api/v3/examples/Contact/GetSingleContact.php
api/v3/examples/Contact/GroupFilterUsingContactAPI.php
api/v3/examples/Contact/NestedReplaceEmail.php
api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.php
api/v3/examples/Contribution/ContributionCreateWithNote.php
api/v3/examples/Contribution/ContributionCreateWithSoftCredit.php
api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
api/v3/examples/Contribution/Create.php
api/v3/examples/Contribution/CreateWithNestedLineItems.php
api/v3/examples/Contribution/Delete.php
api/v3/examples/Contribution/Get.php
api/v3/examples/ContributionPage/Create.php
api/v3/examples/ContributionPage/Delete.php
api/v3/examples/ContributionPage/Get.php
api/v3/examples/ContributionPage/Submit.php
api/v3/examples/ContributionRecur/Create.php
api/v3/examples/ContributionRecur/Delete.php
api/v3/examples/ContributionRecur/Get.php
api/v3/examples/ContributionSoft/Create.php
api/v3/examples/ContributionSoft/Delete.php
api/v3/examples/ContributionSoft/Get.php
api/v3/examples/Country/Create.php
api/v3/examples/Country/Delete.php
api/v3/examples/Country/Get.php
api/v3/examples/CustomField/Create.php
api/v3/examples/CustomField/Delete.php
api/v3/examples/CustomGroup/Create.php
api/v3/examples/CustomGroup/Delete.php
api/v3/examples/CustomGroup/Get.php
api/v3/examples/CustomValue/Create.php
api/v3/examples/CustomValue/FormatFieldName.php
api/v3/examples/CustomValue/Get.php
api/v3/examples/Domain/Create.php
api/v3/examples/Domain/Get.php
api/v3/examples/Email/Create.php
api/v3/examples/Email/Delete.php
api/v3/examples/Email/Replace.php
api/v3/examples/EntityBatch/Create.php
api/v3/examples/EntityBatch/Delete.php
api/v3/examples/EntityBatch/Get.php
api/v3/examples/EntityTag/Create.php
api/v3/examples/EntityTag/Delete.php
api/v3/examples/EntityTag/Get.php
api/v3/examples/Event/ContactRefCustomField.php
api/v3/examples/Event/Create.php
api/v3/examples/Event/Delete.php
api/v3/examples/Event/Get.php
api/v3/examples/Event/IsCurrentOption.php
api/v3/examples/Event/IsFullOption.php
api/v3/examples/Grant/Create.php
api/v3/examples/Grant/Delete.php
api/v3/examples/Grant/Get.php
api/v3/examples/Group/Get.php
api/v3/examples/Group/GetFields.php
api/v3/examples/GroupContact/Create.php
api/v3/examples/GroupContact/Delete.php
api/v3/examples/GroupContact/Get.php
api/v3/examples/GroupContact/GetWithGroupID.php
api/v3/examples/GroupNesting/Create.php
api/v3/examples/GroupNesting/Delete.php
api/v3/examples/GroupNesting/Get.php
api/v3/examples/GroupOrganization/Create.php
api/v3/examples/GroupOrganization/Delete.php
api/v3/examples/GroupOrganization/Get.php
api/v3/examples/Im/Create.php
api/v3/examples/Im/Delete.php
api/v3/examples/Im/Get.php
api/v3/examples/Job/Create.php
api/v3/examples/Job/Delete.php
api/v3/examples/LineItem/Create.php
api/v3/examples/LineItem/Delete.php
api/v3/examples/LineItem/Get.php
api/v3/examples/LocBlock/Create.php
api/v3/examples/LocBlock/CreateEntities.php
api/v3/examples/LocBlock/Get.php
api/v3/examples/Logging/Get.php
api/v3/examples/Logging/Revert.php
api/v3/examples/MailSettings/ChainedGetDelete.php
api/v3/examples/MailSettings/Create.php
api/v3/examples/MailSettings/Delete.php
api/v3/examples/MailSettings/Get.php
api/v3/examples/MailSettings/GetOptions.php
api/v3/examples/Mailing/Clone.php
api/v3/examples/Mailing/Create.php
api/v3/examples/Mailing/Delete.php
api/v3/examples/Mailing/GetTokens.php
api/v3/examples/Mailing/Submit.php
api/v3/examples/MailingAB/Create.php
api/v3/examples/MailingEventSubscribe/Create.php
api/v3/examples/MailingGroup/Subscribe.php
api/v3/examples/Mapping/Create.php
api/v3/examples/Mapping/Delete.php
api/v3/examples/Mapping/Get.php
api/v3/examples/MappingField/Create.php
api/v3/examples/MappingField/Delete.php
api/v3/examples/MappingField/Get.php
api/v3/examples/Membership/Create.php
api/v3/examples/Membership/CreateWithCustomData.php
api/v3/examples/Membership/Delete.php
api/v3/examples/Membership/FilterIsCurrent.php
api/v3/examples/Membership/Get.php
api/v3/examples/Membership/SearchWithCustomData.php
api/v3/examples/Membership/UpdateCustomData.php
api/v3/examples/MembershipPayment/Create.php
api/v3/examples/MembershipPayment/Get.php
api/v3/examples/MembershipStatus/Create.php
api/v3/examples/MembershipStatus/Get.php
api/v3/examples/MembershipType/Create.php
api/v3/examples/MembershipType/Delete.php
api/v3/examples/MembershipType/Get.php
api/v3/examples/MessageTemplate/Create.php
api/v3/examples/MessageTemplate/Delete.php
api/v3/examples/MessageTemplate/Get.php
api/v3/examples/Note/Create.php
api/v3/examples/Note/Delete.php
api/v3/examples/Note/Get.php
api/v3/examples/OpenID/Create.php
api/v3/examples/OpenID/Delete.php
api/v3/examples/OpenID/Get.php
api/v3/examples/OptionGroup/Create.php
api/v3/examples/OptionGroup/Delete.php
api/v3/examples/OptionGroup/Get.php
api/v3/examples/OptionValue/Get.php
api/v3/examples/OptionValue/SortOption.php
api/v3/examples/Order/Cancel.php
api/v3/examples/Order/Create.php
api/v3/examples/Order/CreateOrderParticipant.php
api/v3/examples/Order/Delete.php
api/v3/examples/Order/Get.php
api/v3/examples/Participant/Create.php
api/v3/examples/Participant/Get.php
api/v3/examples/Participant/NestedDelete.php
api/v3/examples/Participant/NestedEventGet.php
api/v3/examples/ParticipantPayment/Create.php
api/v3/examples/ParticipantPayment/Delete.php
api/v3/examples/ParticipantPayment/Get.php
api/v3/examples/ParticipantStatusType/Create.php
api/v3/examples/ParticipantStatusType/Delete.php
api/v3/examples/ParticipantStatusType/Get.php
api/v3/examples/Payment/Cancel.php
api/v3/examples/Payment/Create.php
api/v3/examples/Payment/CreatePaymentWithLineItems.php
api/v3/examples/Payment/Delete.php
api/v3/examples/Payment/Get.php
api/v3/examples/Payment/UpdatePayment.php
api/v3/examples/PaymentProcessor/Create.php
api/v3/examples/PaymentProcessor/Delete.php
api/v3/examples/PaymentProcessorType/Create.php
api/v3/examples/PaymentProcessorType/Delete.php
api/v3/examples/PaymentToken/Create.php
api/v3/examples/PaymentToken/Delete.php
api/v3/examples/PaymentToken/Get.php
api/v3/examples/Pcp/Create.php
api/v3/examples/Phone/Create.php
api/v3/examples/Phone/Delete.php
api/v3/examples/Phone/Get.php
api/v3/examples/Phone/GetOptions.php
api/v3/examples/Pledge/Create.php
api/v3/examples/Pledge/Delete.php
api/v3/examples/Pledge/Get.php
api/v3/examples/Pledge/GetFilterHighDate.php
api/v3/examples/PledgePayment/Create.php
api/v3/examples/PledgePayment/Delete.php
api/v3/examples/PledgePayment/Get.php
api/v3/examples/PledgePayment/Update.php
api/v3/examples/PriceField/Create.php
api/v3/examples/PriceField/Delete.php
api/v3/examples/PriceField/Get.php
api/v3/examples/PriceFieldValue/Create.php
api/v3/examples/PriceFieldValue/Delete.php
api/v3/examples/PriceFieldValue/Get.php
api/v3/examples/PriceSet/Create.php
api/v3/examples/PriceSet/Delete.php
api/v3/examples/PriceSet/Get.php
api/v3/examples/Profile/Apply.php
api/v3/examples/Profile/Get.php
api/v3/examples/Profile/GetFields.php
api/v3/examples/Profile/Submit.php
api/v3/examples/Relationship/BetweenRelationshipType.php
api/v3/examples/Relationship/Create.php
api/v3/examples/Relationship/Delete.php
api/v3/examples/Relationship/Get.php
api/v3/examples/Relationship/INRelationshipType.php
api/v3/examples/Relationship/NotBetweenRelationshipType.php
api/v3/examples/Relationship/NotInRelationshipType.php
api/v3/examples/Relationship/filterIsCurrent.php
api/v3/examples/RelationshipType/Create.php
api/v3/examples/RelationshipType/Delete.php
api/v3/examples/ReportTemplate/Getrows.php
api/v3/examples/ReportTemplate/Getstatistics.php
api/v3/examples/SavedSearch/Create.php
api/v3/examples/SavedSearch/Delete.php
api/v3/examples/SavedSearch/Get.php
api/v3/examples/Setting/Create.php
api/v3/examples/Setting/CreateAllDomains.php
api/v3/examples/Setting/CreateSettingCurrentDomain.php
api/v3/examples/Setting/CreateSpecifiedDomains.php
api/v3/examples/Setting/Get.php
api/v3/examples/Setting/GetAllDomains.php
api/v3/examples/Setting/GetDefaults.php
api/v3/examples/Setting/GetFields.php
api/v3/examples/Setting/GetSettingCurrentDomain.php
api/v3/examples/Setting/GetSpecifiedDomains.php
api/v3/examples/Setting/GetValue.php
api/v3/examples/Setting/Revert.php
api/v3/examples/StateProvince/Create.php
api/v3/examples/StateProvince/Delete.php
api/v3/examples/StateProvince/Get.php
api/v3/examples/StatusPreference/Create.php
api/v3/examples/StatusPreference/Delete.php
api/v3/examples/StatusPreference/Get.php
api/v3/examples/Survey/ChainedGetDelete.php
api/v3/examples/Survey/Create.php
api/v3/examples/Survey/Delete.php
api/v3/examples/Survey/Get.php
api/v3/examples/SurveyRespondant/Get.php
api/v3/examples/System/Flush.php
api/v3/examples/Tag/Create.php
api/v3/examples/Tag/Delete.php
api/v3/examples/Tag/Get.php
api/v3/examples/Tag/GetFields.php
api/v3/examples/Tag/GetList.php
api/v3/examples/Tag/GetReturnArray.php
api/v3/examples/TaxContributionPage/Create.php
api/v3/examples/TaxContributionPage/CreateWithNestedLineItems.php
api/v3/examples/TaxContributionPage/Delete.php
api/v3/examples/UFField/Create.php
api/v3/examples/UFField/Delete.php
api/v3/examples/UFField/Get.php
api/v3/examples/UFField/Replace.php
api/v3/examples/UFGroup/Create.php
api/v3/examples/UFGroup/Delete.php
api/v3/examples/UFGroup/Get.php
api/v3/examples/UFJoin/Create.php
api/v3/examples/UFJoin/Get.php
api/v3/examples/UFMatch/Get.php
api/v3/examples/Website/Create.php
api/v3/examples/Website/Delete.php
api/v3/examples/Website/Get.php
api/v3/examples/Website/GetFields.php
api/v3/examples/Website/GetWithMetadata.php
api/v3/utils.php

index 1db0ae564fce3532996a0743b993b2ba76370194..6e968b3071cc5c1e438ba7cc9c5342db5fd36630 100644 (file)
@@ -20,7 +20,7 @@ class API_Exception extends Exception {
   const UNAUTHORIZED = 'unauthorized';
   const NOT_IMPLEMENTED = 'not-found';
 
-  private $extraParams = array();
+  private $extraParams = [];
 
   /**
    * Class constructor.
@@ -37,7 +37,7 @@ class API_Exception extends Exception {
    * @param Exception|NULL $previous
    *   A previous exception which caused this new exception.
    */
-  public function __construct($message, $error_code = 0, $extraParams = array(), Exception $previous = NULL) {
+  public function __construct($message, $error_code = 0, $extraParams = [], Exception $previous = NULL) {
     // Using int for error code "old way") ?
     if (is_numeric($error_code)) {
       $code = $error_code;
@@ -46,7 +46,7 @@ class API_Exception extends Exception {
       $code = 0;
     }
     parent::__construct(ts($message), $code, $previous);
-    $this->extraParams = $extraParams + array('error_code' => $error_code);
+    $this->extraParams = $extraParams + ['error_code' => $error_code];
   }
 
   /**
@@ -73,13 +73,13 @@ class API_Exception extends Exception {
    * @return array
    */
   public function getErrorCodes() {
-    return array(
+    return [
       2000 => '$params was not an array',
       2001 => 'Invalid Value for Date field',
       2100 => 'String value is longer than permitted length',
       self::UNAUTHORIZED => 'Unauthorized',
       self::NOT_IMPLEMENTED => 'Entity or method is not implemented',
-    );
+    ];
   }
 
 }
@@ -89,7 +89,7 @@ class API_Exception extends Exception {
  * API_Exception from the api wrapper as the namespace is more generic
  */
 class CiviCRM_API3_Exception extends Exception {
-  private $extraParams = array();
+  private $extraParams = [];
 
   /**
    * Class constructor.
@@ -106,9 +106,9 @@ class CiviCRM_API3_Exception extends Exception {
    * @param Exception|NULL $previous
    *   A previous exception which caused this new exception.
    */
-  public function __construct($message, $error_code = 0, $extraParams = array(), Exception $previous = NULL) {
+  public function __construct($message, $error_code = 0, $extraParams = [], Exception $previous = NULL) {
     parent::__construct(ts($message));
-    $this->extraParams = $extraParams + array('error_code' => $error_code);
+    $this->extraParams = $extraParams + ['error_code' => $error_code];
   }
 
   /**
index 04b0421bcbb213757ab02e81d11882094e97e891..9b1a00941d1d670bfd82deb72f25bf29c4d6bdf5 100644 (file)
@@ -38,7 +38,7 @@ function civicrm_api($entity, $action, $params, $extra = NULL) {
  * @throws CiviCRM_API3_Exception
  * @return array
  */
-function civicrm_api3($entity, $action, $params = array()) {
+function civicrm_api3($entity, $action, $params = []) {
   $params['version'] = 3;
   $result = \Civi::service('civi_api_kernel')->runSafe($entity, $action, $params);
   if (is_array($result) && !empty($result['is_error'])) {
@@ -73,9 +73,9 @@ function _civicrm_api3_api_getfields(&$apiRequest) {
       //  $apiRequest['params']['action'] = $apiRequest['params']['api_action'];
       // unset($apiRequest['params']['api_action']);
     }
-    return array('action' => array('api.aliases' => array('api_action')));
+    return ['action' => ['api.aliases' => ['api_action']]];
   }
-  $getFieldsParams = array('action' => $apiRequest['action']);
+  $getFieldsParams = ['action' => $apiRequest['action']];
   $entity = $apiRequest['entity'];
   if ($entity == 'Profile' && array_key_exists('profile_id', $apiRequest['params'])) {
     $getFieldsParams['profile_id'] = $apiRequest['params']['profile_id'];
index 88d9b2116596c52bb40f898c97552faea70bdf26..3e93b97a586b61c37b8e4254b5c9270c70fea061 100644 (file)
@@ -85,8 +85,8 @@ class civicrm_api3 {
    */
   public function __construct($config = NULL) {
     $this->local      = TRUE;
-    $this->input      = array();
-    $this->lastResult = array();
+    $this->input      = [];
+    $this->lastResult = [];
     if (isset($config) && isset($config['server'])) {
       // we are calling a remote server via REST
       $this->local = FALSE;
@@ -164,13 +164,13 @@ class civicrm_api3 {
    *
    * @return \stdClass
    */
-  private function remoteCall($entity, $action, $params = array()) {
+  private function remoteCall($entity, $action, $params = []) {
     $query = $this->uri . "?entity=$entity&action=$action";
-    $fields = http_build_query(array(
+    $fields = http_build_query([
       'key' => $this->key,
       'api_key' => $this->api_key,
       'json' => json_encode($params),
-    ));
+    ]);
 
     if (function_exists('curl_init')) {
       // To facilitate debugging without leaking info, entity & action
@@ -187,7 +187,7 @@ class civicrm_api3 {
         $res->is_error = 1;
         $res->error_message = curl_error($ch);
         $res->level = "cURL";
-        $res->error = array('cURL error' => curl_error($ch));
+        $res->error = ['cURL error' => curl_error($ch)];
         return $res;
       }
       curl_close($ch);
@@ -202,7 +202,7 @@ class civicrm_api3 {
       $res->is_error = 1;
       $res->error_message = 'Unable to parse returned JSON';
       $res->level = 'json_decode';
-      $res->error = array('Unable to parse returned JSON' => $result);
+      $res->error = ['Unable to parse returned JSON' => $result];
       $res->row_result = $result;
     }
     return $res;
@@ -217,9 +217,9 @@ class civicrm_api3 {
    *
    * @return bool
    */
-  private function call($entity, $action = 'Get', $params = array()) {
+  private function call($entity, $action = 'Get', $params = []) {
     if (is_int($params)) {
-      $params = array('id' => $params);
+      $params = ['id' => $params];
     }
     elseif (is_string($params)) {
       $params = json_decode($params);
@@ -240,7 +240,7 @@ class civicrm_api3 {
       $this->lastResult = json_decode(json_encode(civicrm_api($entity, $action, $params)));
     }
     // Reset the input to be ready for a new call.
-    $this->input = array();
+    $this->input = [];
     if (property_exists($this->lastResult, 'is_error')) {
       return !$this->lastResult->is_error;
     }
index 03b11a4290c2709a7595c16f81fc0de1548cfc31..d7f6e263f6a827aa7ee981239b1df8fa140b354e 100644 (file)
@@ -52,7 +52,7 @@ function civicrm_api3_action_schedule_get($params) {
  * @return array
  */
 function civicrm_api3_action_schedule_create($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array('start_action_date', 'absolute_date'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['start_action_date', 'absolute_date']);
   if (!array_key_exists('name', $params) && !array_key_exists('id', $params)) {
     $params['name'] = CRM_Utils_String::munge($params['title']);
   }
index f7a8e492f13c0d38d0d27edec7430615e90f09cd..5fa7492538e79da7d6b05bf5552df35b71da1f7e 100644 (file)
@@ -49,11 +49,11 @@ function civicrm_api3_activity_create($params) {
     // an update does not require any mandatory parameters
     civicrm_api3_verify_one_mandatory($params,
       NULL,
-      array(
+      [
         'activity_name',
         'activity_type_id',
         'activity_label',
-      )
+      ]
     );
   }
 
@@ -69,7 +69,7 @@ function civicrm_api3_activity_create($params) {
   }
 
   // processing for custom data
-  $values = $activityArray = array();
+  $values = $activityArray = [];
   _civicrm_api3_custom_format_params($params, $values, 'Activity');
 
   if (!empty($values['custom'])) {
@@ -85,7 +85,7 @@ function civicrm_api3_activity_create($params) {
   // this handling should all be moved to the BAO layer
   $case_id = '';
   $createRevision = FALSE;
-  $oldActivityValues = array();
+  $oldActivityValues = [];
   // Lookup case id if not supplied
   if (!isset($params['case_id']) && !empty($params['id'])) {
     $params['case_id'] = CRM_Core_DAO::singleValueQuery("SELECT case_id FROM civicrm_case_activity WHERE activity_id = " . (int) $params['id']);
@@ -93,7 +93,7 @@ function civicrm_api3_activity_create($params) {
   if (!empty($params['case_id'])) {
     $case_id = $params['case_id'];
     if (!empty($params['id']) && Civi::settings()->get('civicaseActivityRevisions')) {
-      $oldActivityParams = array('id' => $params['id']);
+      $oldActivityParams = ['id' => $params['id']];
       if (!$oldActivityValues) {
         CRM_Activity_BAO_Activity::retrieve($oldActivityParams, $oldActivityValues);
       }
@@ -159,7 +159,7 @@ function civicrm_api3_activity_create($params) {
     if ($case_id && $isNew && !$createRevision) {
       // If this is a brand new case activity, add to case(s)
       foreach ((array) $case_id as $singleCaseId) {
-        $caseActivityParams = array('activity_id' => $activityBAO->id, 'case_id' => $singleCaseId);
+        $caseActivityParams = ['activity_id' => $activityBAO->id, 'case_id' => $singleCaseId];
         CRM_Case_BAO_Case::processCaseActivity($caseActivityParams);
       }
     }
@@ -180,26 +180,26 @@ function civicrm_api3_activity_create($params) {
  */
 function _civicrm_api3_activity_create_spec(&$params) {
 
-  $params['status_id']['api.aliases'] = array('activity_status');
+  $params['status_id']['api.aliases'] = ['activity_status'];
 
-  $params['assignee_contact_id'] = array(
+  $params['assignee_contact_id'] = [
     'name' => 'assignee_id',
     'title' => 'Activity Assignee',
     'description' => 'Contact(s) assigned to this activity.',
     'type' => 1,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
-  $params['target_contact_id'] = array(
+  ];
+  $params['target_contact_id'] = [
     'name' => 'target_id',
     'title' => 'Activity Target',
     'description' => 'Contact(s) participating in this activity.',
     'type' => 1,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
+  ];
 
-  $params['source_contact_id'] = array(
+  $params['source_contact_id'] = [
     'name' => 'source_contact_id',
     'title' => 'Activity Source Contact',
     'description' => 'Person who created this activity. Defaults to current user.',
@@ -208,16 +208,16 @@ function _civicrm_api3_activity_create_spec(&$params) {
     'api.default' => 'user_contact_id',
     'FKApiName' => 'Contact',
     'api.required' => TRUE,
-  );
+  ];
 
-  $params['case_id'] = array(
+  $params['case_id'] = [
     'name' => 'case_id',
     'title' => 'Case ID',
     'description' => 'For creating an activity as part of a case.',
     'type' => 1,
     'FKClassName' => 'CRM_Case_DAO_Case',
     'FKApiName' => 'Case',
-  );
+  ];
 
 }
 
@@ -227,62 +227,62 @@ function _civicrm_api3_activity_create_spec(&$params) {
  * @param array $params
  */
 function _civicrm_api3_activity_get_spec(&$params) {
-  $params['tag_id'] = array(
+  $params['tag_id'] = [
     'title' => 'Tags',
     'description' => 'Find activities with specified tags.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Core_DAO_Tag',
     'FKApiName' => 'Tag',
     'supports_joins' => TRUE,
-  );
-  $params['file_id'] = array(
+  ];
+  $params['file_id'] = [
     'title' => 'Attached Files',
     'description' => 'Find activities with attached files.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Core_DAO_File',
     'FKApiName' => 'File',
-  );
-  $params['case_id'] = array(
+  ];
+  $params['case_id'] = [
     'title' => 'Cases',
     'description' => 'Find activities within specified cases.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Case_DAO_Case',
     'FKApiName' => 'Case',
     'supports_joins' => TRUE,
-  );
-  $params['contact_id'] = array(
+  ];
+  $params['contact_id'] = [
     'title' => 'Activity Contact ID',
     'description' => 'Find activities involving this contact (as target, source, OR assignee).',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
-  $params['target_contact_id'] = array(
+  ];
+  $params['target_contact_id'] = [
     'title' => 'Target Contact ID',
     'description' => 'Find activities with specified target contact.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
-  $params['source_contact_id'] = array(
+  ];
+  $params['source_contact_id'] = [
     'title' => 'Source Contact ID',
     'description' => 'Find activities with specified source contact.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
-  $params['assignee_contact_id'] = array(
+  ];
+  $params['assignee_contact_id'] = [
     'title' => 'Assignee Contact ID',
     'description' => 'Find activities with specified assignee contact.',
     'type' => CRM_Utils_Type::T_INT,
     'FKClassName' => 'CRM_Contact_DAO_Contact',
     'FKApiName' => 'Contact',
-  );
-  $params['is_overdue'] = array(
+  ];
+  $params['is_overdue'] = [
     'title' => 'Is Activity Overdue',
     'description' => 'Incomplete activities with a past date.',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -347,21 +347,21 @@ function civicrm_api3_activity_get($params) {
  */
 function _civicrm_api3_activity_get_extraFilters(&$params, &$sql) {
   // Filter by activity contacts
-  $activityContactOptions = array(
+  $activityContactOptions = [
     'contact_id' => NULL,
     'target_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Targets'),
     'source_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'),
     'assignee_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Assignees'),
-  );
+  ];
   foreach ($activityContactOptions as $activityContactName => $activityContactValue) {
     if (!empty($params[$activityContactName])) {
       if (!is_array($params[$activityContactName])) {
-        $params[$activityContactName] = array('=' => $params[$activityContactName]);
+        $params[$activityContactName] = ['=' => $params[$activityContactName]];
       }
       $clause = \CRM_Core_DAO::createSQLFilter('contact_id', $params[$activityContactName]);
       $typeClause = $activityContactValue ? 'record_type_id = #typeId AND ' : '';
       $sql->where("a.id IN (SELECT activity_id FROM civicrm_activity_contact WHERE $typeClause !clause)",
-        array('#typeId' => $activityContactValue, '!clause' => $clause)
+        ['#typeId' => $activityContactValue, '!clause' => $clause]
       );
     }
   }
@@ -383,41 +383,41 @@ function _civicrm_api3_activity_get_extraFilters(&$params, &$sql) {
   // Subqueries are nice in (a) avoiding duplicates and (b) when the result
   // list is expected to be bite-sized. Joins are nice (a) with larger
   // datasets and (b) checking for non-existent relations.
-  $rels = array(
-    'tag_id' => array(
+  $rels = [
+    'tag_id' => [
       'subquery' => 'a.id IN (SELECT entity_id FROM civicrm_entity_tag WHERE entity_table = "civicrm_activity" AND !clause)',
       'join' => '!joinType civicrm_entity_tag !alias ON (!alias.entity_table = "civicrm_activity" AND !alias.entity_id = a.id)',
       'column' => 'tag_id',
-    ),
-    'file_id' => array(
+    ],
+    'file_id' => [
       'subquery' => 'a.id IN (SELECT entity_id FROM civicrm_entity_file WHERE entity_table = "civicrm_activity" AND !clause)',
       'join' => '!joinType civicrm_entity_file !alias ON (!alias.entity_table = "civicrm_activity" AND !alias.entity_id = a.id)',
       'column' => 'file_id',
-    ),
-    'case_id' => array(
+    ],
+    'case_id' => [
       'subquery' => 'a.id IN (SELECT activity_id FROM civicrm_case_activity WHERE !clause)',
       'join' => '!joinType civicrm_case_activity !alias ON (!alias.activity_id = a.id)',
       'column' => 'case_id',
-    ),
-  );
+    ],
+  ];
   foreach ($rels as $filter => $relSpec) {
     if (!empty($params[$filter])) {
       if (!is_array($params[$filter])) {
-        $params[$filter] = array('=' => $params[$filter]);
+        $params[$filter] = ['=' => $params[$filter]];
       }
       // $mode is one of ('LEFT JOIN', 'INNER JOIN', 'SUBQUERY')
       $mode = isset($params[$filter]['IS NULL']) ? 'LEFT JOIN' : 'SUBQUERY';
       if ($mode === 'SUBQUERY') {
         $clause = \CRM_Core_DAO::createSQLFilter($relSpec['column'], $params[$filter]);
         if ($clause) {
-          $sql->where($relSpec['subquery'], array('!clause' => $clause));
+          $sql->where($relSpec['subquery'], ['!clause' => $clause]);
         }
       }
       else {
         $alias = 'actjoin_' . $filter;
         $clause = \CRM_Core_DAO::createSQLFilter($alias . "." . $relSpec['column'], $params[$filter]);
         if ($clause) {
-          $sql->join($alias, $relSpec['join'], array('!alias' => $alias, 'joinType' => $mode));
+          $sql->join($alias, $relSpec['join'], ['!alias' => $alias, 'joinType' => $mode]);
           $sql->where($clause);
         }
       }
@@ -455,8 +455,8 @@ function _civicrm_api3_activity_get_formatResult($params, $activities, $options)
 
   _civicrm_api3_activity_fill_activity_contact_names($activities, $params, $returns);
 
-  $tagGet = array('tag_id', 'entity_id');
-  $caseGet = $caseIds = array();
+  $tagGet = ['tag_id', 'entity_id'];
+  $caseGet = $caseIds = [];
   foreach (array_keys($returns) as $key) {
     if (strpos($key, 'tag_id.') === 0) {
       $tagGet[] = $key;
@@ -482,12 +482,12 @@ function _civicrm_api3_activity_get_formatResult($params, $activities, $options)
         break;
 
       case 'tag_id':
-        $tags = civicrm_api3('EntityTag', 'get', array(
+        $tags = civicrm_api3('EntityTag', 'get', [
           'entity_table' => 'civicrm_activity',
-          'entity_id' => array('IN' => array_keys($activities)),
+          'entity_id' => ['IN' => array_keys($activities)],
           'return' => $tagGet,
-          'options' => array('limit' => 0),
-        ));
+          'options' => ['limit' => 0],
+        ]);
         foreach ($tags['values'] as $tag) {
           $key = (int) $tag['entity_id'];
           unset($tag['entity_id'], $tag['id']);
@@ -497,7 +497,7 @@ function _civicrm_api3_activity_get_formatResult($params, $activities, $options)
 
       case 'file_id':
         $dao = CRM_Core_DAO::executeQuery("SELECT entity_id, file_id FROM civicrm_entity_file WHERE entity_table = 'civicrm_activity' AND entity_id IN (%1)",
-          array(1 => array(implode(',', array_keys($activities)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES)));
+          [1 => [implode(',', array_keys($activities)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES]]);
         while ($dao->fetch()) {
           $activities[$dao->entity_id]['file_id'][] = $dao->file_id;
         }
@@ -505,7 +505,7 @@ function _civicrm_api3_activity_get_formatResult($params, $activities, $options)
 
       case 'case_id':
         $dao = CRM_Core_DAO::executeQuery("SELECT activity_id, case_id FROM civicrm_case_activity WHERE activity_id IN (%1)",
-          array(1 => array(implode(',', array_keys($activities)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES)));
+          [1 => [implode(',', array_keys($activities)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES]]);
         while ($dao->fetch()) {
           $activities[$dao->activity_id]['case_id'][] = $dao->case_id;
           $caseIds[$dao->case_id] = $dao->case_id;
@@ -528,12 +528,12 @@ function _civicrm_api3_activity_get_formatResult($params, $activities, $options)
   // Fetch case fields via the join syntax
   // Note this is limited to the first case if the activity belongs to more than one
   if ($caseGet && $caseIds) {
-    $cases = civicrm_api3('Case', 'get', array(
-      'id' => array('IN' => $caseIds),
-      'options' => array('limit' => 0),
+    $cases = civicrm_api3('Case', 'get', [
+      'id' => ['IN' => $caseIds],
+      'options' => ['limit' => 0],
       'check_permissions' => !empty($params['check_permissions']),
       'return' => $caseGet,
-    ));
+    ]);
     foreach ($activities as &$activity) {
       if (!empty($activity['case_id'])) {
         $case = CRM_Utils_Array::value($activity['case_id'][0], $cases['values']);
@@ -665,11 +665,11 @@ function civicrm_api3_activity_delete($params) {
  *   array with errors
  */
 function _civicrm_api3_activity_check_params(&$params) {
-  $activityIds = array(
+  $activityIds = [
     'activity' => CRM_Utils_Array::value('id', $params),
     'parent' => CRM_Utils_Array::value('parent_id', $params),
     'original' => CRM_Utils_Array::value('original_id', $params),
-  );
+  ];
 
   foreach ($activityIds as $id => $value) {
     if ($value &&
@@ -735,18 +735,18 @@ function _civicrm_api3_activity_check_params(&$params) {
  *   API request.
  */
 function _civicrm_api3_activity_getlist_params(&$request) {
-  $fieldsToReturn = array(
+  $fieldsToReturn = [
     'activity_date_time',
     'activity_type_id',
     'subject',
     'source_contact_id',
-  );
+  ];
   $request['params']['return'] = array_unique(array_merge($fieldsToReturn, $request['extra']));
   $request['params']['options']['sort'] = 'activity_date_time DESC';
-  $request['params'] += array(
+  $request['params'] += [
     'is_current_revision' => 1,
     'is_deleted' => 0,
-  );
+  ];
 }
 
 /**
@@ -760,29 +760,29 @@ function _civicrm_api3_activity_getlist_params(&$request) {
  * @return array
  */
 function _civicrm_api3_activity_getlist_output($result, $request) {
-  $output = array();
+  $output = [];
   if (!empty($result['values'])) {
     foreach ($result['values'] as $row) {
-      $data = array(
+      $data = [
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']] ? $row[$request['label_field']] : ts('(no subject)'),
-        'description' => array(
+        'description' => [
           CRM_Core_Pseudoconstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $row['activity_type_id']),
-        ),
-      );
+        ],
+      ];
       if (!empty($row['activity_date_time'])) {
         $data['description'][0] .= ': ' . CRM_Utils_Date::customFormat($row['activity_date_time']);
       }
       if (!empty($row['source_contact_id'])) {
-        $data['description'][] = ts('By %1', array(
+        $data['description'][] = ts('By %1', [
           1 => CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['source_contact_id'], 'display_name'),
-        ));
+        ]);
       }
       // Add repeating info
       $repeat = CRM_Core_BAO_RecurringEntity::getPositionAndCount($row['id'], 'civicrm_activity');
       $data['extra']['is_recur'] = FALSE;
       if ($repeat) {
-        $data['suffix'] = ts('(%1 of %2)', array(1 => $repeat[0], 2 => $repeat[1]));
+        $data['suffix'] = ts('(%1 of %2)', [1 => $repeat[0], 2 => $repeat[1]]);
         $data['extra']['is_recur'] = TRUE;
       }
       $output[] = $data;
index 48e6c5ed7c62187e0bac6a0f6947f2e0882ad14f..fcbfa30a5aab9646648fc1cf5e5fc534ebdd21c1 100644 (file)
@@ -78,7 +78,7 @@ function civicrm_api3_activity_type_create($params) {
   }
 
   $activityObject = CRM_Core_OptionValue::addOptionValue($params, 'activity_type', $action, $optionValueID);
-  $activityType = array();
+  $activityType = [];
   _civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id]);
   return civicrm_api3_create_success($activityType, $params, 'activity_type', 'create');
 }
@@ -92,16 +92,16 @@ function civicrm_api3_activity_type_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_activity_type_create_spec(&$params) {
-  $params['label'] = array(
+  $params['label'] = [
     'api.required' => 1,
     'title' => 'Label',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['weight'] = array(
+  ];
+  $params['weight'] = [
     'api.required' => 1,
     'title' => 'Weight',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
 
 /**
index ac1cb25e0701e09a9877a8d25b604e2173bf36f4..c480aee939893ce505cade71c1e6bd19ae7d5513 100644 (file)
@@ -103,28 +103,28 @@ function civicrm_api3_address_create(&$params) {
 function _civicrm_api3_address_create_spec(&$params) {
   $params['location_type_id']['api.required'] = 1;
   $params['contact_id']['api.required'] = 1;
-  $params['street_parsing'] = array(
+  $params['street_parsing'] = [
     'title' => 'Street Address Parsing',
     'description' => 'Optional param to indicate you want the street_address field parsed into individual params',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['skip_geocode'] = array(
+  ];
+  $params['skip_geocode'] = [
     'title' => 'Skip geocode',
     'description' => 'Optional param to indicate you want to skip geocoding (useful when importing a lot of addresses
       at once, the job \'Geocode and Parse Addresses\' can execute this task after the import)',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['fix_address'] = array(
+  ];
+  $params['fix_address'] = [
     'title' => ts('Fix address'),
     'description' => ts('When true, apply various fixes to the address before insert. Default true.'),
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'api.default' => TRUE,
-  );
-  $params['world_region'] = array(
+  ];
+  $params['world_region'] = [
     'title' => ts('World Region'),
     'name' => 'world_region',
     'type' => CRM_Utils_Type::T_TEXT,
-  );
+  ];
 }
 
 /**
@@ -134,11 +134,11 @@ function _civicrm_api3_address_create_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_address_get_spec(&$params) {
-  $params['world_region'] = array(
+  $params['world_region'] = [
     'title' => ts('World Region'),
     'name' => 'world_region',
     'type' => CRM_Utils_Type::T_TEXT,
-  );
+  ];
 }
 
 /**
index a96a35886dbb01f392df9f541924ce6a33b7cfc0..ea4c42e4dad74dda30230fc7d59877d9437ea557 100644 (file)
@@ -107,7 +107,7 @@ function _civicrm_api3_attachment_create_spec(&$spec) {
 function civicrm_api3_attachment_create($params) {
   if (empty($params['id'])) {
     // When creating we need either entity_table or field_name.
-    civicrm_api3_verify_one_mandatory($params, NULL, array('entity_table', 'field_name'));
+    civicrm_api3_verify_one_mandatory($params, NULL, ['entity_table', 'field_name']);
   }
 
   $config = CRM_Core_Config::singleton();
@@ -139,7 +139,7 @@ function civicrm_api3_attachment_create($params) {
     throw new API_Exception("'content' and 'options.move-file' are mutually exclusive");
   }
   if ($id && !$isTrusted && isset($file['upload_date']) && $file['upload_date'] != CRM_Utils_Date::isoToMysql($fileDao->upload_date)) {
-    throw new API_Exception("Cannot modify upload_date" . var_export(array($file['upload_date'], $fileDao->upload_date, CRM_Utils_Date::isoToMysql($fileDao->upload_date)), TRUE));
+    throw new API_Exception("Cannot modify upload_date" . var_export([$file['upload_date'], $fileDao->upload_date, CRM_Utils_Date::isoToMysql($fileDao->upload_date)], TRUE));
   }
   if ($id && $name && $name != CRM_Utils_File::cleanFileName($fileDao->uri)) {
     throw new API_Exception("Cannot modify name");
@@ -168,15 +168,15 @@ function civicrm_api3_attachment_create($params) {
 
   // Save custom field to entity
   if (!$id && empty($params['entity_table']) && isset($params['field_name'])) {
-    civicrm_api3('custom_value', 'create', array(
+    civicrm_api3('custom_value', 'create', [
       'entity_id' => $params['entity_id'],
       $params['field_name'] => $fileDao->id,
-    ));
+    ]);
   }
 
-  $result = array(
+  $result = [
     $fileDao->id => _civicrm_api3_attachment_format_result($fileDao, $entityFileDao, $returnContent, $isTrusted),
-  );
+  ];
   return civicrm_api3_create_success($result, $params, 'Attachment', 'create');
 }
 
@@ -203,7 +203,7 @@ function civicrm_api3_attachment_get($params) {
   list($id, $file, $entityFile, $name, $content, $moveFile, $isTrusted, $returnContent) = _civicrm_api3_attachment_parse_params($params);
 
   $dao = __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTrusted);
-  $result = array();
+  $result = [];
   while ($dao->fetch()) {
     $result[$dao->id] = _civicrm_api3_attachment_format_result($dao, $dao, $returnContent, $isTrusted);
   }
@@ -247,8 +247,8 @@ function civicrm_api3_attachment_delete($params) {
   list($id, $file, $entityFile, $name, $content, $moveFile, $isTrusted, $returnContent) = _civicrm_api3_attachment_parse_params($params);
   $dao = __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTrusted);
 
-  $filePaths = array();
-  $fileIds = array();
+  $filePaths = [];
+  $fileIds = [];
   while ($dao->fetch()) {
     $filePaths[] = $config->customFileUploadDir . DIRECTORY_SEPARATOR . $dao->uri;
     $fileIds[] = $dao->id;
@@ -267,7 +267,7 @@ function civicrm_api3_attachment_delete($params) {
     }
   }
 
-  $result = array();
+  $result = [];
   return civicrm_api3_create_success($result, $params, 'Attachment', 'create');
 }
 
@@ -286,7 +286,7 @@ function civicrm_api3_attachment_delete($params) {
  * @throws API_Exception
  */
 function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTrusted) {
-  foreach (array('name', 'content', 'path', 'url') as $unsupportedFilter) {
+  foreach (['name', 'content', 'path', 'url'] as $unsupportedFilter) {
     if (!empty($params[$unsupportedFilter])) {
       throw new API_Exception("Get by $unsupportedFilter is not currently supported");
     }
@@ -294,7 +294,7 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru
 
   $select = CRM_Utils_SQL_Select::from('civicrm_file cf')
     ->join('cef', 'INNER JOIN civicrm_entity_file cef ON cf.id = cef.file_id')
-    ->select(array(
+    ->select([
       'cf.id',
       'cf.uri',
       'cf.mime_type',
@@ -303,24 +303,24 @@ function __civicrm_api3_attachment_find($params, $id, $file, $entityFile, $isTru
       'cf.created_id',
       'cef.entity_table',
       'cef.entity_id',
-    ));
+    ]);
 
   if ($id) {
-    $select->where('cf.id = #id', array('#id' => $id));
+    $select->where('cf.id = #id', ['#id' => $id]);
   }
   // Recall: $file is filtered by parse_params.
   foreach ($file as $key => $value) {
-    $select->where('cf.!field = @value', array(
+    $select->where('cf.!field = @value', [
       '!field' => $key,
       '@value' => $value,
-    ));
+    ]);
   }
   // Recall: $entityFile is filtered by parse_params.
   foreach ($entityFile as $key => $value) {
-    $select->where('cef.!field = @value', array(
+    $select->where('cef.!field = @value', [
       '!field' => $key,
       '@value' => $value,
-    ));
+    ]);
   }
   if (!$isTrusted) {
     // FIXME ACLs: Add any JOIN or WHERE clauses needed to enforce access-controls for the target entity.
@@ -357,15 +357,15 @@ function _civicrm_api3_attachment_parse_params($params) {
     throw new API_Exception("Malformed id");
   }
 
-  $file = array();
-  foreach (array('mime_type', 'description', 'upload_date') as $field) {
+  $file = [];
+  foreach (['mime_type', 'description', 'upload_date'] as $field) {
     if (array_key_exists($field, $params)) {
       $file[$field] = $params[$field];
     }
   }
 
-  $entityFile = array();
-  foreach (array('entity_table', 'entity_id') as $field) {
+  $entityFile = [];
+  foreach (['entity_table', 'entity_id'] as $field) {
     if (array_key_exists($field, $params)) {
       $entityFile[$field] = $params[$field];
     }
@@ -399,11 +399,11 @@ function _civicrm_api3_attachment_parse_params($params) {
 
   $isTrusted = empty($params['check_permissions']);
 
-  $returns = isset($params['return']) ? $params['return'] : array();
-  $returns = is_array($returns) ? $returns : array($returns);
+  $returns = isset($params['return']) ? $params['return'] : [];
+  $returns = is_array($returns) ? $returns : [$returns];
   $returnContent = in_array('content', $returns);
 
-  return array($id, $file, $entityFile, $name, $content, $moveFile, $isTrusted, $returnContent);
+  return [$id, $file, $entityFile, $name, $content, $moveFile, $isTrusted, $returnContent];
 }
 
 /**
@@ -424,7 +424,7 @@ function _civicrm_api3_attachment_format_result($fileDao, $entityFileDao, $retur
   $config = CRM_Core_Config::singleton();
   $path = $config->customFileUploadDir . DIRECTORY_SEPARATOR . $fileDao->uri;
 
-  $result = array(
+  $result = [
     'id' => $fileDao->id,
     'name' => CRM_Utils_File::cleanFileName($fileDao->uri),
     'mime_type' => $fileDao->mime_type,
@@ -434,7 +434,7 @@ function _civicrm_api3_attachment_format_result($fileDao, $entityFileDao, $retur
     'entity_id' => $entityFileDao->entity_id,
     'icon' => CRM_Utils_File::getIconFromMimeType($fileDao->mime_type),
     'created_id' => $fileDao->created_id,
-  );
+  ];
   $fileHash = CRM_Core_BAO_File::generateFileHash($result['entity_id'], $result['id']);
   $result['url'] = CRM_Utils_System::url(
     'civicrm/file', 'reset=1&id=' . $result['id'] . '&eid=' . $result['entity_id'] . '&fcs=' . $fileHash,
@@ -462,18 +462,18 @@ function _civicrm_api3_attachment_getfields() {
   $fileFields = CRM_Core_DAO_File::fields();
   $entityFileFields = CRM_Core_DAO_EntityFile::fields();
 
-  $spec = array();
+  $spec = [];
   $spec['id'] = $fileFields['id'];
-  $spec['name'] = array(
+  $spec['name'] = [
     'title' => 'Name (write-once)',
     'description' => 'The logical file name (not searchable)',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['field_name'] = array(
+  ];
+  $spec['field_name'] = [
     'title' => 'Field Name (write-once)',
     'description' => 'Alternative to "entity_table" param - sets custom field value.',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
   $spec['mime_type'] = $fileFields['mime_type'];
   $spec['description'] = $fileFields['description'];
   $spec['upload_date'] = $fileFields['upload_date'];
@@ -482,26 +482,26 @@ function _civicrm_api3_attachment_getfields() {
   $spec['entity_table']['title'] = CRM_Utils_Array::value('title', $spec['entity_table'], 'Entity Table') . ' (write-once)';
   $spec['entity_id'] = $entityFileFields['entity_id'];
   $spec['entity_id']['title'] = CRM_Utils_Array::value('title', $spec['entity_id'], 'Entity ID') . ' (write-once)'; // would be hard to securely handle changes
-  $spec['url'] = array(
+  $spec['url'] = [
     'title' => 'URL (read-only)',
     'description' => 'URL for downloading the file (not searchable, expire-able)',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['path'] = array(
+  ];
+  $spec['path'] = [
     'title' => 'Path (read-only)',
     'description' => 'Local file path (not searchable, local-only)',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['content'] = array(
+  ];
+  $spec['content'] = [
     'title' => 'Content',
     'description' => 'File content (not searchable, not returned by default)',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['created_id'] = array(
+  ];
+  $spec['created_id'] = [
     'title' => 'Created By Contact ID',
     'type' => CRM_Utils_Type::T_INT,
     'description' => 'FK to civicrm_contact, who uploaded this file',
-  );
+  ];
 
   return $spec;
 }
index bbfeeb2b0cc73ebcf802cd16fa1bc2ff0eec6ea9..312c8ba64218df652c6d929e35c9f34c70eec1e0 100644 (file)
@@ -66,11 +66,11 @@ function civicrm_api3_case_create($params) {
 
   if (empty($params['id'])) {
     // Creating a new case, so make sure we have the necessary parameters
-    civicrm_api3_verify_mandatory($params, NULL, array(
+    civicrm_api3_verify_mandatory($params, NULL, [
         'contact_id',
         'subject',
-        array('case_type', 'case_type_id'),
-      )
+        ['case_type', 'case_type_id'],
+      ]
     );
   }
   else {
@@ -82,7 +82,7 @@ function civicrm_api3_case_create($params) {
       throw new API_Exception('You cannot update creator id');
     }
 
-    $mergedCaseIds = $origContactIds = array();
+    $mergedCaseIds = $origContactIds = [];
 
     // If a contact ID is specified we need to make sure this is the main contact ID for the case (and update if necessary)
     if (!empty($params['contact_id'])) {
@@ -127,7 +127,7 @@ function civicrm_api3_case_create($params) {
 
   if (isset($params['contact_id']) && !isset($params['id'])) {
     foreach ((array) $params['contact_id'] as $cid) {
-      $contactParams = array('case_id' => $caseBAO->id, 'contact_id' => $cid);
+      $contactParams = ['case_id' => $caseBAO->id, 'contact_id' => $cid];
       CRM_Case_BAO_CaseContact::create($contactParams);
     }
   }
@@ -139,7 +139,7 @@ function civicrm_api3_case_create($params) {
   }
 
   // return case
-  $values = array();
+  $values = [];
   _civicrm_api3_object_to_array($caseBAO, $values[$caseBAO->id]);
 
   return civicrm_api3_create_success($values, $params, 'Case', 'create', $caseBAO);
@@ -162,7 +162,7 @@ function _civicrm_api3_case_create_xmlProcessor($params, $caseBAO) {
 
   // Initialize XML processor with $params
   $xmlProcessor = new CRM_Case_XMLProcessor_Process();
-  $xmlProcessorParams = array(
+  $xmlProcessorParams = [
     'clientID' => CRM_Utils_Array::value('contact_id', $params),
     'creatorID' => CRM_Utils_Array::value('creator_id', $params),
     'standardTimeline' => 1,
@@ -174,9 +174,9 @@ function _civicrm_api3_case_create_xmlProcessor($params, $caseBAO) {
     'duration' => CRM_Utils_Array::value('duration', $params),
     'medium_id' => CRM_Utils_Array::value('medium_id', $params),
     'details' => CRM_Utils_Array::value('details', $params),
-    'custom' => array(),
+    'custom' => [],
     'relationship_end_date' => CRM_Utils_Array::value('end_date', $params),
-  );
+  ];
 
   // Do it! :-D
   $xmlProcessor->run($params['case_type'], $xmlProcessorParams);
@@ -189,25 +189,25 @@ function _civicrm_api3_case_create_xmlProcessor($params, $caseBAO) {
  *   Parameters determined by getfields.
  */
 function _civicrm_api3_case_get_spec(&$params) {
-  $params['contact_id'] = array(
-    'api.aliases' => array('client_id'),
+  $params['contact_id'] = [
+    'api.aliases' => ['client_id'],
     'title' => 'Case Client',
     'description' => 'Contact id of one or more clients to retrieve cases for',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['activity_id'] = array(
+  ];
+  $params['activity_id'] = [
     'title' => 'Case Activity',
     'description' => 'Id of an activity in the case',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['tag_id'] = array(
+  ];
+  $params['tag_id'] = [
     'title' => 'Tags',
     'description' => 'Find cases with specified tags.',
     'type' => 1,
     'FKClassName' => 'CRM_Core_DAO_Tag',
     'FKApiName' => 'Tag',
     'supports_joins' => TRUE,
-  );
+  ];
 }
 
 /**
@@ -217,25 +217,25 @@ function _civicrm_api3_case_get_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_case_create_spec(&$params) {
-  $params['contact_id'] = array(
-    'api.aliases' => array('client_id'),
+  $params['contact_id'] = [
+    'api.aliases' => ['client_id'],
     'title' => 'Case Client',
     'description' => 'Contact id of case client(s)',
     'api.required' => 1,
     'type' => CRM_Utils_Type::T_INT,
     'FKApiName' => 'Contact',
-  );
+  ];
   $params['status_id']['api.default'] = 1;
-  $params['status_id']['api.aliases'] = array('case_status');
+  $params['status_id']['api.aliases'] = ['case_status'];
   $params['creator_id']['api.default'] = 'user_contact_id';
   $params['creator_id']['type'] = CRM_Utils_Type::T_INT;
   $params['creator_id']['title'] = 'Case Created By';
   $params['start_date']['api.default'] = 'now';
-  $params['medium_id'] = array(
+  $params['medium_id'] = [
     'name' => 'medium_id',
     'title' => 'Activity Medium',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
@@ -289,11 +289,11 @@ function civicrm_api3_case_get($params, $sql = NULL) {
     if (is_array($params['contact_id'])) {
       $operator = CRM_Utils_Array::first(array_keys($params['contact_id']));
       if (!in_array($operator, \CRM_Core_DAO::acceptedSQLOperators(), TRUE)) {
-        $params['contact_id'] = array('IN' => $params['contact_id']);
+        $params['contact_id'] = ['IN' => $params['contact_id']];
       }
     }
     else {
-      $params['contact_id'] = array('=' => $params['contact_id']);
+      $params['contact_id'] = ['=' => $params['contact_id']];
     }
     $clause = CRM_Core_DAO::createSQLFilter('contact_id', $params['contact_id']);
     $sql->where("a.id IN (SELECT case_id FROM civicrm_case_contact WHERE $clause)");
@@ -345,27 +345,27 @@ function civicrm_api3_case_get($params, $sql = NULL) {
 
   // Clause to search by tag
   if (!empty($params['tag_id'])) {
-    $dummySpec = array();
+    $dummySpec = [];
     _civicrm_api3_validate_integer($params, 'tag_id', $dummySpec, 'Case');
     if (!is_array($params['tag_id'])) {
-      $params['tag_id'] = array('=' => $params['tag_id']);
+      $params['tag_id'] = ['=' => $params['tag_id']];
     }
     $clause = \CRM_Core_DAO::createSQLFilter('tag_id', $params['tag_id']);
     if ($clause) {
-      $sql->where('a.id IN (SELECT entity_id FROM civicrm_entity_tag WHERE entity_table = "civicrm_case" AND !clause)', array('!clause' => $clause));
+      $sql->where('a.id IN (SELECT entity_id FROM civicrm_entity_tag WHERE entity_table = "civicrm_case" AND !clause)', ['!clause' => $clause]);
     }
   }
 
-  $cases = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), array('sequential' => 0) + $params, TRUE, 'Case', $sql);
+  $cases = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), ['sequential' => 0] + $params, TRUE, 'Case', $sql);
 
   if (empty($options['is_count']) && !empty($cases['values'])) {
     // For historic reasons we return these by default only when fetching a case by id
     if (!empty($params['id']) && is_numeric($params['id']) && empty($options['return'])) {
-      $options['return'] = array(
+      $options['return'] = [
         'contacts' => 1,
         'activities' => 1,
         'contact_id' => 1,
-      );
+      ];
     }
 
     _civicrm_api3_case_read($cases['values'], $options);
@@ -391,9 +391,9 @@ function civicrm_api3_case_get($params, $sql = NULL) {
  */
 function civicrm_api3_case_activity_create($params) {
   require_once "api/v3/Activity.php";
-  return civicrm_api3_activity_create($params) + array(
+  return civicrm_api3_activity_create($params) + [
     'deprecated' => CRM_Utils_Array::value('activity_create', _civicrm_api3_case_deprecation()),
-  );
+  ];
 }
 
 /**
@@ -407,7 +407,7 @@ function civicrm_api3_case_activity_create($params) {
 function civicrm_api3_case_addtimeline($params) {
   $caseType = CRM_Case_BAO_Case::getCaseType($params['case_id'], 'name');
   $xmlProcessor = new CRM_Case_XMLProcessor_Process();
-  $xmlProcessorParams = array(
+  $xmlProcessorParams = [
     'clientID' => CRM_Case_BAO_Case::getCaseClients($params['case_id']),
     'creatorID' => $params['creator_id'],
     'standardTimeline' => 0,
@@ -415,7 +415,7 @@ function civicrm_api3_case_addtimeline($params) {
     'caseID' => $params['case_id'],
     'caseType' => $caseType,
     'activitySetName' => $params['timeline'],
-  );
+  ];
   $xmlProcessor->run($caseType, $xmlProcessorParams);
   return civicrm_api3_create_success();
 }
@@ -427,30 +427,30 @@ function civicrm_api3_case_addtimeline($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_case_addtimeline_spec(&$params) {
-  $params['case_id'] = array(
+  $params['case_id'] = [
     'title' => 'Case ID',
     'description' => 'Id of case to update',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => 1,
-  );
-  $params['timeline'] = array(
+  ];
+  $params['timeline'] = [
     'title' => 'Timeline',
     'description' => 'Name of activity set',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => 1,
-  );
-  $params['activity_date_time'] = array(
+  ];
+  $params['activity_date_time'] = [
     'api.default' => 'now',
     'title' => 'Activity date time',
     'description' => 'Timeline start date',
     'type' => CRM_Utils_Type::T_DATE,
-  );
-  $params['creator_id'] = array(
+  ];
+  $params['creator_id'] = [
     'api.default' => 'user_contact_id',
     'title' => 'Activity creator',
     'description' => 'Contact id of timeline creator',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
@@ -475,18 +475,18 @@ function civicrm_api3_case_merge($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_case_merge_spec(&$params) {
-  $params['case_id_1'] = array(
+  $params['case_id_1'] = [
     'title' => 'Case ID 1',
     'description' => 'Id of main case',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => 1,
-  );
-  $params['case_id_2'] = array(
+  ];
+  $params['case_id_2'] = [
     'title' => 'Case ID 2',
     'description' => 'Id of second case',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => 1,
-  );
+  ];
 }
 
 /**
@@ -497,7 +497,7 @@ function _civicrm_api3_case_merge_spec(&$params) {
  *   Array of deprecated actions
  */
 function _civicrm_api3_case_deprecation() {
-  return array('activity_create' => 'Case api "activity_create" action is deprecated. Use the activity api instead.');
+  return ['activity_create' => 'Case api "activity_create" action is deprecated. Use the activity api instead.'];
 }
 
 /**
@@ -522,14 +522,14 @@ function civicrm_api3_case_update($params) {
   }
 
   //check parameters
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
 
   // return error if modifying creator id
   if (array_key_exists('creator_id', $params)) {
     throw new API_Exception(ts('You cannot update creator id'));
   }
 
-  $mCaseId = $origContactIds = array();
+  $mCaseId = $origContactIds = [];
 
   // get original contact id and creator id of case
   if (!empty($params['contact_id'])) {
@@ -563,10 +563,10 @@ function civicrm_api3_case_update($params) {
   $dao->copyValues($params);
   $dao->save();
 
-  $case = array();
+  $case = [];
   _civicrm_api3_object_to_array($dao, $case);
 
-  return civicrm_api3_create_success(array($dao->id => $case), $params, 'Case', 'update', $dao);
+  return civicrm_api3_create_success([$dao->id => $case], $params, 'Case', 'update', $dao);
 }
 
 /**
@@ -587,7 +587,7 @@ function civicrm_api3_case_update($params) {
  */
 function civicrm_api3_case_delete($params) {
   //check parameters
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
 
   if (CRM_Case_BAO_Case::deleteCase($params['id'], CRM_Utils_Array::value('move_to_trash', $params, FALSE))) {
     return civicrm_api3_create_success($params, $params, 'Case', 'delete');
@@ -604,8 +604,8 @@ function civicrm_api3_case_delete($params) {
  * @return void
  */
 function _civicrm_api3_case_restore_spec(&$spec) {
-  $result = civicrm_api3('Case', 'getfields', array('api_action' => 'delete'));
-  $spec = array('id' => $result['values']['id']);
+  $result = civicrm_api3('Case', 'getfields', ['api_action' => 'delete']);
+  $spec = ['id' => $result['values']['id']];
 }
 
 /**
@@ -646,7 +646,7 @@ function _civicrm_api3_case_read(&$cases, $options) {
     }
     if (!empty($options['return']['activities'])) {
       // add case activities array - we'll populate them in bulk below
-      $case['activities'] = array();
+      $case['activities'] = [];
     }
     // Properly render this joined field
     if (!empty($options['return']['case_type_id.definition'])) {
@@ -658,7 +658,7 @@ function _civicrm_api3_case_read(&$cases, $options) {
         $caseTypeName = !empty($case['case_type_id.name']) ? $case['case_type_id.name'] : CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseTypeId, 'name');
         $xml = CRM_Case_XMLRepository::singleton()->retrieve($caseTypeName);
       }
-      $case['case_type_id.definition'] = array();
+      $case['case_type_id.definition'] = [];
       if ($xml) {
         $case['case_type_id.definition'] = CRM_Case_BAO_CaseType::convertXmlToDefinition($xml);
       }
@@ -667,14 +667,14 @@ function _civicrm_api3_case_read(&$cases, $options) {
   // Bulk-load activities
   if (!empty($options['return']['activities'])) {
     $query = "SELECT case_id, activity_id FROM civicrm_case_activity WHERE case_id IN (%1)";
-    $params = array(1 => array(implode(',', array_keys($cases)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES));
+    $params = [1 => [implode(',', array_keys($cases)), 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES]];
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     while ($dao->fetch()) {
       $cases[$dao->case_id]['activities'][] = $dao->activity_id;
     }
   }
   // Bulk-load tags. Supports joins onto the tag entity.
-  $tagGet = array('tag_id', 'entity_id');
+  $tagGet = ['tag_id', 'entity_id'];
   foreach (array_keys($options['return']) as $key) {
     if (strpos($key, 'tag_id.') === 0) {
       $tagGet[] = $key;
@@ -682,12 +682,12 @@ function _civicrm_api3_case_read(&$cases, $options) {
     }
   }
   if (!empty($options['return']['tag_id'])) {
-    $tags = civicrm_api3('EntityTag', 'get', array(
+    $tags = civicrm_api3('EntityTag', 'get', [
       'entity_table' => 'civicrm_case',
-      'entity_id' => array('IN' => array_keys($cases)),
+      'entity_id' => ['IN' => array_keys($cases)],
       'return' => $tagGet,
-      'options' => array('limit' => 0),
-    ));
+      'options' => ['limit' => 0],
+    ]);
     foreach ($tags['values'] as $tag) {
       $key = (int) $tag['entity_id'];
       unset($tag['entity_id'], $tag['id']);
@@ -703,7 +703,7 @@ function _civicrm_api3_case_read(&$cases, $options) {
  */
 function _civicrm_api3_case_format_params(&$params) {
   // Format/include custom params
-  $values = array();
+  $values = [];
   _civicrm_api3_custom_format_params($params, $values, 'Case');
   $params = array_merge($params, $values);
 
@@ -711,7 +711,7 @@ function _civicrm_api3_case_format_params(&$params) {
   // Convert single value to array here to simplify processing in later functions which expect an array.
   if (isset($params['contact_id'])) {
     if (!is_array($params['contact_id'])) {
-      $params['contact_id'] = array($params['contact_id']);
+      $params['contact_id'] = [$params['contact_id']];
     }
   }
 
@@ -758,24 +758,24 @@ function civicrm_api3_case_getList($params) {
   require_once 'api/v3/CaseContact.php';
   //CRM:19956 - Assign case_id param if both id and case_id is passed to retrieve the case
   if (!empty($params['id']) && !empty($params['params']) && !empty($params['params']['case_id'])) {
-    $params['params']['case_id'] = array('IN' => $params['id']);
+    $params['params']['case_id'] = ['IN' => $params['id']];
     unset($params['id']);
   }
   $params['id_field'] = 'case_id';
   $params['label_field'] = $params['search_field'] = 'contact_id.sort_name';
-  $params['description_field'] = array(
+  $params['description_field'] = [
     'case_id',
     'case_id.case_type_id.title',
     'case_id.subject',
     'case_id.status_id',
     'case_id.start_date',
-  );
-  $apiRequest = array(
+  ];
+  $apiRequest = [
     'version' => 3,
     'entity' => 'CaseContact',
     'action' => 'getlist',
     'params' => $params,
-  );
+  ];
   return civicrm_api3_generic_getList($apiRequest);
 }
 
index 1d2cbbb856eedc9fc619f7e1fdc8b7833db4bd7e..7cd9ecf6690ceebd7234d6a1f7a430305e5f9632 100644 (file)
@@ -84,19 +84,19 @@ function civicrm_api3_case_contact_delete($params) {
  * @return array
  */
 function _civicrm_api3_case_contact_getlist_output($result, $request, $entity, $fields) {
-  $output = array();
+  $output = [];
   if (!empty($result['values'])) {
     foreach ($result['values'] as $row) {
-      $data = array(
+      $data = [
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']] . ' - ' . $row['case_id.case_type_id.title'],
-      );
+      ];
       $status = CRM_Core_PseudoConstant::getLabel('CRM_Case_BAO_Case', 'status_id', $row['case_id.status_id']);
       $date = CRM_Utils_Date::customFormat($row['case_id.start_date']);
-      $data['description'] = array(
-        "#{$row['case_id']}: $status " . ts('(opened %1)', array(1 => $date)),
+      $data['description'] = [
+        "#{$row['case_id']}: $status " . ts('(opened %1)', [1 => $date]),
         $row['case_id.subject'],
-      );
+      ];
       if (!empty($request['image_field'])) {
         $data['image'] = isset($row[$request['image_field']]) ? $row[$request['image_field']] : '';
       }
index 68505fb754a78e6e3f8c24db67af97958acfe464..155caba2a58aaa87021c1cc754920ac96e8e4671 100644 (file)
@@ -88,17 +88,17 @@ function civicrm_api3_case_type_get($params) {
  * @return array
  * @throws \CRM_Core_Exception
  */
-function _civicrm_api3_case_type_get_formatResult(&$result, $options = array()) {
+function _civicrm_api3_case_type_get_formatResult(&$result, $options = []) {
   foreach ($result['values'] as $key => &$caseType) {
     if (!empty($caseType['definition'])) {
       list($xml) = CRM_Utils_XML::parseString($caseType['definition']);
-      $caseType['definition'] = $xml ? CRM_Case_BAO_CaseType::convertXmlToDefinition($xml) : array();
+      $caseType['definition'] = $xml ? CRM_Case_BAO_CaseType::convertXmlToDefinition($xml) : [];
     }
     else {
       if (empty($options['return']) || !empty($options['return']['definition'])) {
         $caseTypeName = (isset($caseType['name'])) ? $caseType['name'] : CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseType['id'], 'name', 'id', TRUE);
         $xml = CRM_Case_XMLRepository::singleton()->retrieve($caseTypeName);
-        $caseType['definition'] = $xml ? CRM_Case_BAO_CaseType::convertXmlToDefinition($xml) : array();
+        $caseType['definition'] = $xml ? CRM_Case_BAO_CaseType::convertXmlToDefinition($xml) : [];
       }
     }
     $caseType['is_forkable'] = CRM_Case_BAO_CaseType::isForkable($caseType['id']);
index 5675c622493f7342ee7629ab3135343bdfb4b1c6..c507dda83a1504e5704dab2d250cef9c476953f1 100644 (file)
@@ -104,12 +104,12 @@ function civicrm_api3_constant_get($params) {
   // once tests are 100% can try removing the first block & a similar block from Generic:getoptions
 
   // Whitelist approach is safer
-  $allowedClasses = array(
+  $allowedClasses = [
     'CRM_Core_PseudoConstant',
     'CRM_Event_PseudoConstant',
     'CRM_Contribute_PseudoConstant',
     'CRM_Member_PseudoConstant',
-  );
+  ];
   $className = $allowedClasses[0];
   if (!empty($params['class']) && in_array($params['class'], $allowedClasses)) {
     $className = $params['class'];
@@ -117,17 +117,17 @@ function civicrm_api3_constant_get($params) {
   $callable = "$className::$name";
   if (is_callable($callable)) {
     if (empty($params)) {
-      $values = call_user_func(array($className, $name));
+      $values = call_user_func([$className, $name]);
     }
     else {
-      $values = call_user_func(array($className, $name));
+      $values = call_user_func([$className, $name]);
       //@TODO XAV take out the param the COOKIE, Entity, Action and so there are only the "real param" in it
       //$values = call_user_func_array( array( $className, $name ), $params );
     }
     return civicrm_api3_create_success($values, $params, 'Constant');
   }
   else {
-    $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name);
+    $values = call_user_func(['CRM_Utils_PseudoConstant', 'getConstant'], $name);
     if (!empty($values)) {
       return civicrm_api3_create_success($values, $params, 'Constant');
     }
@@ -141,7 +141,7 @@ function civicrm_api3_constant_get($params) {
  * @param array $params
  */
 function _civicrm_api3_constant_get_spec(&$params) {
-  $options = array(
+  $options = [
     'activityStatus',
     'activityType',
     'addressee',
@@ -182,14 +182,14 @@ function _civicrm_api3_constant_get_spec(&$params) {
     'visibility',
     'worldRegion',
     'wysiwygEditor',
-  );
-  $params = array(
-    'name' => array(
+  ];
+  $params = [
+    'name' => [
       'title' => 'Constant Name',
       'name' => 'name',
       'api.required' => 1,
       'options' => array_combine($options, $options),
       'type' => CRM_Utils_Type::T_STRING,
-    ),
-  );
+    ],
+  ];
 }
index 4c67674d3d8bb2607640c883434644b777282b03..709bb9e2fa4fa73dec4cd4af7e2e2bf342fff8b5 100644 (file)
@@ -49,7 +49,7 @@
  *   ContactType array
  */
 function civicrm_api3_contact_type_create($params) {
-  civicrm_api3_verify_mandatory($params, _civicrm_api3_get_DAO(__FUNCTION__), array('name', 'parent_id'));
+  civicrm_api3_verify_mandatory($params, _civicrm_api3_get_DAO(__FUNCTION__), ['name', 'parent_id']);
 
   if (empty($params['id'])) {
     if (!array_key_exists('label', $params)) {
index 73918f8825fb794ced045356bf8cbc80b33c42f2..870ee7b17af8c051791637b50fcfea695888ef5d 100644 (file)
@@ -42,7 +42,7 @@
  *   Api result array
  */
 function civicrm_api3_contribution_create(&$params) {
-  $values = array();
+  $values = [];
   _civicrm_api3_custom_format_params($params, $values, 'Contribution');
   $params = array_merge($params, $values);
   // The BAO should not clean money - it should be done in the form layer & api wrapper
@@ -72,7 +72,7 @@ function civicrm_api3_contribution_create(&$params) {
     }
   }
   if (!empty($params['id']) && !empty($params['contribution_status_id'])) {
-    $error = array();
+    $error = [];
     //throw error for invalid status change such as setting completed back to pending
     //@todo this sort of validation belongs in the BAO not the API - if it is not an OK
     // action it needs to be blocked there. If it is Ok through a form it needs to be OK through the api
@@ -82,7 +82,7 @@ function civicrm_api3_contribution_create(&$params) {
     }
   }
   if (!empty($params['id']) && !empty($params['financial_type_id'])) {
-    $error = array();
+    $error = [];
     CRM_Contribute_BAO_Contribution::checkFinancialTypeChange($params['financial_type_id'], $params['id'], $error);
     if (array_key_exists('financial_type_id', $error)) {
       throw new API_Exception($error['financial_type_id']);
@@ -104,81 +104,81 @@ function civicrm_api3_contribution_create(&$params) {
 function _civicrm_api3_contribution_create_spec(&$params) {
   $params['contact_id']['api.required'] = 1;
   $params['total_amount']['api.required'] = 1;
-  $params['payment_instrument_id']['api.aliases'] = array('payment_instrument');
+  $params['payment_instrument_id']['api.aliases'] = ['payment_instrument'];
   $params['receive_date']['api.default'] = 'now';
   $params['receive_date']['api.required'] = TRUE;
-  $params['payment_processor'] = array(
+  $params['payment_processor'] = [
     'name' => 'payment_processor',
     'title' => 'Payment Processor ID',
     'description' => 'ID of payment processor used for this contribution',
     // field is called payment processor - not payment processor id but can only be one id so
     // it seems likely someone will fix it up one day to be more consistent - lets alias it from the start
-    'api.aliases' => array('payment_processor_id'),
+    'api.aliases' => ['payment_processor_id'],
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
+  ];
+  $params['financial_type_id']['api.aliases'] = ['contribution_type_id', 'contribution_type'];
   $params['financial_type_id']['api.required'] = 1;
-  $params['note'] = array(
+  $params['note'] = [
     'name' => 'note',
     'uniqueName' => 'contribution_note',
     'title' => 'note',
     'type' => 2,
     'description' => 'Associated Note in the notes table',
-  );
-  $params['soft_credit_to'] = array(
+  ];
+  $params['soft_credit_to'] = [
     'name' => 'soft_credit_to',
     'title' => 'Soft Credit contact ID (legacy)',
     'type' => CRM_Utils_Type::T_INT,
     'description' => 'ID of Contact to be Soft credited to (deprecated - use contribution_soft api)',
     'FKClassName' => 'CRM_Contact_DAO_Contact',
-  );
-  $params['honor_contact_id'] = array(
+  ];
+  $params['honor_contact_id'] = [
     'name' => 'honor_contact_id',
     'title' => 'Honoree contact ID (legacy)',
     'type' => CRM_Utils_Type::T_INT,
     'description' => 'ID of honoree contact (deprecated - use contribution_soft api)',
     'FKClassName' => 'CRM_Contact_DAO_Contact',
-  );
-  $params['honor_type_id'] = array(
+  ];
+  $params['honor_type_id'] = [
     'name' => 'honor_type_id',
     'title' => 'Honoree Type (legacy)',
     'type' => CRM_Utils_Type::T_INT,
     'description' => 'Type of honoree contact (deprecated - use contribution_soft api)',
     'pseudoconstant' => TRUE,
-  );
+  ];
   // note this is a recommended option but not adding as a default to avoid
   // creating unnecessary changes for the dev
-  $params['skipRecentView'] = array(
+  $params['skipRecentView'] = [
     'name' => 'skipRecentView',
     'title' => 'Skip adding to recent view',
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'description' => 'Do not add to recent view (setting this improves performance)',
-  );
-  $params['skipLineItem'] = array(
+  ];
+  $params['skipLineItem'] = [
     'name' => 'skipLineItem',
     'title' => 'Skip adding line items',
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'api.default' => 0,
     'description' => 'Do not add line items by default (if you wish to add your own)',
-  );
-  $params['batch_id'] = array(
+  ];
+  $params['batch_id'] = [
     'title' => 'Batch',
     'type' => CRM_Utils_Type::T_INT,
     'description' => 'Batch which relevant transactions should be added to',
-  );
-  $params['refund_trxn_id'] = array(
+  ];
+  $params['refund_trxn_id'] = [
     'title' => 'Refund Transaction ID',
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'Transaction ID specific to the refund taking place',
-  );
-  $params['card_type_id'] = array(
+  ];
+  $params['card_type_id'] = [
     'title' => 'Card Type ID',
     'description' => 'Providing Credit Card Type ID',
     'type' => CRM_Utils_Type::T_INT,
-    'pseudoconstant' => array(
+    'pseudoconstant' => [
       'optionGroupName' => 'accept_creditcard',
-    ),
-  );
+    ],
+  ];
 }
 
 /**
@@ -193,18 +193,18 @@ function _civicrm_api3_contribution_create_spec(&$params) {
 function _civicrm_api3_contribution_create_legacy_support_45(&$params) {
   //legacy soft credit handling - recommended approach is chaining
   if (!empty($params['soft_credit_to'])) {
-    $params['soft_credit'][] = array(
+    $params['soft_credit'][] = [
       'contact_id'          => $params['soft_credit_to'],
       'amount'              => $params['total_amount'],
       'soft_credit_type_id' => CRM_Core_OptionGroup::getDefaultValue("soft_credit_type"),
-    );
+    ];
   }
   if (!empty($params['honor_contact_id'])) {
-    $params['soft_credit'][] = array(
+    $params['soft_credit'][] = [
       'contact_id'          => $params['honor_contact_id'],
       'amount'              => $params['total_amount'],
       'soft_credit_type_id' => CRM_Utils_Array::value('honor_type_id', $params, CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_ContributionSoft', 'soft_credit_type_id', 'in_honor_of')),
-    );
+    ];
   }
 }
 
@@ -232,7 +232,7 @@ function civicrm_api3_contribution_delete($params) {
     throw new API_Exception('You do not have permission to delete this contribution');
   }
   if (CRM_Contribute_BAO_Contribution::deleteContribution($contributionID)) {
-    return civicrm_api3_create_success(array($contributionID => 1));
+    return civicrm_api3_create_success([$contributionID => 1]);
   }
   else {
     throw new API_Exception('Could not delete contribution');
@@ -247,7 +247,7 @@ function civicrm_api3_contribution_delete($params) {
  * @param array $params
  */
 function _civicrm_api3_contribution_delete_spec(&$params) {
-  $params['id']['api.aliases'] = array('contribution_id');
+  $params['id']['api.aliases'] = ['contribution_id'];
 }
 
 /**
@@ -292,9 +292,9 @@ function civicrm_api3_contribution_get($params) {
  * @throws \API_Exception
  */
 function _civicrm_api3_contribution_get_support_nonunique_returns($params) {
-  $additionalOptions = array();
+  $additionalOptions = [];
   $options = _civicrm_api3_get_options_from_params($params, TRUE);
-  foreach (array('check_number', 'address_id') as $changedVariable) {
+  foreach (['check_number', 'address_id'] as $changedVariable) {
     if (isset($options['return']) && !empty($options['return'][$changedVariable])) {
       $additionalOptions['return']['contribution_' . $changedVariable] = 1;
     }
@@ -312,11 +312,11 @@ function _civicrm_api3_contribution_add_supported_fields(&$contribution) {
   // Arguably we should also do the same with 'campaign_id' &
   // 'source' - which are also fields being rendered with unique names.
   // That seems more consistent with other api where we output the actual field names.
-  $outputAliases = array(
+  $outputAliases = [
     'contribution_check_number' => 'check_number',
     'contribution_address_id' => 'address_id',
     'payment_instrument_id' => 'instrument_id',
-  );
+  ];
   foreach ($outputAliases as $returnName => $copyTo) {
     if (array_key_exists($returnName, $contribution)) {
       $contribution[$copyTo] = $contribution[$returnName];
@@ -333,7 +333,7 @@ function _civicrm_api3_contribution_add_supported_fields(&$contribution) {
  * @return int
  */
 function civicrm_api3_contribution_getcount($params) {
-  $count = _civicrm_api3_get_using_query_object('Contribution', $params, array(), TRUE, CRM_Contact_BAO_Query::MODE_CONTRIBUTE);
+  $count = _civicrm_api3_get_using_query_object('Contribution', $params, [], TRUE, CRM_Contact_BAO_Query::MODE_CONTRIBUTE);
   return (int) $count;
 }
 
@@ -361,17 +361,17 @@ function _civicrm_api3_format_soft_credit(&$contribution) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_contribution_get_spec(&$params) {
-  $params['contribution_test'] = array(
+  $params['contribution_test'] = [
     'api.default' => 0,
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'title' => 'Get Test Contributions?',
-    'api.aliases' => array('is_test'),
-  );
+    'api.aliases' => ['is_test'],
+  ];
 
-  $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
-  $params['payment_instrument_id']['api.aliases'] = array('contribution_payment_instrument', 'payment_instrument');
+  $params['financial_type_id']['api.aliases'] = ['contribution_type_id'];
+  $params['payment_instrument_id']['api.aliases'] = ['contribution_payment_instrument', 'payment_instrument'];
   $params['contact_id'] = CRM_Utils_Array::value('contribution_contact_id', $params);
-  $params['contact_id']['api.aliases'] = array('contribution_contact_id');
+  $params['contact_id']['api.aliases'] = ['contribution_contact_id'];
   unset($params['contribution_contact_id']);
 }
 
@@ -391,7 +391,7 @@ function _civicrm_api3_contribution_get_spec(&$params) {
 function _civicrm_api3_contribute_format_params($params, &$values) {
   //legacy way of formatting from v2 api - v3 way is to define metadata & do it in the api layer
   _civicrm_api3_filter_fields_for_bao('Contribution', $params, $values);
-  return array();
+  return [];
 }
 
 /**
@@ -403,7 +403,7 @@ function _civicrm_api3_contribute_format_params($params, &$values) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_contribution_transact_spec(&$params) {
-  $fields = civicrm_api3('Contribution', 'getfields', array('action' => 'create'));
+  $fields = civicrm_api3('Contribution', 'getfields', ['action' => 'create']);
   $params = array_merge($params, $fields['values']);
   $params['receive_date']['api.default'] = 'now';
 }
@@ -455,8 +455,8 @@ function civicrm_api3_contribution_transact($params) {
  * @throws Exception
  */
 function civicrm_api3_contribution_sendconfirmation($params) {
-  $ids = $values = array();
-  $allowedParams = array(
+  $ids = $values = [];
+  $allowedParams = [
     'receipt_from_email',
     'receipt_from_name',
     'receipt_update',
@@ -464,7 +464,7 @@ function civicrm_api3_contribution_sendconfirmation($params) {
     'bcc_receipt',
     'receipt_text',
     'payment_processor_id',
-  );
+  ];
   $input = array_intersect_key($params, array_flip($allowedParams));
   $input['is_email_receipt'] = TRUE;
   CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $params['id'], $values);
@@ -479,40 +479,40 @@ function civicrm_api3_contribution_sendconfirmation($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
-  $params['id'] = array(
+  $params['id'] = [
     'api.required' => 1,
     'title' => ts('Contribution ID'),
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['receipt_from_email'] = array(
+  ];
+  $params['receipt_from_email'] = [
     'title' => ts('From Email address (string)'),
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['receipt_from_name'] = array(
+  ];
+  $params['receipt_from_name'] = [
     'title' => ts('From Name (string)'),
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['cc_receipt'] = array(
+  ];
+  $params['cc_receipt'] = [
     'title' => ts('CC Email address (string)'),
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['bcc_receipt'] = array(
+  ];
+  $params['bcc_receipt'] = [
     'title' => ts('BCC Email address (string)'),
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['receipt_text'] = array(
+  ];
+  $params['receipt_text'] = [
     'title' => ts('Message (string)'),
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['receipt_update'] = array(
+  ];
+  $params['receipt_update'] = [
     'title' => ts('Update the Receipt Date'),
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'api.default' => TRUE,
-  );
-  $params['payment_processor_id'] = array(
+  ];
+  $params['payment_processor_id'] = [
     'title' => ts('Payment processor Id (avoids mis-guesses)'),
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
@@ -534,7 +534,7 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
  * @throws \Exception
  */
 function civicrm_api3_contribution_completetransaction(&$params) {
-  $input = $ids = array();
+  $input = $ids = [];
   if (isset($params['payment_processor_id'])) {
     $input['payment_processor_id'] = $params['payment_processor_id'];
   }
@@ -564,52 +564,52 @@ function civicrm_api3_contribution_completetransaction(&$params) {
  * @param array $params
  */
 function _civicrm_api3_contribution_completetransaction_spec(&$params) {
-  $params['id'] = array(
+  $params['id'] = [
     'title' => 'Contribution ID',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => TRUE,
-  );
-  $params['trxn_id'] = array(
+  ];
+  $params['trxn_id'] = [
     'title' => 'Transaction ID',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['is_email_receipt'] = array(
+  ];
+  $params['is_email_receipt'] = [
     'title' => 'Send email Receipt?',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['receipt_from_email'] = array(
+  ];
+  $params['receipt_from_email'] = [
     'title' => 'Email to send receipt from.',
     'description' => 'If not provided this will default to being based on domain mail or contribution page',
     'type' => CRM_Utils_Type::T_EMAIL,
-  );
-  $params['receipt_from_name'] = array(
+  ];
+  $params['receipt_from_name'] = [
     'title' => 'Name to send receipt from',
     'description' => '. If not provided this will default to domain mail or contribution page',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['payment_processor_id'] = array(
+  ];
+  $params['payment_processor_id'] = [
     'title' => 'Payment processor ID',
     'description' => 'Providing this is strongly recommended, as not possible to calculate it accurately always',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['fee_amount'] = array(
+  ];
+  $params['fee_amount'] = [
     'title' => 'Fee charged on transaction',
     'description' => 'If a fee has been charged then the amount',
     'type' => CRM_Utils_Type::T_FLOAT,
-  );
-  $params['trxn_date'] = array(
+  ];
+  $params['trxn_date'] = [
     'title' => 'Transaction Date',
     'description' => 'Date this transaction occurred',
     'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
-  );
-  $params['card_type_id'] = array(
+  ];
+  $params['card_type_id'] = [
     'title' => 'Card Type ID',
     'description' => 'Providing Credit Card Type ID',
     'type' => CRM_Utils_Type::T_INT,
-    'pseudoconstant' => array(
+    'pseudoconstant' => [
       'optionGroupName' => 'accept_creditcard',
-    ),
-  );
+    ],
+  ];
 }
 
 /**
@@ -629,17 +629,17 @@ function _civicrm_api3_contribution_completetransaction_spec(&$params) {
  * @throws API_Exception
  */
 function civicrm_api3_contribution_repeattransaction(&$params) {
-  $input = $ids = array();
-  civicrm_api3_verify_one_mandatory($params, NULL, array('contribution_recur_id', 'original_contribution_id'));
+  $input = $ids = [];
+  civicrm_api3_verify_one_mandatory($params, NULL, ['contribution_recur_id', 'original_contribution_id']);
   if (empty($params['original_contribution_id'])) {
     //  CRM-19873 call with test mode.
-    $params['original_contribution_id'] = civicrm_api3('contribution', 'getvalue', array(
+    $params['original_contribution_id'] = civicrm_api3('contribution', 'getvalue', [
       'return' => 'id',
-      'contribution_status_id' => array('IN' => array('Completed')),
+      'contribution_status_id' => ['IN' => ['Completed']],
       'contribution_recur_id' => $params['contribution_recur_id'],
       'contribution_test' => CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionRecur', $params['contribution_recur_id'], 'is_test'),
-      'options' => array('limit' => 1, 'sort' => 'id DESC'),
-    ));
+      'options' => ['limit' => 1, 'sort' => 'id DESC'],
+    ]);
   }
   $contribution = new CRM_Contribute_BAO_Contribution();
   $contribution->id = $params['original_contribution_id'];
@@ -648,10 +648,10 @@ function civicrm_api3_contribution_repeattransaction(&$params) {
       'A valid original contribution ID is required', 'invalid_data');
   }
   $original_contribution = clone $contribution;
-  $input['payment_processor_id'] = civicrm_api3('contributionRecur', 'getvalue', array(
+  $input['payment_processor_id'] = civicrm_api3('contributionRecur', 'getvalue', [
     'return' => 'payment_processor_id',
     'id' => $contribution->contribution_recur_id,
-  ));
+  ]);
   try {
     if (!$contribution->loadRelatedObjects($input, $ids, TRUE)) {
       throw new API_Exception('failed to load related objects');
@@ -660,14 +660,14 @@ function civicrm_api3_contribution_repeattransaction(&$params) {
     unset($contribution->id, $contribution->receive_date, $contribution->invoice_id);
     $contribution->receive_date = $params['receive_date'];
 
-    $passThroughParams = array(
+    $passThroughParams = [
       'trxn_id',
       'total_amount',
       'campaign_id',
       'fee_amount',
       'financial_type_id',
       'contribution_status_id',
-    );
+    ];
     $input = array_intersect_key($params, array_fill_keys($passThroughParams, NULL));
 
     return _ipn_process_transaction($params, $contribution, $input, $ids, $original_contribution);
@@ -735,67 +735,67 @@ function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstC
  * @param array $params
  */
 function _civicrm_api3_contribution_repeattransaction_spec(&$params) {
-  $params['original_contribution_id'] = array(
+  $params['original_contribution_id'] = [
     'title' => 'Original Contribution ID',
     'description' => 'Contribution ID to copy (will be calculated from recurring contribution if not provided)',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['contribution_recur_id'] = array(
+  ];
+  $params['contribution_recur_id'] = [
     'title' => 'Recurring contribution ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['trxn_id'] = array(
+  ];
+  $params['trxn_id'] = [
     'title' => 'Transaction ID',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['is_email_receipt'] = array(
+  ];
+  $params['is_email_receipt'] = [
     'title' => 'Send email Receipt?',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['contribution_status_id'] = array(
+  ];
+  $params['contribution_status_id'] = [
     'title' => 'Contribution Status ID',
     'name' => 'contribution_status_id',
     'type' => CRM_Utils_Type::T_INT,
-    'pseudoconstant' => array(
+    'pseudoconstant' => [
       'optionGroupName' => 'contribution_status',
-    ),
+    ],
     'api.required' => TRUE,
-  );
-  $params['receive_date'] = array(
+  ];
+  $params['receive_date'] = [
     'title' => 'Contribution Receive Date',
     'name' => 'receive_date',
     'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
     'api.default' => 'now',
-  );
-  $params['trxn_id'] = array(
+  ];
+  $params['trxn_id'] = [
     'title' => 'Transaction ID',
     'name' => 'trxn_id',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['campaign_id'] = array(
+  ];
+  $params['campaign_id'] = [
     'title' => 'Campaign ID',
     'name' => 'campaign_id',
     'type' => CRM_Utils_Type::T_INT,
-    'pseudoconstant' => array(
+    'pseudoconstant' => [
       'table' => 'civicrm_campaign',
       'keyColumn' => 'id',
       'labelColumn' => 'title',
-    ),
-  );
-  $params['financial_type_id'] = array(
+    ],
+  ];
+  $params['financial_type_id'] = [
     'title' => 'Financial ID (ignored if more than one line item)',
     'name' => 'financial_type_id',
     'type' => CRM_Utils_Type::T_INT,
-    'pseudoconstant' => array(
+    'pseudoconstant' => [
       'table' => 'civicrm_financial_type',
       'keyColumn' => 'id',
       'labelColumn' => 'name',
-    ),
-  );
-  $params['payment_processor_id'] = array(
+    ],
+  ];
+  $params['payment_processor_id'] = [
     'description' => ts('Payment processor ID, will be loaded from contribution_recur if not provided'),
     'title' => 'Payment processor ID',
     'name' => 'payment_processor_id',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
index 9ffbd59edbbc6ef3de87e495150de047bc993d75..42385d050660d5dec75b9a0e1822b95ca2280093 100644 (file)
@@ -58,7 +58,7 @@ function civicrm_api3_contribution_page_create($params) {
  */
 function _civicrm_api3_contribution_page_create_spec(&$params) {
   $params['financial_type_id']['api.required'] = 1;
-  $params['payment_processor']['api.aliases'] = array('payment_processor_id');
+  $params['payment_processor']['api.aliases'] = ['payment_processor_id'];
   $params['is_active']['api.default'] = 1;
 }
 
@@ -157,12 +157,12 @@ function _civicrm_api3_contribution_page_validate_spec(&$params) {
  * @return array
  */
 function _civicrm_api3_contribution_page_getlist_defaults(&$request) {
-  return array(
-    'description_field' => array(
+  return [
+    'description_field' => [
       'intro_text',
-    ),
-    'params' => array(
+    ],
+    'params' => [
       'is_active' => 1,
-    ),
-  );
+    ],
+  ];
 }
index 4160e19fafcd8769c9d582dc5bfefad7a77c6244..2ccb9555962f7ee6d82c78cc7fde4f326016669a 100644 (file)
@@ -84,7 +84,7 @@ function civicrm_api3_contribution_recur_get($params) {
  *   returns true is successfully cancelled
  */
 function civicrm_api3_contribution_recur_cancel($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['id']);
   return CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($params['id']) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while cancelling recurring contribution'));
 }
 
index b6af835e1343f50feaff3e59727e9a0f062bcd9b..0ac81d5e94518d8d4b013a4f0555b80fff1b018a 100644 (file)
@@ -52,12 +52,12 @@ function civicrm_api3_custom_field_create($params) {
     foreach ($params['option_values'] as $key => $value) {
       // Translate simple key/value pairs into full-blown option values
       if (!is_array($value)) {
-        $value = array(
+        $value = [
           'label' => $value,
           'value' => $key,
           'is_active' => 1,
           'weight' => $weight,
-        );
+        ];
         $key = $weight++;
       }
       $params['option_label'][$key] = $value['label'];
@@ -66,7 +66,7 @@ function civicrm_api3_custom_field_create($params) {
       $params['option_weight'][$key] = $value['weight'];
     }
   }
-  $values = array();
+  $values = [];
   $customField = CRM_Core_BAO_CustomField::create($params);
   _civicrm_api3_object_to_array_unique_fields($customField, $values[$customField->id]);
   _civicrm_api3_custom_field_flush_static_caches();
@@ -77,7 +77,7 @@ function civicrm_api3_custom_field_create($params) {
  * Flush static caches in functions that might have stored available custom fields.
  */
 function _civicrm_api3_custom_field_flush_static_caches() {
-  civicrm_api('CustomField', 'getfields', array('version' => 3, 'cache_clear' => 1));
+  civicrm_api('CustomField', 'getfields', ['version' => 3, 'cache_clear' => 1]);
   CRM_Core_BAO_UFField::getAvailableFieldsFlat(TRUE);
 }
 
@@ -91,17 +91,17 @@ function _civicrm_api3_custom_field_create_spec(&$params) {
   $params['label']['api.required'] = 1;
   $params['custom_group_id']['api.required'] = 1;
   $params['is_active']['api.default'] = 1;
-  $params['option_values'] = array(
+  $params['option_values'] = [
     'title' => 'Option Values',
     'description' => "Pass an array of options (value => label) to create this field's option values",
-  );
+  ];
   // TODO: Why expose this to the api at all?
-  $params['option_type'] = array(
+  $params['option_type'] = [
     'title' => 'Option Type',
     'description' => 'This (boolean) field tells the BAO to create an option group for the field if the field type is appropriate',
     'api.default' => 1,
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
   $params['data_type']['api.default'] = 'String';
   $params['is_active']['api.default'] = 1;
 }
@@ -119,7 +119,7 @@ function civicrm_api3_custom_field_delete($params) {
   $field->id = $params['id'];
   $field->find(TRUE);
   $customFieldDelete = CRM_Core_BAO_CustomField::deleteField($field);
-  civicrm_api('CustomField', 'getfields', array('version' => 3, 'cache_clear' => 1));
+  civicrm_api('CustomField', 'getfields', ['version' => 3, 'cache_clear' => 1]);
   return $customFieldDelete ? civicrm_api3_create_error('Error while deleting custom field') : civicrm_api3_create_success();
 }
 
@@ -154,7 +154,7 @@ function civicrm_api3_custom_field_get($params) {
  * @todo remove this function - not in use but need to review functionality before
  * removing as it might be useful in wrapper layer
  */
-function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDetails, &$errors = array()) {
+function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDetails, &$errors = []) {
   return NULL;
   //see comment block
   if (!$value) {
@@ -205,7 +205,7 @@ function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDet
       }
 
       if (!is_array($value)) {
-        $value = array($value);
+        $value = [$value];
       }
 
       $query = "SELECT count(*) FROM civicrm_country WHERE id IN (" . implode(',', $value) . ")";
@@ -225,7 +225,7 @@ function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDet
       }
 
       if (!is_array($value)) {
-        $value = array($value);
+        $value = [$value];
       }
 
       $query = "
@@ -242,13 +242,13 @@ SELECT count(*)
       break;
   }
 
-  if (in_array($htmlType, array(
-    'Select', 'Multi-Select', 'CheckBox', 'Radio')) &&
+  if (in_array($htmlType, [
+    'Select', 'Multi-Select', 'CheckBox', 'Radio']) &&
     !isset($errors[$fieldName])
   ) {
     $options = CRM_Core_OptionGroup::valuesByID($fieldDetails['option_group_id']);
     if (!is_array($value)) {
-      $value = array($value);
+      $value = [$value];
     }
 
     $invalidOptions = array_diff($value, array_keys($options));
@@ -270,7 +270,7 @@ SELECT count(*)
  */
 function civicrm_api3_custom_field_setvalue($params) {
   require_once 'api/v3/Generic/Setvalue.php';
-  $result = civicrm_api3_generic_setValue(array("entity" => 'CustomField', 'params' => $params));
+  $result = civicrm_api3_generic_setValue(["entity" => 'CustomField', 'params' => $params]);
   if (empty($result['is_error'])) {
     CRM_Utils_System::flushCache();
   }
index f2dc5ca7fd3d5b79d8506498bad00e5e1bca9b96..a06d5d93420160dcd222159ed9509b35d2aa6326 100644 (file)
@@ -115,7 +115,7 @@ function civicrm_api3_custom_group_get($params) {
  */
 function civicrm_api3_custom_group_setvalue($params) {
   require_once 'api/v3/Generic/Setvalue.php';
-  $result = civicrm_api3_generic_setValue(array("entity" => 'CustomGroup', 'params' => $params));
+  $result = civicrm_api3_generic_setValue(["entity" => 'CustomGroup', 'params' => $params]);
   if (empty($result['is_error'])) {
     CRM_Utils_System::flushCache();
   }
index 359466d9ea6df9471afd42ab7eb095cff1398641..0623e51a947027589ef4d81c8a9ab1d1d11eb4e0 100644 (file)
@@ -81,7 +81,7 @@ function _civicrm_api3_custom_search_create_spec(&$params) {
   $params['option_group_id']['api.default'] = CRM_Core_DAO::getFieldValue(
     'CRM_Core_DAO_OptionGroup', 'custom_search', 'id', 'name'
   );
-  $params['name']['api.aliases'] = array('class_name');
+  $params['name']['api.aliases'] = ['class_name'];
 }
 
 /**
index 60005bdb19669dffa433b3c114fdfeef1e40153a..7ada45ac29c746f90b614791ee8ed717ddd4c2eb 100644 (file)
@@ -69,7 +69,7 @@ function civicrm_api3_custom_value_create($params) {
   if (!empty($params['entity_table']) && substr($params['entity_table'], 0, 7) == 'civicrm') {
     $params['entity_table'] = substr($params['entity_table'], 8, 7);
   }
-  $create = array('entityID' => $params['entity_id']);
+  $create = ['entityID' => $params['entity_id']];
   // Translate names and
   //Convert arrays to multi-value strings
   $sp = CRM_Core_DAO::VALUE_SEPARATOR;
@@ -135,10 +135,10 @@ function _civicrm_api3_custom_value_create_spec(&$params) {
  */
 function civicrm_api3_custom_value_get($params) {
 
-  $getParams = array(
+  $getParams = [
     'entityID' => $params['entity_id'],
     'entityType' => CRM_Utils_Array::value('entity_table', $params, ''),
-  );
+  ];
   if (strstr($getParams['entityType'], 'civicrm_')) {
     $getParams['entityType'] = ucfirst(substr($getParams['entityType'], 8));
   }
@@ -176,7 +176,7 @@ function civicrm_api3_custom_value_get($params) {
 
   if ($result['is_error']) {
     if ($result['error_message'] == "No values found for the specified entity ID and custom field(s).") {
-      $values = array();
+      $values = [];
       return civicrm_api3_create_success($values, $params, 'CustomValue');
     }
     else {
@@ -250,45 +250,45 @@ function _civicrm_api3_custom_value_get_spec(&$params) {
  * @throws \CiviCRM_API3_Exception
  */
 function _civicrm_api3_custom_value_gettree_spec(&$spec) {
-  $spec['entity_id'] = array(
+  $spec['entity_id'] = [
     'title' => 'Entity Id',
     'description' => 'Id of entity',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => 1,
-  );
+  ];
   $entities = civicrm_api3('Entity', 'get');
   $entities = array_diff($entities['values'], $entities['deprecated']);
-  $spec['entity_type'] = array(
+  $spec['entity_type'] = [
     'title' => 'Entity Type',
     'description' => 'API name of entity type, e.g. "Contact"',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => 1,
     'options' => array_combine($entities, $entities),
-  );
+  ];
   // Return params for custom group, field & value
   foreach (CRM_Core_DAO_CustomGroup::fields() as $field) {
     $name = 'custom_group.' . $field['name'];
-    $spec[$name] = array('name' => $name) + $field;
+    $spec[$name] = ['name' => $name] + $field;
   }
   foreach (CRM_Core_DAO_CustomField::fields() as $field) {
     $name = 'custom_field.' . $field['name'];
-    $spec[$name] = array('name' => $name) + $field;
+    $spec[$name] = ['name' => $name] + $field;
   }
-  $spec['custom_value.id'] = array(
+  $spec['custom_value.id'] = [
     'title' => 'Custom Value Id',
     'description' => 'Id of record in custom value table',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $spec['custom_value.data'] = array(
+  ];
+  $spec['custom_value.data'] = [
     'title' => 'Custom Value (Raw)',
     'description' => 'Raw value as stored in the database',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['custom_value.display'] = array(
+  ];
+  $spec['custom_value.display'] = [
     'title' => 'Custom Value (Formatted)',
     'description' => 'Custom value formatted for display',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
 
 /**
@@ -302,13 +302,13 @@ function _civicrm_api3_custom_value_gettree_spec(&$spec) {
  * @throws \CiviCRM_API3_Exception
  */
 function civicrm_api3_custom_value_gettree($params) {
-  $ret = array();
+  $ret = [];
   $options = _civicrm_api3_get_options_from_params($params);
-  $toReturn = array(
-    'custom_group' => array(),
-    'custom_field' => array(),
-    'custom_value' => array(),
-  );
+  $toReturn = [
+    'custom_group' => [],
+    'custom_field' => [],
+    'custom_value' => [],
+  ];
   foreach (array_keys($options['return']) as $r) {
     list($type, $field) = explode('.', $r);
     if (isset($toReturn[$type])) {
@@ -321,7 +321,7 @@ function civicrm_api3_custom_value_gettree($params) {
   }
   switch ($params['entity_type']) {
     case 'Contact':
-      $ret = array('entityType' => 'contact_type', 'subTypes' => 'contact_sub_type');
+      $ret = ['entityType' => 'contact_type', 'subTypes' => 'contact_sub_type'];
       break;
 
     case 'Activity':
@@ -332,25 +332,25 @@ function civicrm_api3_custom_value_gettree($params) {
     case 'Grant':
     case 'Membership':
     case 'Relationship':
-      $ret = array('subTypes' => strtolower($params['entity_type']) . '_type_id');
+      $ret = ['subTypes' => strtolower($params['entity_type']) . '_type_id'];
       break;
 
     case 'Participant':
       // todo
   }
-  $treeParams = array(
+  $treeParams = [
     'entityType' => $params['entity_type'],
-    'subTypes' => array(),
+    'subTypes' => [],
     'subName' => NULL,
-  );
+  ];
   // Fetch entity data for custom group type/sub-type
   // Also verify access permissions (api3 will throw an exception if permission denied)
   if ($ret || !empty($params['check_permissions'])) {
-    $entityData = civicrm_api3($params['entity_type'], 'getsingle', array(
+    $entityData = civicrm_api3($params['entity_type'], 'getsingle', [
       'id' => $params['entity_id'],
       'check_permissions' => !empty($params['check_permissions']),
-      'return' => array_merge(array('id'), array_values($ret)),
-    ));
+      'return' => array_merge(['id'], array_values($ret)),
+    ]);
     foreach ($ret as $param => $key) {
       if (isset($entityData[$key])) {
         $treeParams[$param] = $entityData[$key];
@@ -359,16 +359,16 @@ function civicrm_api3_custom_value_gettree($params) {
   }
   $tree = CRM_Core_BAO_CustomGroup::getTree($treeParams['entityType'], $toReturn, $params['entity_id'], NULL, $treeParams['subTypes'], $treeParams['subName'], TRUE, NULL, FALSE, CRM_Utils_Array::value('check_permissions', $params, TRUE));
   unset($tree['info']);
-  $result = array();
+  $result = [];
   foreach ($tree as $group) {
-    $result[$group['name']] = array();
+    $result[$group['name']] = [];
     $groupToReturn = $toReturn['custom_group'] ? $toReturn['custom_group'] : array_keys($group);
     foreach ($groupToReturn as $item) {
       $result[$group['name']][$item] = CRM_Utils_Array::value($item, $group);
     }
-    $result[$group['name']]['fields'] = array();
+    $result[$group['name']]['fields'] = [];
     foreach ($group['fields'] as $fieldInfo) {
-      $field = array('value' => NULL);
+      $field = ['value' => NULL];
       $fieldToReturn = $toReturn['custom_field'] ? $toReturn['custom_field'] : array_keys($fieldInfo);
       foreach ($fieldToReturn as $item) {
         $field[$item] = CRM_Utils_Array::value($item, $fieldInfo);
index eb63ed35a5243e91347b7190a0a3b9590566f50d..6f12beb094c9df85112ebd2cc0d86b73f338349c 100644 (file)
 function _civicrm_api3_cxn_register_spec(&$spec) {
   $daoFields = CRM_Cxn_DAO_Cxn::fields();
   $spec['app_guid'] = $daoFields['app_guid'];
-  $spec['app_meta_url'] = array(
+  $spec['app_meta_url'] = [
     'name' => 'app_meta_url',
     'type' => CRM_Utils_Type::T_STRING,
     'title' => ts('Application Metadata URL'),
     'description' => 'Application Metadata URL',
     'maxlength' => 255,
     'size' => CRM_Utils_Type::HUGE,
-  );
+  ];
 }
 
 /**
@@ -79,9 +79,9 @@ function civicrm_api3_cxn_register($params) {
     }
   }
   elseif (!empty($params['app_guid'])) {
-    $appMeta = civicrm_api3('CxnApp', 'getsingle', array(
+    $appMeta = civicrm_api3('CxnApp', 'getsingle', [
       'appId' => $params['app_guid'],
-    ));
+    ]);
   }
 
   if (empty($appMeta) || !is_array($appMeta)) {
@@ -112,13 +112,13 @@ function _civicrm_api3_cxn_unregister_spec(&$spec) {
   $daoFields = CRM_Cxn_DAO_Cxn::fields();
   $spec['cxn_guid'] = $daoFields['cxn_guid'];
   $spec['app_guid'] = $daoFields['app_guid'];
-  $spec['force'] = array(
+  $spec['force'] = [
     'name' => 'force',
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'title' => ts('Force'),
     'description' => 'Destroy connection even if the remote application is non-responsive.',
     'default' => '0',
-  );
+  ];
 }
 
 /**
@@ -159,9 +159,9 @@ function _civicrm_api3_cxn_parseCxnId($params) {
     $cxnId = $params['cxn_guid'];
   }
   elseif (!empty($params['app_guid'])) {
-    $cxnId = CRM_Core_DAO::singleValueQuery('SELECT cxn_guid FROM civicrm_cxn WHERE app_guid = %1', array(
-      1 => array($params['app_guid'], 'String'),
-    ));
+    $cxnId = CRM_Core_DAO::singleValueQuery('SELECT cxn_guid FROM civicrm_cxn WHERE app_guid = %1', [
+      1 => [$params['app_guid'], 'String'],
+    ]);
     if (!$cxnId) {
       throw new API_Exception("The app_guid does not correspond to an active connection.");
     }
@@ -222,15 +222,15 @@ function _civicrm_api3_cxn_getlink_spec(&$spec) {
   $daoFields = CRM_Cxn_DAO_Cxn::fields();
   $spec['app_guid'] = $daoFields['app_guid'];
   $spec['cxn_guid'] = $daoFields['cxn_guid'];
-  $spec['page_name'] = array(
+  $spec['page_name'] = [
     'name' => 'page_name',
     'type' => CRM_Utils_Type::T_STRING,
     'title' => ts('Page Type'),
     'description' => 'The type of page (eg "settings")',
     'maxlength' => 63,
     'size' => CRM_Utils_Type::HUGE,
-    'api.aliases' => array('page'),
-  );
+    'api.aliases' => ['page'],
+  ];
 }
 
 /**
@@ -252,9 +252,9 @@ function civicrm_api3_cxn_getlink($params) {
 
   /** @var \Civi\Cxn\Rpc\RegistrationClient $client */
   $client = \Civi::service('cxn_reg_client');
-  return $client->call($appMeta, 'Cxn', 'getlink', array(
+  return $client->call($appMeta, 'Cxn', 'getlink', [
     'page' => $params['page_name'],
-  ));
+  ]);
 }
 
 /**
@@ -264,12 +264,12 @@ function civicrm_api3_cxn_getlink($params) {
  * @throws Exception
  */
 function civicrm_api3_cxn_getcfg($params) {
-  $result = array(
+  $result = [
     'CIVICRM_CXN_CA' => defined('CIVICRM_CXN_CA') ? CIVICRM_CXN_CA : NULL,
     'CIVICRM_CXN_VIA' => defined('CIVICRM_CXN_VIA') ? CIVICRM_CXN_VIA : NULL,
     'CIVICRM_CXN_APPS_URL' => defined('CIVICRM_CXN_APPS_URL') ? CIVICRM_CXN_APPS_URL : NULL,
     'siteCallbackUrl' => CRM_Cxn_BAO_Cxn::getSiteCallbackUrl(),
-  );
+  ];
   return civicrm_api3_create_success($result);
 }
 
index d3f6585f43679d5bf707390e2e2e6ce304ec0c7f..9e289c8d8af216f69153af35e7e0ce11a1a0c832 100644 (file)
@@ -48,34 +48,34 @@ use \Civi\Cxn\Rpc\Message\GarbledMessage;
  *   List of fields.
  */
 function _civicrm_api3_cxn_app_get_spec(&$spec) {
-  $spec['appCert'] = array(
+  $spec['appCert'] = [
     'name' => 'appCert',
     'type' => CRM_Utils_Type::T_TEXT,
     'title' => ts('Certificate'),
     'description' => 'PEM-encoded certificate',
-  );
-  $spec['appId'] = array(
+  ];
+  $spec['appId'] = [
     'name' => 'appId',
     'type' => CRM_Utils_Type::T_STRING,
     'title' => ts('Application GUID'),
     'description' => 'Application GUID',
     'maxlength' => 128,
     'size' => CRM_Utils_Type::HUGE,
-  );
-  $spec['appUrl'] = array(
+  ];
+  $spec['appUrl'] = [
     'name' => 'appUrl',
     'type' => CRM_Utils_Type::T_STRING,
     'title' => ts('Registration URL'),
     'description' => 'An endpoint to notify when performing registration',
     'maxlength' => 255,
     'size' => CRM_Utils_Type::HUGE,
-  );
-  $spec['desc'] = array(
+  ];
+  $spec['desc'] = [
     'name' => 'desc',
     'type' => CRM_Utils_Type::T_TEXT,
     'title' => ts('Description'),
     'description' => 'Description',
-  );
+  ];
   //$spec['perm'] = array(
   //  'name' => 'perm',
   //  'type' => CRM_Utils_Type::T_TEXT,
@@ -104,16 +104,16 @@ function civicrm_api3_cxn_app_get($params) {
 
   $agent = new \Civi\Cxn\Rpc\Agent(NULL, NULL);
   $agent->setCertValidator(CRM_Cxn_BAO_Cxn::createCertificateValidator());
-  $message = $agent->decode(array(AppMetasMessage::NAME, GarbledMessage::NAME), $blob);
+  $message = $agent->decode([AppMetasMessage::NAME, GarbledMessage::NAME], $blob);
 
   if ($message instanceof AppMetasMessage) {
     return _civicrm_api3_basic_array_get('CxnApp', $params, $message->getData(), 'appId',
-      array('appId', 'appUrl', 'desc', 'appCert', 'perm'));
+      ['appId', 'appUrl', 'desc', 'appCert', 'perm']);
   }
   elseif ($message instanceof GarbledMessage) {
-    return civicrm_api3_create_error('Received garbled response', array(
+    return civicrm_api3_create_error('Received garbled response', [
       'garbled_message' => $message->getData(),
-    ));
+    ]);
   }
   else {
     return civicrm_api3_create_error("Unrecognized message");
index 3dd06ea0f5a574265e5075394307e84b8ec52c80..1cd9bd98f44a1c795d842a82b9f359619a9dd40e 100644 (file)
  *   Array containing 'is_error' to denote success or failure and details of the created activity
  */
 function civicrm_api3_dashboard_create($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array(
+  civicrm_api3_verify_one_mandatory($params, NULL, [
       'name',
       'label',
       'url',
       'fullscreen_url',
-    )
+    ]
   );
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Dashboard');
 }
index c6b7b4bb1ce95c741d4301f15c0cd8dbc5a56731..2c84ebed8b52d7fc1f81d5482eb9407cef3d2224 100644 (file)
@@ -42,9 +42,9 @@ function civicrm_api3_dashboard_contact_create($params) {
   if (empty($params['id'])) {
     civicrm_api3_verify_one_mandatory($params,
       NULL,
-      array(
+      [
         'dashboard_id',
-      )
+      ]
     );
   }
   $errors = _civicrm_api3_dashboard_contact_check_params($params);
index 2139fa0e87d5c2011d448ffabfb733dae3359b36..94e5c52a97460980cbe3885242e4af084d4b0ce7 100644 (file)
@@ -58,23 +58,23 @@ function civicrm_api3_domain_get($params) {
 
   foreach ($domains as $domain) {
     if (!empty($domain['contact_id'])) {
-      $values = array();
-      $locparams = array(
+      $values = [];
+      $locparams = [
         'contact_id' => $domain['contact_id'],
-      );
+      ];
       $values['location'] = CRM_Core_BAO_Location::getValues($locparams, TRUE);
-      $address_array = array(
+      $address_array = [
         'street_address', 'supplemental_address_1', 'supplemental_address_2', 'supplemental_address_3',
         'city', 'state_province_id', 'postal_code', 'country_id',
         'geo_code_1', 'geo_code_2',
-      );
+      ];
 
       if (!empty($values['location']['email'])) {
         $domain['domain_email'] = CRM_Utils_Array::value('email', $values['location']['email'][1]);
       }
 
       if (!empty($values['location']['phone'])) {
-        $domain['domain_phone'] = array(
+        $domain['domain_phone'] = [
           'phone_type' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_Phone', 'phone_type_id',
             CRM_Utils_Array::value(
               'phone_type_id',
@@ -85,7 +85,7 @@ function civicrm_api3_domain_get($params) {
             'phone',
             $values['location']['phone'][1]
           ),
-        );
+        ];
       }
 
       if (!empty($values['location']['address'])) {
@@ -119,10 +119,10 @@ function civicrm_api3_domain_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_domain_get_spec(&$params) {
-  $params['current_domain'] = array(
+  $params['current_domain'] = [
     'title' => "Current Domain",
     'description' => "get loaded domain",
-  );
+  ];
 }
 
 /**
@@ -160,11 +160,11 @@ function civicrm_api3_domain_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_domain_create_spec(&$params) {
-  $params['domain_version'] = array(
+  $params['domain_version'] = [
     'title' => "CiviCRM Version",
     'description' => "The civicrm version this instance is running",
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
   $params['domain_version']['api.required'] = 1;
   unset($params['version']);
   $params['name']['api.required'] = 1;
index 5113466851b471b80ed0c85ad1fa18538787b9c8..4bab9fe8935bc4c8ba5df96be52ee59c159aeea2 100644 (file)
@@ -11,7 +11,7 @@
  *   Array of deprecated api entities
  */
 function _civicrm_api3_entity_deprecation($entities) {
-  $deprecated = array();
+  $deprecated = [];
   if (!empty($entities['values'])) {
     foreach ($entities['values'] as $entity) {
       if (is_string(_civicrm_api3_deprecation_check($entity))) {
@@ -60,5 +60,5 @@ function civicrm_api3_entity_delete($params) {
 function civicrm_api3_entity_getfields($params) {
   // we return an empty array so it makes it easier to write generic getdefaults / required tests
   // without putting an exception in for entity
-  return civicrm_api3_create_success(array());
+  return civicrm_api3_create_success([]);
 }
index c363275e9c61c93ccba59598f0ac85166e0122cf..6ed334f78124d9bfb1be27316c4151ed2d8a7fe6 100644 (file)
@@ -54,7 +54,7 @@ function civicrm_api3_entity_tag_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_entity_tag_get_spec(&$params) {
-  $params['entity_id']['api.aliases'] = array('contact_id');
+  $params['entity_id']['api.aliases'] = ['contact_id'];
   $params['entity_table']['api.default'] = 'civicrm_contact';
 }
 
@@ -101,7 +101,7 @@ function _civicrm_api3_entity_tag_delete_spec(&$params) {
  */
 function _civicrm_api3_entity_tag_common($params, $op = 'add') {
 
-  $entityIDs = $tagIDs = array();
+  $entityIDs = $tagIDs = [];
   $entityTable = 'civicrm_contact';
   if (is_array($params)) {
     foreach ($params as $n => $v) {
@@ -135,7 +135,7 @@ function _civicrm_api3_entity_tag_common($params, $op = 'add') {
     }
   }
 
-  $values = array('is_error' => 0);
+  $values = ['is_error' => 0];
   if ($op == 'add') {
     $values['total_count'] = $values['added'] = $values['not_added'] = 0;
     foreach ($tagIDs as $tagID) {
index 7ebe392850ad332fe43c77f04cc84dddca436421..5bbb7dc7a37b9ffd0c37cb78856be814d3c55388 100644 (file)
 function civicrm_api3_event_create($params) {
   // Required fields for creating an event
   if (empty($params['id']) && empty($params['is_template'])) {
-    civicrm_api3_verify_mandatory($params, NULL, array(
+    civicrm_api3_verify_mandatory($params, NULL, [
       'start_date',
       'title',
-      array('event_type_id', 'template_id'),
-    ));
+      ['event_type_id', 'template_id'],
+    ]);
   }
   // Required fields for creating an event template
   elseif (empty($params['id']) && !empty($params['is_template'])) {
-    civicrm_api3_verify_mandatory($params, NULL, array(
+    civicrm_api3_verify_mandatory($params, NULL, [
       'template_title',
-    ));
+    ]);
   }
 
   // Clone event from template
@@ -78,7 +78,7 @@ function civicrm_api3_event_create($params) {
  */
 function _civicrm_api3_event_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
-  $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
+  $params['financial_type_id']['api.aliases'] = ['contribution_type_id'];
   $params['is_template']['api.default'] = 0;
 }
 
@@ -157,7 +157,7 @@ function civicrm_api3_event_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_event_get_spec(&$params) {
-  $params['financial_type_id']['api.aliases'] = array('contribution_type_id');
+  $params['financial_type_id']['api.aliases'] = ['contribution_type_id'];
 }
 
 /**
@@ -226,14 +226,14 @@ function _civicrm_api3_event_getisfull(&$event, $event_id) {
  * @param array $request
  */
 function _civicrm_api3_event_getlist_params(&$request) {
-  $fieldsToReturn = array('start_date', 'event_type_id', 'title', 'summary');
+  $fieldsToReturn = ['start_date', 'event_type_id', 'title', 'summary'];
   $request['params']['return'] = array_unique(array_merge($fieldsToReturn, $request['extra']));
   $request['params']['options']['sort'] = 'start_date DESC';
   if (empty($request['params']['id'])) {
-    $request['params'] += array(
+    $request['params'] += [
       'is_template' => 0,
       'is_active' => 1,
-    );
+    ];
   }
 }
 
@@ -248,20 +248,20 @@ function _civicrm_api3_event_getlist_params(&$request) {
  * @return array
  */
 function _civicrm_api3_event_getlist_output($result, $request) {
-  $output = array();
+  $output = [];
   if (!empty($result['values'])) {
     foreach ($result['values'] as $row) {
-      $data = array(
+      $data = [
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
-        'description' => array(
+        'description' => [
           CRM_Core_Pseudoconstant::getLabel(
             'CRM_Event_BAO_Event',
             'event_type_id',
             $row['event_type_id']
           ),
-        ),
-      );
+        ],
+      ];
       if (!empty($row['start_date'])) {
         $data['description'][0] .= ': ' . CRM_Utils_Date::customFormat($row['start_date']);
       }
@@ -272,7 +272,7 @@ function _civicrm_api3_event_getlist_output($result, $request) {
       $repeat = CRM_Core_BAO_RecurringEntity::getPositionAndCount($row['id'], 'civicrm_event');
       $data['extra']['is_recur'] = FALSE;
       if ($repeat) {
-        $data['suffix'] = ts('(%1 of %2)', array(1 => $repeat[0], 2 => $repeat[1]));
+        $data['suffix'] = ts('(%1 of %2)', [1 => $repeat[0], 2 => $repeat[1]]);
         $data['extra']['is_recur'] = TRUE;
       }
       $output[] = $data;
index 3dddb762d00dd068f2a53983a65f3ad8b6d5cb96..f079acaee7aa273984c0e691756c003483ec9b1d 100644 (file)
@@ -69,17 +69,17 @@ function civicrm_api3_extension_install($params) {
  * @param $fields
  */
 function _civicrm_api3_extension_install_spec(&$fields) {
-  $fields['keys'] = array(
+  $fields['keys'] = [
     'title' => 'Extension Key(s)',
-    'api.aliases' => array('key'),
+    'api.aliases' => ['key'],
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'Fully qualified name of one or more extensions',
-  );
-  $fields['path'] = array(
+  ];
+  $fields['path'] = [
     'title' => 'Extension Path',
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'The path to the extension. May use wildcard ("*").',
-  );
+  ];
 }
 
 /**
@@ -91,11 +91,11 @@ function _civicrm_api3_extension_install_spec(&$fields) {
 function civicrm_api3_extension_upgrade() {
   CRM_Core_Invoke::rebuildMenuAndCaches(TRUE);
   $queue = CRM_Extension_Upgrades::createQueue();
-  $runner = new CRM_Queue_Runner(array(
+  $runner = new CRM_Queue_Runner([
     'title' => 'Extension Upgrades',
     'queue' => $queue,
     'errorMode' => CRM_Queue_Runner::ERROR_ABORT,
-  ));
+  ]);
 
   try {
     $result = $runner->runAll();
@@ -255,7 +255,7 @@ function civicrm_api3_extension_download($params) {
   CRM_Extension_System::singleton()->getCache()->flush();
   CRM_Extension_System::singleton(TRUE);
   if (CRM_Utils_Array::value('install', $params, TRUE)) {
-    CRM_Extension_System::singleton()->getManager()->install(array($params['key']));
+    CRM_Extension_System::singleton()->getManager()->install([$params['key']]);
   }
 
   return civicrm_api3_create_success();
@@ -266,23 +266,23 @@ function civicrm_api3_extension_download($params) {
  * @param $fields
  */
 function _civicrm_api3_extension_download_spec(&$fields) {
-  $fields['key'] = array(
+  $fields['key'] = [
     'title' => 'Extension Key',
     'api.required' => 1,
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'Fully qualified name of the extension',
-  );
-  $fields['url'] = array(
+  ];
+  $fields['url'] = [
     'title' => 'Download URL',
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'Optional as the system can determine the url automatically for public extensions',
-  );
-  $fields['install'] = array(
+  ];
+  $fields['install'] = [
     'title' => 'Auto-install',
     'type' => CRM_Utils_Type::T_STRING,
     'description' => 'Automatically install the downloaded extension',
     'api.default' => TRUE,
-  );
+  ];
 }
 
 /**
@@ -319,18 +319,18 @@ function civicrm_api3_extension_refresh($params) {
  * @param $fields
  */
 function _civicrm_api3_extension_refresh_spec(&$fields) {
-  $fields['local'] = array(
+  $fields['local'] = [
     'title' => 'Rescan Local',
     'api.default' => 1,
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'description' => 'Whether to rescan the local filesystem (default TRUE)',
-  );
-  $fields['remote'] = array(
+  ];
+  $fields['remote'] = [
     'title' => 'Rescan Remote',
     'api.default' => 1,
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'description' => 'Whether to rescan the remote repository (default TRUE)',
-  );
+  ];
 }
 
 /**
@@ -347,14 +347,14 @@ function civicrm_api3_extension_get($params) {
   $keys = array_merge($full_names, $keys);
   $statuses = CRM_Extension_System::singleton()->getManager()->getStatuses();
   $mapper = CRM_Extension_System::singleton()->getMapper();
-  $result = array();
+  $result = [];
   $id = 0;
   foreach ($statuses as $key => $status) {
     try {
       $obj = $mapper->keyToInfo($key);
     }
     catch (CRM_Extension_Exception $ex) {
-      CRM_Core_Session::setStatus(ts('Failed to read extension (%1). Please refresh the extension list.', array(1 => $key)));
+      CRM_Core_Session::setStatus(ts('Failed to read extension (%1). Please refresh the extension list.', [1 => $key]));
       continue;
     }
     $info = CRM_Extension_System::createExtendedInfo($obj);
@@ -374,7 +374,7 @@ function civicrm_api3_extension_get($params) {
   unset($params['keys']);
   unset($params['full_name']);
 
-  $filterableFields = array('id', 'type', 'status', 'path');
+  $filterableFields = ['id', 'type', 'status', 'path'];
   return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', $filterableFields);
 }
 
@@ -388,15 +388,15 @@ function civicrm_api3_extension_get($params) {
  */
 function civicrm_api3_extension_getremote($params) {
   $extensions = CRM_Extension_System::singleton()->getBrowser()->getExtensions();
-  $result = array();
+  $result = [];
   $id = 0;
   foreach ($extensions as $key => $obj) {
-    $info = array();
+    $info = [];
     $info['id'] = $id++; // backward compatibility with indexing scheme
     $info = array_merge($info, (array) $obj);
     $result[] = $info;
   }
-  return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', CRM_Utils_Array::value('return', $params, array()));
+  return _civicrm_api3_basic_array_get('Extension', $params, $result, 'id', CRM_Utils_Array::value('return', $params, []));
 }
 
 /**
@@ -419,11 +419,11 @@ function _civicrm_api3_getKeys($params, $key = 'keys') {
       return $params[$key];
     }
     if ($params[$key] == '') {
-      return array();
+      return [];
     }
     return explode(API_V3_EXTENSION_DELIMITER, $params[$key]);
   }
   else {
-    return array();
+    return [];
   }
 }
index 583d41e582bc2f058df13fb67a2594a078347120..cfa56b8f70bfd45576201a9e7bc30453e8c9ca0b 100644 (file)
  */
 function civicrm_api3_file_create($params) {
 
-  civicrm_api3_verify_mandatory($params, 'CRM_Core_DAO_File', array('uri'));
+  civicrm_api3_verify_mandatory($params, 'CRM_Core_DAO_File', ['uri']);
 
   if (!isset($params['upload_date'])) {
     $params['upload_date'] = date("Ymd");
   }
 
   $fileDAO = new CRM_Core_DAO_File();
-  $properties = array(
+  $properties = [
     'id',
     'file_type_id',
     'mime_type',
@@ -62,7 +62,7 @@ function civicrm_api3_file_create($params) {
     'document',
     'description',
     'upload_date',
-  );
+  ];
 
   foreach ($properties as $name) {
     if (array_key_exists($name, $params)) {
@@ -72,7 +72,7 @@ function civicrm_api3_file_create($params) {
 
   $fileDAO->save();
 
-  $file = array();
+  $file = [];
   _civicrm_api3_object_to_array($fileDAO, $file);
 
   return civicrm_api3_create_success($file, $params, 'File', 'create', $fileDAO);
@@ -114,7 +114,7 @@ function civicrm_api3_file_update($params) {
     }
     $fileDAO->save();
   }
-  $file = array();
+  $file = [];
   $cloneDAO = clone($fileDAO);
   _civicrm_api3_object_to_array($cloneDAO, $file);
   return $file;
@@ -130,7 +130,7 @@ function civicrm_api3_file_update($params) {
  */
 function civicrm_api3_file_delete($params) {
 
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
   if (CRM_Core_BAO_File::deleteEntityFile('*', $params['id'])) {
     return civicrm_api3_create_success();
   }
index 2200d258a51432965eb77348c1b4cb92a731e407..bbc58bfbd19c59fa488ab7b4a1d2009523591033 100644 (file)
  *   API success object
  */
 function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
-  static $results = array();
+  static $results = [];
   if ((CRM_Utils_Array::value('cache_clear', $apiRequest['params']))) {
-    $results = array();
+    $results = [];
     // we will also clear pseudoconstants here - should potentially be moved to relevant BAO classes
     CRM_Core_PseudoConstant::flush();
     if (!empty($apiRequest['params']['fieldname'])) {
       CRM_Utils_PseudoConstant::flushConstant($apiRequest['params']['fieldname']);
     }
     if (!empty($apiRequest['params']['option_group_id'])) {
-      $optionGroupName = civicrm_api('option_group', 'getvalue', array(
+      $optionGroupName = civicrm_api('option_group', 'getvalue', [
         'version' => 3,
         'id' => $apiRequest['params']['option_group_id'],
         'return' => 'name',
-      ));
+      ]);
       if (is_string($optionGroupName)) {
         CRM_Utils_PseudoConstant::flushConstant(_civicrm_api_get_camel_name($optionGroupName));
       }
@@ -79,8 +79,8 @@ function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
   $subentity    = CRM_Utils_Array::value('contact_type', $apiRequest['params']);
   $action = CRM_Utils_Array::value('action', $apiRequest['params']);
   $sequential = empty($apiRequest['params']['sequential']) ? 0 : 1;
-  $apiRequest['params']['options'] = CRM_Utils_Array::value('options', $apiRequest['params'], array());
-  $optionsToResolve = (array) CRM_Utils_Array::value('get_options', $apiRequest['params']['options'], array());
+  $apiRequest['params']['options'] = CRM_Utils_Array::value('options', $apiRequest['params'], []);
+  $optionsToResolve = (array) CRM_Utils_Array::value('get_options', $apiRequest['params']['options'], []);
 
   if (!$action || $action == 'getvalue' || $action == 'getcount') {
     $action = 'get';
@@ -110,7 +110,7 @@ function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
         if (!empty($metadata[strtolower($apiRequest['entity']) . '_id'])) {
           $metadata['id'] = $metadata[$lowercase_entity . '_id'];
           unset($metadata[$lowercase_entity . '_id']);
-          $metadata['id']['api.aliases'] = array($lowercase_entity . '_id');
+          $metadata['id']['api.aliases'] = [$lowercase_entity . '_id'];
         }
       }
       else {
@@ -119,49 +119,49 @@ function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
         // (note) or setting for all api where fields is returning 'id' & we want to accept 'note_id' @ the api layer
         // nb we don't officially accept note_id anyway - rationale here is more about centralising a now-tested
         // inconsistency
-        $metadata['id']['api.aliases'] = array($lowercase_entity . '_id');
+        $metadata['id']['api.aliases'] = [$lowercase_entity . '_id'];
       }
       break;
 
     case 'delete':
-      $metadata = array(
-        'id' => array(
+      $metadata = [
+        'id' => [
           'title' => $entity . ' ID',
           'api.required' => 1,
-          'api.aliases' => array($lowercase_entity . '_id'),
+          'api.aliases' => [$lowercase_entity . '_id'],
           'type' => CRM_Utils_Type::T_INT,
-        ));
+        ]];
       break;
 
     // Note: adding setvalue case here instead of in a generic spec function because
     // some APIs override the generic setvalue fn which causes the generic spec to be overlooked.
     case 'setvalue':
-      $metadata = array(
-        'field' => array(
+      $metadata = [
+        'field' => [
           'title' => 'Field name',
           'api.required' => 1,
           'type' => CRM_Utils_Type::T_STRING,
-        ),
-        'id' => array(
+        ],
+        'id' => [
           'title' => $entity . ' ID',
           'api.required' => 1,
           'type' => CRM_Utils_Type::T_INT,
-        ),
-        'value' => array(
+        ],
+        'value' => [
           'title' => 'Value',
           'description' => "Field value to set",
           'api.required' => 1,
-        ),
-      );
-      if (array_intersect(array('all', 'field'), $optionsToResolve)) {
-        $options = civicrm_api3_generic_getfields(array('entity' => $entity, array('params' => array('action' => 'create'))));
+        ],
+      ];
+      if (array_intersect(['all', 'field'], $optionsToResolve)) {
+        $options = civicrm_api3_generic_getfields(['entity' => $entity, ['params' => ['action' => 'create']]]);
         $metadata['field']['options'] = CRM_Utils_Array::collect('title', $options['values']);
       }
       break;
 
     default:
       // oddballs are on their own
-      $metadata = array();
+      $metadata = [];
   }
 
   // Hack for product api to pass tests.
@@ -171,7 +171,7 @@ function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
   }
 
   // find any supplemental information
-  $hypApiRequest = array('entity' => $apiRequest['entity'], 'action' => $action, 'version' => $apiRequest['version']);
+  $hypApiRequest = ['entity' => $apiRequest['entity'], 'action' => $action, 'version' => $apiRequest['version']];
   if ($action == 'getsingle') {
     $hypApiRequest['action'] = 'get';
   }
@@ -250,29 +250,29 @@ function civicrm_api3_generic_getfield($apiRequest) {
  * @throws \Exception
  */
 function _civicrm_api3_generic_getfield_spec(&$params, $apiRequest) {
-  $params = array(
-    'name' => array(
+  $params = [
+    'name' => [
       'title' => 'Field name',
       'description' => 'Name or alias of field to lookup',
       'api.required' => 1,
       'type' => CRM_Utils_Type::T_STRING,
-    ),
-    'action' => array(
+    ],
+    'action' => [
       'title' => 'API Action',
       'api.required' => 1,
       'type' => CRM_Utils_Type::T_STRING,
-      'api.aliases' => array('api_action'),
-    ),
-    'get_options' => array(
+      'api.aliases' => ['api_action'],
+    ],
+    'get_options' => [
       'title' => 'Get Options',
       'description' => 'Context for which to get field options, or null to skip fetching options.',
       'type' => CRM_Utils_Type::T_STRING,
       'options' => CRM_Core_DAO::buildOptionsContext(),
-      'api.aliases' => array('context'),
-    ),
-  );
+      'api.aliases' => ['context'],
+    ],
+  ];
   // Add available options to these params if requested
-  if (array_intersect(array('all', 'action'), $apiRequest['params']['options']['get_options'])) {
+  if (array_intersect(['all', 'action'], $apiRequest['params']['options']['get_options'])) {
     $actions = civicrm_api3($apiRequest['entity'], 'getactions');
     $actions = array_combine($actions['values'], $actions['values']);
     // Let's not go meta-crazy
@@ -323,7 +323,7 @@ function civicrm_api3_generic_getsingle($apiRequest) {
     return $result['values'][0];
   }
   if ($result['count'] !== 1) {
-    return civicrm_api3_create_error("Expected one " . $apiRequest['entity'] . " but found " . $result['count'], array('count' => $result['count']));
+    return civicrm_api3_create_error("Expected one " . $apiRequest['entity'] . " but found " . $result['count'], ['count' => $result['count']]);
   }
   return civicrm_api3_create_error("Undefined behavior");
 }
@@ -344,20 +344,20 @@ function civicrm_api3_generic_getvalue($apiRequest) {
     return $result;
   }
   if ($result['count'] !== 1) {
-    $result = civicrm_api3_create_error("Expected one " . $apiRequest['entity'] . " but found " . $result['count'], array('count' => $result['count']));
+    $result = civicrm_api3_create_error("Expected one " . $apiRequest['entity'] . " but found " . $result['count'], ['count' => $result['count']]);
     return $result;
   }
 
   // we only take "return=" as valid options
   if (!empty($apiRequest['params']['return'])) {
     if (!isset($result['values'][0][$apiRequest['params']['return']])) {
-      return civicrm_api3_create_error("field " . $apiRequest['params']['return'] . " unset or not existing", array('invalid_field' => $apiRequest['params']['return']));
+      return civicrm_api3_create_error("field " . $apiRequest['params']['return'] . " unset or not existing", ['invalid_field' => $apiRequest['params']['return']]);
     }
 
     return $result['values'][0][$apiRequest['params']['return']];
   }
 
-  return civicrm_api3_create_error("missing param return=field you want to read the value of", array('error_type' => 'mandatory_missing', 'missing_param' => 'return'));
+  return civicrm_api3_create_error("missing param return=field you want to read the value of", ['error_type' => 'mandatory_missing', 'missing_param' => 'return']);
 }
 
 /**
@@ -396,7 +396,7 @@ function civicrm_api3_generic_getrefcount($apiRequest) {
     return civicrm_api3_create_success($dao->getReferenceCounts());
   }
   else {
-    return civicrm_api3_create_success(array());
+    return civicrm_api3_create_success([]);
   }
 }
 
@@ -452,23 +452,23 @@ function civicrm_api3_generic_getoptions($apiRequest) {
  * @param $apiRequest
  */
 function _civicrm_api3_generic_getoptions_spec(&$params, $apiRequest) {
-  $params += array(
-    'field' => array(
+  $params += [
+    'field' => [
       'title' => 'Field name',
       'api.required' => 1,
       'type' => CRM_Utils_Type::T_STRING,
-    ),
-    'context' => array(
+    ],
+    'context' => [
       'title' => 'Context',
       'type' => CRM_Utils_Type::T_STRING,
       'options' => CRM_Core_DAO::buildOptionsContext(),
-    ),
-  );
+    ],
+  ];
 
   // Add available fields if requested
-  if (array_intersect(array('all', 'field'), $apiRequest['params']['options']['get_options'])) {
-    $fields = civicrm_api3_generic_getfields(array('entity' => $apiRequest['entity'], array('params' => array('action' => 'create'))));
-    $params['field']['options'] = array();
+  if (array_intersect(['all', 'field'], $apiRequest['params']['options']['get_options'])) {
+    $fields = civicrm_api3_generic_getfields(['entity' => $apiRequest['entity'], ['params' => ['action' => 'create']]]);
+    $params['field']['options'] = [];
     foreach ($fields['values'] as $name => $field) {
       if (isset($field['pseudoconstant']) || CRM_Utils_Array::value('type', $field) == CRM_Utils_Type::T_BOOLEAN) {
         $params['field']['options'][$name] = CRM_Utils_Array::value('title', $field, $name);
@@ -527,7 +527,7 @@ function _civicrm_api3_generic_get_metadata_options(&$metadata, $apiRequest, $fi
     }
   }
 
-  $options = civicrm_api($apiRequest['entity'], 'getoptions', array('version' => 3, 'field' => $fieldname, 'context' => $context));
+  $options = civicrm_api($apiRequest['entity'], 'getoptions', ['version' => 3, 'field' => $fieldname, 'context' => $context]);
   if (is_array(CRM_Utils_Array::value('values', $options))) {
     $metadata[$fieldname]['options'] = $options['values'];
   }
index 9502561c20c3c02819fa479b5ba0b5f621906402..084f3365d58c186634e4eaf3a65db1e6e61f17ae 100644 (file)
@@ -38,7 +38,7 @@
  * @throws API_Exception
  */
 function civicrm_api3_generic_getActions($apiRequest) {
-  civicrm_api3_verify_mandatory($apiRequest, NULL, array('entity'));
+  civicrm_api3_verify_mandatory($apiRequest, NULL, ['entity']);
   $mfp = \Civi::service('magic_function_provider');
   $actions = $mfp->getActionNames($apiRequest['version'], $apiRequest['entity']);
   return civicrm_api3_create_success($actions, $apiRequest['params'], $apiRequest['entity'], 'getactions');
index 1c9bd08af7f040bb6bc202e90d787c521f7d3ebf..332438f44f94659fe1c8167dfe2186d9f0f55c2b 100644 (file)
 function civicrm_api3_generic_getList($apiRequest) {
   $entity = _civicrm_api_get_entity_name_from_camel($apiRequest['entity']);
   $request = $apiRequest['params'];
-  $meta = civicrm_api3_generic_getfields(array('action' => 'get') + $apiRequest, FALSE);
+  $meta = civicrm_api3_generic_getfields(['action' => 'get'] + $apiRequest, FALSE);
 
   // Hey api, would you like to provide default values?
   $fnName = "_civicrm_api3_{$entity}_getlist_defaults";
-  $defaults = function_exists($fnName) ? $fnName($request) : array();
+  $defaults = function_exists($fnName) ? $fnName($request) : [];
   _civicrm_api3_generic_getList_defaults($entity, $request, $defaults, $meta['values']);
 
   // Hey api, would you like to format the search params?
@@ -61,7 +61,7 @@ function civicrm_api3_generic_getList($apiRequest) {
 
   _civicrm_api3_generic_getlist_postprocess($result, $request, $values);
 
-  $output = array('page_num' => $request['page_num']);
+  $output = ['page_num' => $request['page_num']];
 
   // Limit is set for searching but not fetching by id
   if (!empty($request['params']['options']['limit'])) {
@@ -83,26 +83,26 @@ function civicrm_api3_generic_getList($apiRequest) {
  * @param array $fields
  */
 function _civicrm_api3_generic_getList_defaults($entity, &$request, $apiDefaults, $fields) {
-  $defaults = array(
+  $defaults = [
     'page_num' => 1,
     'input' => '',
     'image_field' => NULL,
     'color_field' => isset($fields['color']) ? 'color' : NULL,
     'id_field' => $entity == 'option_value' ? 'value' : 'id',
-    'description_field' => array(),
+    'description_field' => [],
     'add_wildcard' => Civi::settings()->get('includeWildCardInName'),
-    'params' => array(),
-    'extra' => array(),
-  );
+    'params' => [],
+    'extra' => [],
+  ];
   // Find main field from meta
-  foreach (array('sort_name', 'title', 'label', 'name', 'subject') as $field) {
+  foreach (['sort_name', 'title', 'label', 'name', 'subject'] as $field) {
     if (isset($fields[$field])) {
       $defaults['label_field'] = $defaults['search_field'] = $field;
       break;
     }
   }
   // Find fields to be used for the description
-  foreach (array('description') as $field) {
+  foreach (['description'] as $field) {
     if (isset($fields[$field])) {
       $defaults['description_field'][] = $field;
     }
@@ -113,13 +113,13 @@ function _civicrm_api3_generic_getList_defaults($entity, &$request, $apiDefaults
   }
   $request += $apiDefaults + $defaults;
   // Default api params
-  $params = array(
+  $params = [
     'sequential' => 1,
-    'options' => array(),
-  );
+    'options' => [],
+  ];
   // When searching e.g. autocomplete
   if ($request['input']) {
-    $params[$request['search_field']] = array('LIKE' => ($request['add_wildcard'] ? '%' : '') . $request['input'] . '%');
+    $params[$request['search_field']] = ['LIKE' => ($request['add_wildcard'] ? '%' : '') . $request['input'] . '%'];
   }
   // When looking up a field e.g. displaying existing record
   if (!empty($request['id'])) {
@@ -129,18 +129,18 @@ function _civicrm_api3_generic_getList_defaults($entity, &$request, $apiDefaults
     // Don't run into search limits when prefilling selection
     $params['options']['limit'] = NULL;
     unset($params['options']['offset'], $request['params']['options']['limit'], $request['params']['options']['offset']);
-    $params[$request['id_field']] = is_array($request['id']) ? array('IN' => $request['id']) : $request['id'];
+    $params[$request['id_field']] = is_array($request['id']) ? ['IN' => $request['id']] : $request['id'];
   }
   $request['params'] += $params;
 
-  $request['params']['options'] += array(
+  $request['params']['options'] += [
     // Add pagination parameters
     'sort' => $request['label_field'],
     // Adding one extra result allows us to see if there are any more
     'limit' => $resultsPerPage + 1,
     // Because sql is zero-based
     'offset' => ($request['page_num'] - 1) * $resultsPerPage,
-  );
+  ];
 }
 
 /**
@@ -149,7 +149,7 @@ function _civicrm_api3_generic_getList_defaults($entity, &$request, $apiDefaults
  * @param array $request
  */
 function _civicrm_api3_generic_getlist_params(&$request) {
-  $fieldsToReturn = array($request['id_field'], $request['label_field']);
+  $fieldsToReturn = [$request['id_field'], $request['label_field']];
   if (!empty($request['image_field'])) {
     $fieldsToReturn[] = $request['image_field'];
   }
@@ -173,15 +173,15 @@ function _civicrm_api3_generic_getlist_params(&$request) {
  * @return array
  */
 function _civicrm_api3_generic_getlist_output($result, $request, $entity, $fields) {
-  $output = array();
+  $output = [];
   if (!empty($result['values'])) {
     foreach ($result['values'] as $row) {
-      $data = array(
+      $data = [
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
-      );
+      ];
       if (!empty($request['description_field'])) {
-        $data['description'] = array();
+        $data['description'] = [];
         foreach ((array) $request['description_field'] as $field) {
           if (!empty($row[$field])) {
             if (!isset($fields[$field]['pseudoconstant'])) {
@@ -217,7 +217,7 @@ function _civicrm_api3_generic_getlist_output($result, $request, $entity, $field
  * @param $values
  */
 function _civicrm_api3_generic_getlist_postprocess($result, $request, &$values) {
-  $chains = array();
+  $chains = [];
   foreach ($request['params'] as $field => $param) {
     if (substr($field, 0, 4) === 'api.') {
       $chains[] = $field;
@@ -242,49 +242,49 @@ function _civicrm_api3_generic_getlist_postprocess($result, $request, &$values)
  * @param array $apiRequest
  */
 function _civicrm_api3_generic_getlist_spec(&$params, $apiRequest) {
-  $params += array(
-    'page_num' => array(
+  $params += [
+    'page_num' => [
       'title' => 'Page Number',
       'description' => "Current page of a multi-page lookup",
       'type' => CRM_Utils_Type::T_INT,
-    ),
-    'input' => array(
+    ],
+    'input' => [
       'title' => 'Search Input',
       'description' => "String to search on",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-    'params' => array(
+    ],
+    'params' => [
       'title' => 'API Params',
       'description' => "Additional filters to send to the {$apiRequest['entity']} API.",
-    ),
-    'extra' => array(
+    ],
+    'extra' => [
       'title' => 'Extra',
       'description' => 'Array of additional fields to return.',
-    ),
-    'image_field' => array(
+    ],
+    'image_field' => [
       'title' => 'Image Field',
       'description' => "Field that this entity uses to store icons (usually automatic)",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-    'id_field' => array(
+    ],
+    'id_field' => [
       'title' => 'ID Field',
       'description' => "Field that uniquely identifies this entity (usually automatic)",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-    'description_field' => array(
+    ],
+    'description_field' => [
       'title' => 'Description Field',
       'description' => "Field that this entity uses to store summary text (usually automatic)",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-    'label_field' => array(
+    ],
+    'label_field' => [
       'title' => 'Label Field',
       'description' => "Field to display as title of results (usually automatic)",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-    'search_field' => array(
+    ],
+    'search_field' => [
       'title' => 'Search Field',
       'description' => "Field to search on (assumed to be the same as label field unless otherwise specified)",
       'type' => CRM_Utils_Type::T_TEXT,
-    ),
-  );
+    ],
+  ];
 }
index 23eed7dfce79372f8ff683297cbf24dfcb05fefc..56c83a89e7c0c335bd688b38795887cbf253e1cf 100644 (file)
@@ -38,7 +38,7 @@
  */
 function civicrm_api3_generic_getunique($apiRequest) {
   $entity = _civicrm_api_get_entity_name_from_camel($apiRequest['entity']);
-  $uniqueFields = array();
+  $uniqueFields = [];
 
   $dao = _civicrm_api3_get_DAO($entity);
   $uFields = $dao::indices();
index d6aecd798ecef61c968a1b2f44b71dc0b8ab01b1..b04b1242e3764e350d224d6af24a712182b4b6ee 100644 (file)
@@ -45,19 +45,19 @@ function civicrm_api3_generic_setValue($apiRequest) {
   $params = $apiRequest['params'];
   $id = $params['id'];
   if (!is_numeric($id)) {
-    return civicrm_api3_create_error(ts('Please enter a number'), array(
+    return civicrm_api3_create_error(ts('Please enter a number'), [
       'error_code' => 'NaN',
       'field' => "id",
-    ));
+    ]);
   }
 
   $field = CRM_Utils_String::munge($params['field']);
   $value = $params['value'];
 
-  $fields = civicrm_api($entity, 'getFields', array(
+  $fields = civicrm_api($entity, 'getFields', [
     'version' => 3,
     'action' => 'create',
-    "sequential")
+    "sequential"]
   );
   // getfields error, shouldn't happen.
   if ($fields['is_error']) {
@@ -69,7 +69,7 @@ function civicrm_api3_generic_setValue($apiRequest) {
   // Trim off the id portion of a multivalued custom field name
   $fieldKey = $isCustom && substr_count($field, '_') > 1 ? rtrim(rtrim($field, '1234567890'), '_') : $field;
   if (!array_key_exists($fieldKey, $fields)) {
-    return civicrm_api3_create_error("Param 'field' ($field) is invalid. must be an existing field", array("error_code" => "invalid_field", "fields" => array_keys($fields)));
+    return civicrm_api3_create_error("Param 'field' ($field) is invalid. must be an existing field", ["error_code" => "invalid_field", "fields" => array_keys($fields)]);
   }
 
   $def = $fields[$fieldKey];
@@ -78,27 +78,27 @@ function civicrm_api3_generic_setValue($apiRequest) {
   // TODO: create a utility for this since it's needed in many places
   if (!empty($def['required']) || !empty($def['is_required'])) {
     if ((empty($value) || $value === 'null') && $value !== '0' && $value !== 0) {
-      return civicrm_api3_create_error(ts('%1 is a required field.', array(1 => $title)), array("error_code" => "required", "field" => $field));
+      return civicrm_api3_create_error(ts('%1 is a required field.', [1 => $title]), ["error_code" => "required", "field" => $field]);
     }
   }
 
   switch ($def['type']) {
     case CRM_Utils_Type::T_FLOAT:
       if (!is_numeric($value) && !empty($value) && $value !== 'null') {
-        return civicrm_api3_create_error(ts('%1 must be a number.', array(1 => $title)), array('error_code' => 'NaN'));
+        return civicrm_api3_create_error(ts('%1 must be a number.', [1 => $title]), ['error_code' => 'NaN']);
       }
       break;
 
     case CRM_Utils_Type::T_INT:
       if (!CRM_Utils_Rule::integer($value) && !empty($value) && $value !== 'null') {
-        return civicrm_api3_create_error(ts('%1 must be a number.', array(1 => $title)), array('error_code' => 'NaN'));
+        return civicrm_api3_create_error(ts('%1 must be a number.', [1 => $title]), ['error_code' => 'NaN']);
       }
       break;
 
     case CRM_Utils_Type::T_STRING:
     case CRM_Utils_Type::T_TEXT:
       if (!CRM_Utils_Rule::xssString($value)) {
-        return civicrm_api3_create_error(ts('Illegal characters in input (potential scripting attack)'), array('error_code' => 'XSS'));
+        return civicrm_api3_create_error(ts('Illegal characters in input (potential scripting attack)'), ['error_code' => 'XSS']);
       }
       if (array_key_exists('maxlength', $def)) {
         $value = substr($value, 0, $def['maxlength']);
@@ -123,11 +123,11 @@ function civicrm_api3_generic_setValue($apiRequest) {
       break;
 
     default:
-      return civicrm_api3_create_error("Param '$field' is of a type not managed yet (" . $def['type'] . "). Join the API team and help us implement it", array('error_code' => 'NOT_IMPLEMENTED'));
+      return civicrm_api3_create_error("Param '$field' is of a type not managed yet (" . $def['type'] . "). Join the API team and help us implement it", ['error_code' => 'NOT_IMPLEMENTED']);
   }
 
   $dao_name = _civicrm_api3_get_DAO($entity);
-  $params = array('id' => $id, $field => $value);
+  $params = ['id' => $id, $field => $value];
 
   if ((!empty($def['pseudoconstant']) || !empty($def['option_group_id'])) && $value !== '' && $value !== 'null') {
     _civicrm_api3_api_match_pseudoconstant($params[$field], $entity, $field, $def);
index 0ba2aafb29fa7cad3596c651d64c452e5f53debd..0fea3ac47256360a081c5aec0784f03db9ad97d6 100644 (file)
@@ -64,7 +64,7 @@ function civicrm_api3_generic_update($apiRequest) {
   if (strtolower($apiRequest['entity']) == 'contribution') {
     return civicrm_api($apiRequest['entity'], 'create', $apiRequest['params']);
   }
-  $seek = array($key_id => $apiRequest['params'][$key_id], 'version' => $apiRequest['version']);
+  $seek = [$key_id => $apiRequest['params'][$key_id], 'version' => $apiRequest['version']];
   $existing = civicrm_api($apiRequest['entity'], 'get', $seek);
   if ($existing['is_error']) {
     return $existing;
index 32a5fa4a97b8bda205def45270c4b6dfccf47eb3..ad000b7004edf8682d703854476d6ef49e61b8f5 100644 (file)
@@ -58,7 +58,7 @@ function _civicrm_api3_grant_create_spec(&$params) {
   $params['grant_type_id']['api.required'] = 1;
   $params['status_id']['api.required'] = 1;
   $params['amount_total']['api.required'] = 1;
-  $params['status_id']['api.aliases'] = array('grant_status');
+  $params['status_id']['api.aliases'] = ['grant_status'];
 }
 
 /**
index 8b97db785e26ff47568bcadde2412afe907f937d..6b9dba3ea3694e526b50d805b42be41faa81faa5 100644 (file)
@@ -98,7 +98,7 @@ function civicrm_api3_group_get($params) {
  * @throws API_Exception
  */
 function civicrm_api3_group_delete($params) {
-  $group = civicrm_api3_group_get(array('id' => $params['id']));
+  $group = civicrm_api3_group_get(['id' => $params['id']]);
   if ($group['count'] == 0) {
     throw new API_Exception('Could not delete group ' . $params['id']);
   }
index 3b8aba14928c9ad004bdcc14e7bd0a66dbd1f5f1..e36fed2e5a8770c7159bc4813fc4d1fe39c57afa 100644 (file)
@@ -125,7 +125,7 @@ function _civicrm_api3_group_contact_create_spec(&$params) {
 function civicrm_api3_group_contact_create($params) {
   // Nonstandard bao - doesn't accept ID as a param, so convert id to group_id + contact_id
   if (!empty($params['id'])) {
-    $getParams = array('id' => $params['id']);
+    $getParams = ['id' => $params['id']];
     $info = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $getParams);
     if (!empty($info['values'][$params['id']])) {
       $params['group_id'] = $info['values'][$params['id']]['group_id'];
@@ -147,18 +147,18 @@ function civicrm_api3_group_contact_create($params) {
  */
 function civicrm_api3_group_contact_delete($params) {
   $checkParams = $params;
-  if (!empty($checkParams['status']) && in_array($checkParams['status'], array('Removed', 'Deleted'))) {
-    $checkParams['status'] = array('IN' => array('Added', 'Pending'));
+  if (!empty($checkParams['status']) && in_array($checkParams['status'], ['Removed', 'Deleted'])) {
+    $checkParams['status'] = ['IN' => ['Added', 'Pending']];
   }
   elseif (!empty($checkParams['status']) && $checkParams['status'] == 'Added') {
-    $checkParams['status'] = array('IN' => array('Pending', 'Removed'));
+    $checkParams['status'] = ['IN' => ['Pending', 'Removed']];
   }
   elseif (!empty($checkParams['status'])) {
     unset($checkParams['status']);
   }
   $groupContact = civicrm_api3('GroupContact', 'get', $checkParams);
   if ($groupContact['count'] == 0 && !empty($params['skip_undelete'])) {
-    $checkParams['status'] = array('IN' => array('Removed', 'Pending'));
+    $checkParams['status'] = ['IN' => ['Removed', 'Pending']];
   }
   $groupContact2 = civicrm_api3('GroupContact', 'get', $checkParams);
   if ($groupContact['count'] == 0 && $groupContact2['count'] == 0) {
@@ -205,8 +205,8 @@ function civicrm_api3_group_contact_pending($params) {
  */
 function _civicrm_api3_group_contact_common($params, $op = 'Added') {
 
-  $contactIDs = array();
-  $groupIDs = array();
+  $contactIDs = [];
+  $groupIDs = [];
 
   // CRM-16959: Handle multiple Contact IDs and Group IDs in legacy format
   // (contact_id.1, contact_id.2) or as an array
@@ -238,11 +238,11 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') {
   $tracking = CRM_Utils_Array::value('tracking', $params);
 
   if ($op == 'Added' || $op == 'Pending') {
-    $extraReturnValues = array(
+    $extraReturnValues = [
       'total_count' => 0,
       'added' => 0,
       'not_added' => 0,
-    );
+    ];
     foreach ($groupIDs as $groupID) {
       list($tc, $a, $na) = CRM_Contact_BAO_GroupContact::addContactsToGroup($contactIDs,
         $groupID,
@@ -256,11 +256,11 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') {
     }
   }
   else {
-    $extraReturnValues = array(
+    $extraReturnValues = [
       'total_count' => 0,
       'removed' => 0,
       'not_removed' => 0,
-    );
+    ];
     foreach ($groupIDs as $groupID) {
       list($tc, $r, $nr) = CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactIDs, $groupID, $method, $status, $tracking);
       $extraReturnValues['total_count'] += $tc;
@@ -285,10 +285,10 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') {
  */
 function civicrm_api3_group_contact_update_status($params) {
 
-  civicrm_api3_verify_mandatory($params, NULL, array('contact_id', 'group_id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['contact_id', 'group_id']);
 
   CRM_Contact_BAO_GroupContact::addContactsToGroup(
-    array($params['contact_id']),
+    [$params['contact_id']],
     $params['group_id'],
     CRM_Utils_Array::value('method', $params, 'API'),
     'Added',
@@ -306,9 +306,9 @@ function civicrm_api3_group_contact_update_status($params) {
  *   Array of deprecated actions
  */
 function _civicrm_api3_group_contact_deprecation() {
-  return array(
+  return [
     'delete' => 'GroupContact "delete" action is deprecated in favor of "create".',
     'pending' => 'GroupContact "pending" action is deprecated in favor of "create".',
     'update_status' => 'GroupContact "update_status" action is deprecated in favor of "create".',
-  );
+  ];
 }
index dd4a4a5c265a56785c6417333c2273454f89b19a..0c28926fe3006132679a2f7ba0a791c53103a852 100644 (file)
@@ -93,7 +93,7 @@ function civicrm_api3_job_clone($params) {
   $params['last_run'] = 'null';
   $params['scheduled_run_date'] = 'null';
   $newJobDAO = CRM_Core_BAO_Job::copy($id, $params);
-  return civicrm_api3('Job', 'get', array('id' => $newJobDAO->id));
+  return civicrm_api3('Job', 'get', ['id' => $newJobDAO->id]);
 }
 
 /**
@@ -174,27 +174,27 @@ function civicrm_api3_job_geocode($params) {
  * @param array $params
  */
 function _civicrm_api3_job_geocode_spec(&$params) {
-  $params['start'] = array(
+  $params['start'] = [
     'title' => 'Starting Contact ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['end'] = array(
+  ];
+  $params['end'] = [
     'title' => 'Ending Contact ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['geocoding'] = array(
+  ];
+  $params['geocoding'] = [
     'title' => 'Geocode address?',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['parse'] = array(
+  ];
+  $params['parse'] = [
     'title' => 'Parse street address?',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['throttle'] = array(
+  ];
+  $params['throttle'] = [
     'title' => 'Throttle?',
     'description' => 'If enabled, geo-codes at a slow rate',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -239,10 +239,10 @@ function civicrm_api3_job_send_reminder($params) {
 function _civicrm_api3_job_send_reminder(&$params) {
   //@todo this function will now take all fields in action_schedule as params
   // as it is calling the api fn to set the filters - update getfields to reflect
-  $params['id'] = array(
+  $params['id'] = [
     'type' => CRM_Utils_Type::T_INT,
     'title' => 'Action Schedule ID',
-  );
+  ];
 }
 /**
  * Execute a specific report instance and send the output via email.
@@ -306,16 +306,16 @@ function civicrm_api3_job_update_greeting($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_job_update_greeting_spec(&$params) {
-  $params['ct'] = array(
+  $params['ct'] = [
     'api.required' => 1,
     'title' => 'Contact Type',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['gt'] = array(
+  ];
+  $params['gt'] = [
     'api.required' => 1,
     'title' => 'Greeting Type',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
 
 /**
@@ -360,9 +360,9 @@ function civicrm_api3_job_process_mailing($params) {
     return civicrm_api3_create_error('Process Queue failed');
   }
   else {
-    $values = array(
+    $values = [
       'processed' => CRM_Mailing_BAO_MailingJob::$mailsProcessed - $mailsProcessedOrig,
-    );
+    ];
     return civicrm_api3_create_success($values, $params, 'Job', 'process_mailing');
   }
 }
@@ -381,9 +381,9 @@ function civicrm_api3_job_process_sms($params) {
     return civicrm_api3_create_error('Process Queue failed');
   }
   else {
-    $values = array(
+    $values = [
       'processed' => CRM_Mailing_BAO_MailingJob::$mailsProcessed - $mailsProcessedOrig,
-    );
+    ];
     return civicrm_api3_create_success($values, $params, 'Job', 'process_sms');
   }
 }
@@ -412,11 +412,11 @@ function civicrm_api3_job_fetch_bounces($params) {
  * @param array $params
  */
 function _civicrm_api3_job_fetch_bounces_spec(&$params) {
-  $params['is_create_activities'] = array(
+  $params['is_create_activities'] = [
     'api.default' => 0,
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'title' => ts('Create activities for replies?'),
-  );
+  ];
 }
 
 /**
@@ -434,7 +434,7 @@ function civicrm_api3_job_fetch_activities($params) {
 
   try {
     CRM_Utils_Mail_EmailProcessor::processActivities();
-    $values = array();
+    $values = [];
     $lock->release();
     return civicrm_api3_create_success($values, $params, 'Job', 'fetch_activities');
   }
@@ -529,18 +529,18 @@ function civicrm_api3_job_process_respondent($params) {
 function civicrm_api3_job_process_batch_merge($params) {
   $rule_group_id = CRM_Utils_Array::value('rule_group_id', $params);
   if (!$rule_group_id) {
-    $rule_group_id = civicrm_api3('RuleGroup', 'getvalue', array(
+    $rule_group_id = civicrm_api3('RuleGroup', 'getvalue', [
       'contact_type' => 'Individual',
       'used' => 'Unsupervised',
       'return' => 'id',
-      'options' => array('limit' => 1),
-    ));
+      'options' => ['limit' => 1],
+    ]);
   }
   $rgid = CRM_Utils_Array::value('rgid', $params);
   $gid = CRM_Utils_Array::value('gid', $params);
   $mode = CRM_Utils_Array::value('mode', $params, 'safe');
 
-  $result = CRM_Dedupe_Merger::batchMerge($rule_group_id, $gid, $mode, 1, 2, CRM_Utils_Array::value('criteria', $params, array()), CRM_Utils_Array::value('check_permissions', $params));
+  $result = CRM_Dedupe_Merger::batchMerge($rule_group_id, $gid, $mode, 1, 2, CRM_Utils_Array::value('criteria', $params, []), CRM_Utils_Array::value('check_permissions', $params));
 
   return civicrm_api3_create_success($result, $params);
 }
@@ -551,25 +551,25 @@ function civicrm_api3_job_process_batch_merge($params) {
  * @param $params
  */
 function _civicrm_api3_job_process_batch_merge_spec(&$params) {
-  $params['rule_group_id'] = array(
+  $params['rule_group_id'] = [
     'title' => 'Dedupe rule group id, defaults to Contact Unsupervised rule',
     'type' => CRM_Utils_Type::T_INT,
-    'api.aliases' => array('rgid'),
-  );
-  $params['gid'] = array(
+    'api.aliases' => ['rgid'],
+  ];
+  $params['gid'] = [
     'title' => 'group id',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['mode'] = array(
+  ];
+  $params['mode'] = [
     'title' => 'Mode',
     'description' => 'helps decide how to behave when there are conflicts. A \'safe\' value skips the merge if there are no conflicts. Does a force merge otherwise.',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['auto_flip'] = array(
+  ];
+  $params['auto_flip'] = [
     'title' => 'Auto Flip',
     'description' => 'let the api decide which contact to retain and which to delete?',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -589,9 +589,9 @@ function civicrm_api3_job_run_payment_cron($params) {
     'PaymentCron',
     array_merge(
       $params,
-      array(
+      [
         'caller' => 'api',
-      )
+      ]
     )
   );
 
@@ -600,9 +600,9 @@ function civicrm_api3_job_run_payment_cron($params) {
     'PaymentCron',
     array_merge(
       $params,
-      array(
+      [
         'mode' => 'test',
-      )
+      ]
     )
   );
 }
index f1a64ad47bbaf484e95af6c8d6bcc5583595db02..5f9b1ce9e48d9c67a0617f163b6d810dcf2d7592 100644 (file)
@@ -43,8 +43,8 @@
  * @throws \API_Exception
  */
 function civicrm_api3_loc_block_create($params) {
-  $entities = array();
-  $any_mandatory = array(
+  $entities = [];
+  $any_mandatory = [
     'address',
     'address_id',
     'phone',
@@ -53,14 +53,14 @@ function civicrm_api3_loc_block_create($params) {
     'im_id',
     'email',
     'email_id',
-  );
+  ];
   civicrm_api3_verify_one_mandatory($params, NULL, $any_mandatory);
   // Call the appropriate api to create entities if any are passed in the params.
   // This is basically chaining but in reverse - we create the sub-entities first
   // because chaining does not work in reverse, or with keys like 'email_2'.
-  $items = array('address', 'email', 'phone', 'im');
+  $items = ['address', 'email', 'phone', 'im'];
   foreach ($items as $item) {
-    foreach (array('', '_2') as $suf) {
+    foreach (['', '_2'] as $suf) {
       $key = $item . $suf;
       if (!empty($params[$key]) && is_array($params[$key])) {
         $info = $params[$key];
@@ -82,7 +82,7 @@ function civicrm_api3_loc_block_create($params) {
   $dao->copyValues($params);
   $dao->save();
   if (!empty($dao->id)) {
-    $values = array($dao->id => $entities);
+    $values = [$dao->id => $entities];
     _civicrm_api3_object_to_array($dao, $values[$dao->id]);
     return civicrm_api3_create_success($values, $params, 'LocBlock', 'create', $dao);
   }
@@ -105,15 +105,15 @@ function civicrm_api3_loc_block_get($params) {
   // This is a helper because api chaining does not work with a key like 'email_2'.
   if (!empty($options['return'])) {
     unset($params['return']);
-    $values = array();
-    $items = array('address', 'email', 'phone', 'im');
+    $values = [];
+    $items = ['address', 'email', 'phone', 'im'];
     $returnAll = !empty($options['return']['all']);
     foreach (_civicrm_api3_basic_get('CRM_Core_DAO_LocBlock', $params, FALSE) as $val) {
       foreach ($items as $item) {
-        foreach (array('', '_2') as $suf) {
+        foreach (['', '_2'] as $suf) {
           $key = $item . $suf;
           if (!empty($val[$key . '_id']) && ($returnAll || !empty($options['return'][$key]))) {
-            $val[$key] = civicrm_api($item, 'getsingle', array('version' => 3, 'id' => $val[$key . '_id']));
+            $val[$key] = civicrm_api($item, 'getsingle', ['version' => 3, 'id' => $val[$key . '_id']]);
           }
         }
       }
index fb747abf40e8b36011554dca63a4fbe3aba46383..22ebe9bd3927ad977becb325b11c3f00426b0d55 100644 (file)
@@ -59,27 +59,27 @@ function civicrm_api3_logging_revert($params) {
  * @throws \Civi\API\Exception\UnauthorizedException
  */
 function _civicrm_api3_logging_revert_spec(&$params) {
-  $params['log_conn_id'] = array(
+  $params['log_conn_id'] = [
     'title' => 'Logging Connection ID',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => TRUE,
-  );
-  $params['log_date'] = array(
+  ];
+  $params['log_date'] = [
     'title' => 'Logging Timestamp',
     'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
-  );
-  $params['interval'] = array(
+  ];
+  $params['interval'] = [
     'title' => ts('Interval (required if date is included)'),
     'type' => CRM_Utils_Type::T_STRING,
     'api.default' => '10 SECOND',
     'description' => ts('Used when log_date is passed in'),
-  );
+  ];
 
-  $params['tables'] = array(
+  $params['tables'] = [
     'title' => ts('Tables to revert'),
     'type' => CRM_Utils_Type::T_STRING,
     'description' => ts('Tables to revert, if not set all contact-referring entities will be reverted'),
-  );
+  ];
 }
 
 /**
@@ -109,24 +109,24 @@ function civicrm_api3_logging_get($params) {
  * @throws \Civi\API\Exception\UnauthorizedException
  */
 function _civicrm_api3_logging_get_spec(&$params) {
-  $params['log_conn_id'] = array(
+  $params['log_conn_id'] = [
     'title' => 'Logging Connection ID',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => TRUE,
-  );
-  $params['log_date'] = array(
+  ];
+  $params['log_date'] = [
     'title' => 'Logging Timestamp',
     'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
-  );
-  $params['interval'] = array(
+  ];
+  $params['interval'] = [
     'title' => ts('Interval (required if date is included)'),
     'type' => CRM_Utils_Type::T_STRING,
     'api.default' => '10 SECOND',
     'description' => ts('Used when log_date is passed in'),
-  );
-  $params['tables'] = array(
+  ];
+  $params['tables'] = [
     'title' => ts('Tables to query'),
     'type' => CRM_Utils_Type::T_STRING,
     'description' => ts('Tables to query, if not set all contact-referring entities will be queried'),
-  );
+  ];
 }
index c0956ef13e888ccdeeff13e8dc1880bf7e172654..38ebc4161edf3ad51bd28d0f875b6257d135622b 100644 (file)
@@ -44,7 +44,7 @@
  */
 function civicrm_api3_mailing_create($params) {
   if (isset($params['template_options']) && is_array($params['template_options'])) {
-    $params['template_options'] = ($params['template_options'] === array()) ? '{}' : json_encode($params['template_options']);
+    $params['template_options'] = ($params['template_options'] === []) ? '{}' : json_encode($params['template_options']);
   }
   if (CRM_Mailing_Info::workflowEnabled()) {
     // Note: 'schedule mailings' and 'approve mailings' can update certain fields, but can't create.
@@ -55,7 +55,7 @@ function civicrm_api3_mailing_create($params) {
       }
     }
 
-    $safeParams = array();
+    $safeParams = [];
     $fieldPerms = CRM_Mailing_BAO_Mailing::getWorkflowFieldPerms();
     foreach (array_keys($params) as $field) {
       if (CRM_Core_Permission::check($fieldPerms[$field])) {
@@ -94,7 +94,7 @@ function civicrm_api3_mailing_create($params) {
  * @throws \API_Exception
  */
 function civicrm_api3_mailing_gettokens($params) {
-  $tokens = array();
+  $tokens = [];
   foreach ((array) $params['entity'] as $ent) {
     $func = lcfirst($ent) . 'Tokens';
     if (!method_exists('CRM_Core_SelectValues', $func)) {
@@ -117,13 +117,13 @@ function civicrm_api3_mailing_gettokens($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_gettokens_spec(&$params) {
-  $params['entity'] = array(
-    'api.default' => array('contact'),
+  $params['entity'] = [
+    'api.default' => ['contact'],
     'api.required' => 1,
     'api.multiple' => 1,
     'title' => 'Entity',
-    'options' => array(),
-  );
+    'options' => [],
+  ];
   // Fetch a list of token functions and format to look like entity names
   foreach (get_class_methods('CRM_Core_SelectValues') as $func) {
     if (strpos($func, 'Tokens')) {
@@ -189,7 +189,7 @@ function _civicrm_api3_mailing_clone_spec(&$spec) {
  * @throws \CiviCRM_API3_Exception
  */
 function civicrm_api3_mailing_clone($params) {
-  $BLACKLIST = array(
+  $BLACKLIST = [
     'id',
     'is_completed',
     'created_id',
@@ -203,16 +203,16 @@ function civicrm_api3_mailing_clone($params) {
     'is_archived',
     'hash',
     'mailing_type',
-  );
+  ];
 
-  $get = civicrm_api3('Mailing', 'getsingle', array('id' => $params['id']));
+  $get = civicrm_api3('Mailing', 'getsingle', ['id' => $params['id']]);
 
-  $newParams = array();
+  $newParams = [];
   $newParams['debug'] = CRM_Utils_Array::value('debug', $params);
-  $newParams['groups']['include'] = array();
-  $newParams['groups']['exclude'] = array();
-  $newParams['mailings']['include'] = array();
-  $newParams['mailings']['exclude'] = array();
+  $newParams['groups']['include'] = [];
+  $newParams['groups']['exclude'] = [];
+  $newParams['mailings']['include'] = [];
+  $newParams['mailings']['exclude'] = [];
   foreach ($get as $field => $value) {
     if (!in_array($field, $BLACKLIST)) {
       $newParams[$field] = $value;
@@ -298,7 +298,7 @@ function _civicrm_api3_mailing_submit_spec(&$spec) {
  * @throws API_Exception
  */
 function civicrm_api3_mailing_submit($params) {
-  civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_Mailing', array('id'));
+  civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_Mailing', ['id']);
 
   if (!isset($params['scheduled_date']) && !isset($updateParams['approval_date'])) {
     throw new API_Exception("Missing parameter scheduled_date and/or approval_date");
@@ -307,7 +307,7 @@ function civicrm_api3_mailing_submit($params) {
     throw new API_Exception("Failed to determine current user");
   }
 
-  $updateParams = array();
+  $updateParams = [];
   $updateParams['id'] = $params['id'];
 
   // Note: we'll pass along scheduling/approval fields, but they may get ignored
@@ -394,7 +394,7 @@ function civicrm_api3_mailing_event_confirm($params) {
  *   Array of deprecated actions
  */
 function _civicrm_api3_mailing_deprecation() {
-  return array('event_confirm' => 'Mailing api "event_confirm" action is deprecated. Use the mailing_event_confirm api instead.');
+  return ['event_confirm' => 'Mailing api "event_confirm" action is deprecated. Use the mailing_event_confirm api instead.'];
 }
 
 /**
@@ -496,7 +496,7 @@ function _civicrm_api3_mailing_event_forward_spec(&$params) {
 function civicrm_api3_mailing_event_click($params) {
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_Event_DAO_TrackableURLOpen',
-    array('event_queue_id', 'url_id'),
+    ['event_queue_id', 'url_id'],
     FALSE
   );
 
@@ -505,7 +505,7 @@ function civicrm_api3_mailing_event_click($params) {
 
   $url = CRM_Mailing_Event_BAO_TrackableURLOpen::track($queue, $url_id);
 
-  $values             = array();
+  $values             = [];
   $values['url']      = $url;
   $values['is_error'] = 0;
 
@@ -523,7 +523,7 @@ function civicrm_api3_mailing_event_open($params) {
 
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_Event_DAO_Opened',
-    array('event_queue_id'),
+    ['event_queue_id'],
     FALSE
   );
 
@@ -574,7 +574,7 @@ function civicrm_api3_mailing_preview($params) {
   if (!$contactID) {
     $contactID = $session->get('userID');
   }
-  $mailingParams = array('contact_id' => $contactID);
+  $mailingParams = ['contact_id' => $contactID];
 
   $details = CRM_Utils_Token::getTokenDetails($mailingParams, $returnProperties, TRUE, TRUE, NULL, $mailing->getFlattenedTokens());
 
@@ -582,13 +582,13 @@ function civicrm_api3_mailing_preview($params) {
     TRUE, $details[0][$contactID], $attachments
   );
 
-  return civicrm_api3_create_success(array(
+  return civicrm_api3_create_success([
     'id' => $params['id'],
     'contact_id' => $contactID,
     'subject' => $mime->headers()['Subject'],
     'body_html' => $mime->getHTMLBody(),
     'body_text' => $mime->getTXTBody(),
-  ));
+  ]);
 }
 
 /**
@@ -618,7 +618,7 @@ function civicrm_api3_mailing_send_test($params) {
   }
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_DAO_MailingJob',
-    array('mailing_id'),
+    ['mailing_id'],
     FALSE
   );
 
@@ -635,25 +635,25 @@ function civicrm_api3_mailing_send_test($params) {
   $testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', strtolower($testEmailParams['test_email'])) : NULL;
   if (!empty($params['test_email'])) {
     $query = CRM_Utils_SQL_Select::from('civicrm_email e')
-        ->select(array('e.id', 'e.contact_id', 'e.email'))
+        ->select(['e.id', 'e.contact_id', 'e.email'])
         ->join('c', 'INNER JOIN civicrm_contact c ON e.contact_id = c.id')
-        ->where('e.email IN (@emails)', array('@emails' => $testEmailParams['emails']))
+        ->where('e.email IN (@emails)', ['@emails' => $testEmailParams['emails']])
         ->where('e.on_hold = 0')
         ->where('c.is_opt_out = 0')
         ->where('c.do_not_email = 0')
         ->where('c.is_deceased = 0')
         ->where('c.is_deleted = 0')
         ->groupBy('e.id')
-        ->orderBy(array('e.is_bulkmail DESC', 'e.is_primary DESC'))
+        ->orderBy(['e.is_bulkmail DESC', 'e.is_primary DESC'])
         ->toSQL();
     $dao = CRM_Core_DAO::executeQuery($query);
-    $emailDetail = array();
+    $emailDetail = [];
     // fetch contact_id and email id for all existing emails
     while ($dao->fetch()) {
-      $emailDetail[strtolower($dao->email)] = array(
+      $emailDetail[strtolower($dao->email)] = [
         'contact_id' => $dao->contact_id,
         'email_id' => $dao->id,
-      );
+      ];
     }
     foreach ($testEmailParams['emails'] as $key => $email) {
       $email = trim($email);
@@ -665,21 +665,21 @@ function civicrm_api3_mailing_send_test($params) {
       if (!$contactId) {
         //create new contact.
         $contact   = civicrm_api3('Contact', 'create',
-          array(
+          [
             'contact_type' => 'Individual',
             'email' => $email,
-            'api.Email.get' => array('return' => 'id'),
-          )
+            'api.Email.get' => ['return' => 'id'],
+          ]
         );
         $contactId = $contact['id'];
         $emailId   = $contact['values'][$contactId]['api.Email.get']['id'];
       }
       civicrm_api3('MailingEventQueue', 'create',
-        array(
+        [
           'job_id' => $job['id'],
           'email_id' => $emailId,
           'contact_id' => $contactId,
-        )
+        ]
       );
     }
   }
@@ -726,7 +726,7 @@ function _civicrm_api3_mailing_stats_spec(&$params) {
 function civicrm_api3_mailing_stats($params) {
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_DAO_MailingJob',
-    array('mailing_id'),
+    ['mailing_id'],
     FALSE
   );
 
@@ -737,40 +737,40 @@ function civicrm_api3_mailing_stats($params) {
     $params['date'] = CRM_Utils_Date::processDate($params['date'] . ' ' . $params['date_time']);
   }
 
-  $stats[$params['mailing_id']] = array();
+  $stats[$params['mailing_id']] = [];
   if (empty($params['job_id'])) {
     $params['job_id'] = NULL;
   }
-  foreach (array('Delivered', 'Bounces', 'Unsubscribers', 'Unique Clicks', 'Opened') as $detail) {
+  foreach (['Delivered', 'Bounces', 'Unsubscribers', 'Unique Clicks', 'Opened'] as $detail) {
     switch ($detail) {
       case 'Delivered':
-        $stats[$params['mailing_id']] += array(
+        $stats[$params['mailing_id']] += [
           $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], (bool) $params['is_distinct'], $params['date']),
-        );
+        ];
         break;
 
       case 'Bounces':
-        $stats[$params['mailing_id']] += array(
+        $stats[$params['mailing_id']] += [
           $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], (bool) $params['is_distinct'], $params['date']),
-        );
+        ];
         break;
 
       case 'Unsubscribers':
-        $stats[$params['mailing_id']] += array(
+        $stats[$params['mailing_id']] += [
           $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], (bool) $params['is_distinct'], NULL, $params['date']),
-        );
+        ];
         break;
 
       case 'Unique Clicks':
-        $stats[$params['mailing_id']] += array(
+        $stats[$params['mailing_id']] += [
           $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], (bool) $params['is_distinct'], NULL, $params['date']),
-        );
+        ];
         break;
 
       case 'Opened':
-        $stats[$params['mailing_id']] += array(
+        $stats[$params['mailing_id']] += [
           $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], (bool) $params['is_distinct'], $params['date']),
-        );
+        ];
         break;
     }
   }
index 2d0718d12736ffab2b1e7584ef5bf1cb984c708d..2ef7637d373e19e8714ece9f915b05e2b1f9d569 100644 (file)
@@ -107,7 +107,7 @@ function _civicrm_api3_mailing_a_b_submit_spec(&$spec) {
  * @throws API_Exception
  */
 function civicrm_api3_mailing_a_b_submit($params) {
-  civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingAB', array('id', 'status'));
+  civicrm_api3_verify_mandatory($params, 'CRM_Mailing_DAO_MailingAB', ['id', 'status']);
 
   if (!isset($params['scheduled_date']) && !isset($updateParams['approval_date'])) {
     throw new API_Exception("Missing parameter scheduled_date and/or approval_date");
@@ -122,26 +122,26 @@ function civicrm_api3_mailing_a_b_submit($params) {
     throw new API_Exception("Missing mailing IDs for A/B test");
   }
 
-  $submitParams = CRM_Utils_Array::subset($params, array(
+  $submitParams = CRM_Utils_Array::subset($params, [
     'scheduled_date',
     'approval_date',
     'approval_note',
     'approval_status_id',
-  ));
+  ]);
 
   switch ($params['status']) {
     case 'Testing':
       if (!empty($dao->status) && $dao->status != 'Draft') {
         throw new API_Exception("Cannot transition to state 'Testing'");
       }
-      civicrm_api3('Mailing', 'submit', $submitParams + array(
+      civicrm_api3('Mailing', 'submit', $submitParams + [
           'id' => $dao->mailing_id_a,
           '_skip_evil_bao_auto_recipients_' => 0,
-        ));
-      civicrm_api3('Mailing', 'submit', $submitParams + array(
+        ]);
+      civicrm_api3('Mailing', 'submit', $submitParams + [
           'id' => $dao->mailing_id_b,
           '_skip_evil_bao_auto_recipients_' => 1,
-        ));
+        ]);
       CRM_Mailing_BAO_MailingAB::distributeRecipients($dao);
       break;
 
@@ -149,23 +149,23 @@ function civicrm_api3_mailing_a_b_submit($params) {
       if ($dao->status != 'Testing') {
         throw new API_Exception("Cannot transition to state 'Final'");
       }
-      civicrm_api3('Mailing', 'submit', $submitParams + array(
+      civicrm_api3('Mailing', 'submit', $submitParams + [
           'id' => $dao->mailing_id_c,
           '_skip_evil_bao_auto_recipients_' => 1,
-        ));
+        ]);
       break;
 
     default:
       throw new API_Exception("Unrecognized submission status");
   }
 
-  return civicrm_api3('MailingAB', 'create', array(
+  return civicrm_api3('MailingAB', 'create', [
     'id' => $dao->id,
     'status' => $params['status'],
-    'options' => array(
+    'options' => [
       'reload' => 1,
-    ),
-  ));
+    ],
+  ]);
 }
 
 /**
@@ -177,20 +177,20 @@ function civicrm_api3_mailing_a_b_submit($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_a_b_graph_stats_spec(&$params) {
-  $params['criteria'] = array(
+  $params['criteria'] = [
     'title' => 'Criteria',
     'default' => 'Open',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 
   // mailing_ab_winner_criteria
   $params['target_date']['title'] = 'Target Date';
   $params['target_date']['type'] = CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME;
-  $params['split_count'] = array(
+  $params['split_count'] = [
     'title' => 'Split Count',
     'api.default' => 6,
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
   $params['split_count_select']['title'] = 'Split Count Select';
   $params['split_count_select']['api.required'] = 1;
   $params['target_url']['title'] = 'Target URL';
@@ -207,21 +207,21 @@ function _civicrm_api3_mailing_a_b_graph_stats_spec(&$params) {
 function civicrm_api3_mailing_a_b_graph_stats($params) {
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_DAO_MailingAB',
-    array('id'),
+    ['id'],
     FALSE
   );
 
-  $defaults = array(
+  $defaults = [
     'criteria' => 'Open',
     'target_date' => CRM_Utils_Time::getTime('YmdHis'),
     'split_count' => 6,
     'split_count_select' => 1,
-  );
+  ];
   $params = array_merge($defaults, $params);
 
-  $mailingAB = civicrm_api3('MailingAB', 'getsingle', array('id' => $params['id']));
-  $graphStats = array();
-  $ABFormat = array('A' => 'mailing_id_a', 'B' => 'mailing_id_b');
+  $mailingAB = civicrm_api3('MailingAB', 'getsingle', ['id' => $params['id']]);
+  $graphStats = [];
+  $ABFormat = ['A' => 'mailing_id_a', 'B' => 'mailing_id_b'];
 
   foreach ($ABFormat as $name => $column) {
     switch (strtolower($params['criteria'])) {
@@ -232,12 +232,12 @@ function civicrm_api3_mailing_a_b_graph_stats($params) {
         $dateDuration = round(round(strtotime($targetDate) - strtotime($startDate)) / $params['split_count']);
         $toDate = strtotime($startDate) + ($dateDuration * $params['split_count_select']);
         $toDate = date('YmdHis', $toDate);
-        $graphStats[$name] = array(
-          $params['split_count_select'] => array(
+        $graphStats[$name] = [
+          $params['split_count_select'] => [
             'count' => CRM_Mailing_Event_BAO_Opened::getTotalCount($mailingAB[$column], NULL, TRUE, $toDate),
             'time' => CRM_Utils_Date::customFormat($toDate),
-          ),
-        );
+          ],
+        ];
         break;
 
       case 'total unique clicks':
@@ -247,12 +247,12 @@ function civicrm_api3_mailing_a_b_graph_stats($params) {
         $dateDuration = round(abs(strtotime($targetDate) - strtotime($startDate)) / $params['split_count']);
         $toDate = strtotime($startDate) + ($dateDuration * $params['split_count_select']);
         $toDate = date('YmdHis', $toDate);
-        $graphStats[$name] = array(
-          $params['split_count_select'] => array(
+        $graphStats[$name] = [
+          $params['split_count_select'] => [
             'count' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], NULL, FALSE, NULL, $toDate),
             'time' => CRM_Utils_Date::customFormat($toDate),
-          ),
-        );
+          ],
+        ];
         break;
 
       case 'total clicks on a particular link':
@@ -267,12 +267,12 @@ function civicrm_api3_mailing_a_b_graph_stats($params) {
         $dateDuration = round(abs(strtotime($targetDate) - strtotime($startDate)) / $params['split_count']);
         $toDate = strtotime($startDate) + ($dateDuration * $params['split_count_select']);
         $toDate = CRM_Utils_Date::processDate($toDate);
-        $graphStats[$name] = array(
-          $params['split_count_select'] => array(
+        $graphStats[$name] = [
+          $params['split_count_select'] => [
             'count' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], NULL, FALSE, $url_id, $toDate),
             'time' => CRM_Utils_Date::customFormat($toDate),
-          ),
-        );
+          ],
+        ];
         break;
     }
   }
index c001039b1a51ccb1ab59e4c3d7b1f15208069073..b4eedb52b14363df34f22fe5b7c6be1bcb021876 100644 (file)
@@ -75,21 +75,21 @@ function _civicrm_api3_mailing_contact_getresults($params, $count) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_contact_get_spec(&$params) {
-  $params['contact_id'] = array(
+  $params['contact_id'] = [
     'api.required' => 1,
     'title' => 'Contact ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 
-  $params['type'] = array(
+  $params['type'] = [
     'api.default' => 'Delivered',
     'title' => 'Type', // doesn't really explain the field - but not sure I understand it to explain it better
     'type' => CRM_Utils_Type::T_STRING,
-    'options' => array(
+    'options' => [
       'Delivered' => 'Delivered',
       'Bounced' => 'Bounced',
-    ),
-  );
+    ],
+  ];
 }
 
 /**
@@ -131,20 +131,20 @@ AND        meq.contact_id = %1
 GROUP BY   m.id
 ";
 
-    $qParams = array(
-      1 => array($contactID, 'Integer'),
-    );
+    $qParams = [
+      1 => [$contactID, 'Integer'],
+    ];
     $dao = CRM_Core_DAO::executeQuery($sql, $qParams);
 
     $results = $dao->N;
   }
   else {
-    $defaultFields = array(
+    $defaultFields = [
       'm.id'       => 'mailing_id',
       'm.subject'  => 'subject',
       'c.id' => 'creator_id',
       'c.sort_name' => 'creator_name',
-    );
+    ];
 
     if ($selectFields) {
       $fields = array_merge($selectFields, $defaultFields);
@@ -153,7 +153,7 @@ GROUP BY   m.id
       $fields = $defaultFields;
     }
 
-    $select = array();
+    $select = [];
     foreach ($fields as $n => $l) {
       $select[] = "$n as $l";
     }
@@ -186,14 +186,14 @@ LIMIT %2, %3
 ";
     }
 
-    $qParams = array(
-      1 => array($contactID, 'Integer'),
-      2 => array($offset, 'Integer'),
-      3 => array($limit, 'Integer'),
-    );
+    $qParams = [
+      1 => [$contactID, 'Integer'],
+      2 => [$offset, 'Integer'],
+      3 => [$limit, 'Integer'],
+    ];
     $dao = CRM_Core_DAO::executeQuery($sql, $qParams);
 
-    $results = array();
+    $results = [];
     while ($dao->fetch()) {
       foreach ($fields as $n => $l) {
         $results[$dao->mailing_id][$l] = $dao->$l;
@@ -222,7 +222,7 @@ function _civicrm_api3_mailing_contact_get_delivered(
   $sort,
   $getCount
 ) {
-  $selectFields = array('med.time_stamp' => 'start_date');
+  $selectFields = ['med.time_stamp' => 'start_date'];
 
   $fromClause = "
 INNER JOIN civicrm_mailing_event_delivered med ON med.event_queue_id = meq.id
index 27e28baa78cee1777744f25d8f8c7e9f443bd779..12ccad5a02dc3e3f083446d50a80cab3ad499a52 100644 (file)
@@ -65,19 +65,19 @@ function civicrm_api3_mailing_event_confirm_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_event_confirm_create_spec(&$params) {
-  $params['contact_id'] = array(
+  $params['contact_id'] = [
     'api.required' => 1,
     'title' => 'Contact ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['subscribe_id'] = array(
+  ];
+  $params['subscribe_id'] = [
     'api.required' => 1,
     'title' => 'Subscribe Event ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['hash'] = array(
+  ];
+  $params['hash'] = [
     'api.required' => 1,
     'title' => 'Hash',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
index 7075aafd907199e3168cadaa42493020750de60d..87e9b2ba9bc7b390bfea904725b16a298a0ae232 100644 (file)
@@ -47,7 +47,7 @@ function civicrm_api3_mailing_event_queue_create($params) {
   }
   civicrm_api3_verify_mandatory($params,
     'CRM_Mailing_DAO_MailingJob',
-    array('job_id', 'contact_id'),
+    ['job_id', 'contact_id'],
     FALSE
   );
   return _civicrm_api3_basic_create('CRM_Mailing_Event_BAO_Queue', $params, 'Queue');
index 29a01035b0ae11d3e88881f59ef439398d3b1268..367a077b145b24cc37e1704083d669124d371b81 100644 (file)
@@ -68,19 +68,19 @@ function civicrm_api3_mailing_event_resubscribe_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_event_resubscribe_create_spec(&$params) {
-  $params['event_queue_id'] = array(
+  $params['event_queue_id'] = [
     'api.required' => 1,
     'title' => 'Event Queue ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['job_id'] = array(
+  ];
+  $params['job_id'] = [
     'api.required' => 1,
     'title' => 'Job ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['hash'] = array(
+  ];
+  $params['hash'] = [
     'api.required' => 1,
     'title' => 'Hash',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
index f5df8ef8f57493dc525b0ad68781fa1661af2ffc..e4c8eaab9bd9ba8cab4d7c57639b0d3e08355946 100644 (file)
@@ -61,7 +61,7 @@ function civicrm_api3_mailing_event_subscribe_create($params) {
 
     $subscribe->send_confirm_request($email);
 
-    $values = array();
+    $values = [];
     $values[$subscribe->id]['contact_id'] = $subscribe->contact_id;
     $values[$subscribe->id]['subscribe_id'] = $subscribe->id;
     $values[$subscribe->id]['hash'] = $subscribe->hash;
@@ -80,14 +80,14 @@ function civicrm_api3_mailing_event_subscribe_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_event_subscribe_create_spec(&$params) {
-  $params['email'] = array(
+  $params['email'] = [
     'api.required' => 1,
     'title' => 'Unsubscribe Email',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['group_id'] = array(
+  ];
+  $params['group_id'] = [
     'api.required' => 1,
     'title' => 'Unsubscribe From Group',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
index 4313c57d876e5c70e35c7107f6920180962a9c0b..4d853924f9d1f5f5ac0d2a734d280d1689b75bbf 100644 (file)
@@ -75,19 +75,19 @@ function civicrm_api3_mailing_event_unsubscribe_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_event_unsubscribe_create_spec(&$params) {
-  $params['job_id'] = array(
+  $params['job_id'] = [
     'api.required' => 1,
     'title' => 'Mailing Job ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['hash'] = array(
+  ];
+  $params['hash'] = [
     'api.required' => 1,
     'title' => 'Mailing Hash',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $params['event_queue_id'] = array(
+  ];
+  $params['event_queue_id'] = [
     'api.required' => 1,
     'title' => 'Mailing Queue ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
index 9f3cb1e1eb4279bc830ad245e24c2e1bfe64ad2c..cc6ef0cf94b256d700761e3cf497cade1c1a5550 100644 (file)
  */
 function _civicrm_api3_mailing_group_deprecation() {
   $message = 'This action is deprecated. Use the mailing_event API instead.';
-  return array(
+  return [
     'event_unsubscribe' => $message,
     'event_domain_unsubscribe' => $message,
     'event_resubscribe' => $message,
     'event_subscribe' => $message,
-  );
+  ];
 }
 
 /**
index 052019ef6eaac72f4eafd57ef0e3a3742dfbef60..7d9b86ac49e0515f037a2db452df53b2b3d51238 100644 (file)
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_membership_delete_spec(&$params) {
-  $params['preserve_contribution'] = array(
+  $params['preserve_contribution'] = [
     'api.required' => 0,
     'title' => 'Preserve Contribution',
     'description' => 'By default this is 0, or 0 if not set. Set to 1 to preserve the associated contribution record when membership is deleted.',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -97,7 +97,7 @@ function civicrm_api3_membership_create($params) {
     }
   }
 
-  $values = array();
+  $values = [];
   _civicrm_api3_custom_format_params($params, $values, 'Membership');
   $params = array_merge($params, $values);
 
@@ -124,7 +124,7 @@ function civicrm_api3_membership_create($params) {
         $params['num_terms']
       );
     }
-    foreach (array('join_date', 'start_date', 'end_date') as $date) {
+    foreach (['join_date', 'start_date', 'end_date'] as $date) {
       if (empty($params[$date]) && isset($calcDates[$date])) {
         $params[$date] = $calcDates[$date];
       }
@@ -135,7 +135,7 @@ function civicrm_api3_membership_create($params) {
   if (empty($params['id'])) {
     $params['action'] = CRM_Core_Action::ADD;
     // we need user id during add mode
-    $ids = array();
+    $ids = [];
     if (!empty($params['contact_id'])) {
       $ids['userId'] = $params['contact_id'];
     }
@@ -155,7 +155,7 @@ function civicrm_api3_membership_create($params) {
     return civicrm_api3_create_error(ts('The membership can not be saved, no valid membership status for given dates'));
   }
 
-  $membership = array();
+  $membership = [];
   _civicrm_api3_object_to_array($membershipBAO, $membership[$membershipBAO->id]);
 
   return civicrm_api3_create_success($membership, $params, 'Membership', 'create', $membershipBAO);
@@ -174,18 +174,18 @@ function _civicrm_api3_membership_create_spec(&$params) {
   $params['contact_id']['api.required'] = 1;
   $params['membership_type_id']['api.required'] = 1;
   $params['is_test']['api.default'] = 0;
-  $params['membership_type_id']['api.aliases'] = array('membership_type');
-  $params['status_id']['api.aliases'] = array('membership_status');
-  $params['skipStatusCal'] = array(
+  $params['membership_type_id']['api.aliases'] = ['membership_type'];
+  $params['status_id']['api.aliases'] = ['membership_status'];
+  $params['skipStatusCal'] = [
     'title' => 'Skip status calculation',
     'description' => 'By default this is 0 if id is not set and 1 if it is set.',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['num_terms'] = array(
+  ];
+  $params['num_terms'] = [
     'title' => 'Number of terms',
     'description' => 'Terms to add/renew. If this parameter is passed, dates will be calculated automatically. If no id is passed (new membership) and no dates are given, num_terms will be assumed to be 1.',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
@@ -197,12 +197,12 @@ function _civicrm_api3_membership_create_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_membership_get_spec(&$params) {
-  $params['membership_type_id']['api.aliases'] = array('membership_type');
-  $params['active_only'] = array(
+  $params['membership_type_id']['api.aliases'] = ['membership_type'];
+  $params['active_only'] = [
     'title' => 'Active Only',
     'description' => 'Only retrieve active memberships',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -229,7 +229,7 @@ function civicrm_api3_membership_get($params) {
   }
   $activeOnly = CRM_Utils_Array::value('active_only', $params, $activeOnly);
   if ($activeOnly && empty($params['status_id'])) {
-    $params['status_id'] = array('IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent());
+    $params['status_id'] = ['IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent()];
   }
 
   $options = _civicrm_api3_get_options_from_params($params, TRUE, 'Membership', 'get');
@@ -271,11 +271,11 @@ function civicrm_api3_membership_get($params) {
  */
 function _civicrm_api3_membership_get_customv2behaviour(&$params, $membershipTypeId, $activeOnly) {
   // get the membership for the given contact ID
-  $membershipParams = array('contact_id' => $params['contact_id']);
+  $membershipParams = ['contact_id' => $params['contact_id']];
   if ($membershipTypeId) {
     $membershipParams['membership_type_id'] = $membershipTypeId;
   }
-  $membershipValues = array();
+  $membershipValues = [];
   CRM_Member_BAO_Membership::getValues($membershipParams, $membershipValues, $activeOnly);
   return $membershipValues;
 }
@@ -293,7 +293,7 @@ function _civicrm_api3_membership_get_customv2behaviour(&$params, $membershipTyp
  *   result for calling function
  */
 function _civicrm_api3_membership_relationsship_get_customv2behaviour(&$params, $membershipValues, $contactID) {
-  $relationships = array();
+  $relationships = [];
   foreach ($membershipValues as $membershipId => $values) {
     // populate the membership type name for the membership type id
     $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($values['membership_type_id']);
index ef78bd5f731062d3ea9a69397a42e32125d66629..633db9681e395c50e036ced58bfd5617d4078667 100644 (file)
@@ -56,11 +56,11 @@ function civicrm_api3_membership_payment_create($params) {
 function _civicrm_api3_membership_payment_create_spec(&$params) {
   $params['membership_id']['api.required'] = 1;
   $params['contribution_id']['api.required'] = 1;
-  $params['membership_type_id'] = array(
+  $params['membership_type_id'] = [
     'title' => 'Membership type id',
     'description' => 'The id of the membership type',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
index fabdd80368602f32690c665867163544bb528ecf..cad70e9d581746c8823ba1c8b3dcaf0fcc5574ae 100644 (file)
@@ -86,7 +86,7 @@ function civicrm_api3_membership_status_get($params) {
  */
 function civicrm_api3_membership_status_update($params) {
 
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
   //don't allow duplicate names.
   $name = CRM_Utils_Array::value('name', $params);
   if ($name) {
@@ -108,7 +108,7 @@ function civicrm_api3_membership_status_update($params) {
     }
     $membershipStatusBAO->save();
   }
-  $membershipStatus = array();
+  $membershipStatus = [];
   $cloneBAO = clone($membershipStatusBAO);
   _civicrm_api3_object_to_array($cloneBAO, $membershipStatus);
   $membershipStatus['is_error'] = 0;
@@ -162,7 +162,7 @@ SELECT start_date, end_date, join_date, membership_type_id
  WHERE id = %1
 ";
 
-  $params = array(1 => array($membershipID, 'Integer'));
+  $params = [1 => [$membershipID, 'Integer']];
   $dao = CRM_Core_DAO::executeQuery($query, $params);
   if ($dao->fetch()) {
     $membershipTypeID = empty($membershipParams['membership_type_id']) ? $dao->membership_type_id : $membershipParams['membership_type_id'];
index d5e515e42bb4fca1e635c359ad519b3168e21e98..386626c548f784ef2c3749b94d699e54236cf765 100644 (file)
@@ -42,7 +42,7 @@
  */
 function civicrm_api3_membership_type_create($params) {
   // Workaround for fields using nonstandard serialization
-  foreach (array('relationship_type_id', 'relationship_direction') as $field) {
+  foreach (['relationship_type_id', 'relationship_direction'] as $field) {
     if (isset($params[$field]) && is_array($params[$field])) {
       $params[$field] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $params[$field]);
     }
@@ -85,7 +85,7 @@ function civicrm_api3_membership_type_get($params) {
   if (!empty($results['values']) && is_array($results['values'])) {
     foreach ($results['values'] as &$item) {
       // Workaround for fields using nonstandard serialization
-      foreach (array('relationship_type_id', 'relationship_direction') as $field) {
+      foreach (['relationship_type_id', 'relationship_direction'] as $field) {
         if (isset($item[$field]) && !is_array($item[$field])) {
           $item[$field] = (array) $item[$field];
         }
index a5b1d7df707f57fccfc7fdda9f8b7f14d8d266e9..6c54249c1ab616b2ff1a4f1db35e87cc2b1f2471 100644 (file)
@@ -103,7 +103,7 @@ function civicrm_api3_message_template_get($params) {
  */
 function civicrm_api3_message_template_send($params) {
   // Change external param names to internal ones
-  $fieldSpec = array();
+  $fieldSpec = [];
   _civicrm_api3_message_template_send_spec($fieldSpec);
 
   foreach ($fieldSpec as $field => $spec) {
@@ -118,7 +118,7 @@ function civicrm_api3_message_template_send($params) {
       throw new API_Exception(
         "Mandatory key(s) missing from params array: requires id or option_group_name + option_value_name",
         "mandatory_missing",
-        array("fields" => array('id', 'option_group_name', 'option_value_name'))
+        ["fields" => ['id', 'option_group_name', 'option_value_name']]
       );
     }
   }
@@ -137,27 +137,27 @@ function civicrm_api3_message_template_send($params) {
 function _civicrm_api3_message_template_send_spec(&$params) {
   $params['id']['description'] = 'ID of the template';
   $params['id']['title'] = 'Message Template ID';
-  $params['id']['api.aliases'] = array('messageTemplateID', 'message_template_id');
+  $params['id']['api.aliases'] = ['messageTemplateID', 'message_template_id'];
   $params['id']['type'] = CRM_Utils_Type::T_INT;
 
   $params['option_group_name']['description'] = 'option group name of the template (required if no id supplied)';
   $params['option_group_name']['title'] = 'Option Group Name';
-  $params['option_group_name']['api.aliases'] = array('groupName');
+  $params['option_group_name']['api.aliases'] = ['groupName'];
   $params['option_group_name']['type'] = CRM_Utils_Type::T_STRING;
 
   $params['option_value_name']['description'] = 'option value name of the template (required if no id supplied)';
   $params['option_value_name']['title'] = 'Option Value Name';
-  $params['option_value_name']['api.aliases'] = array('valueName');
+  $params['option_value_name']['api.aliases'] = ['valueName'];
   $params['option_value_name']['type'] = CRM_Utils_Type::T_STRING;
 
   $params['contact_id']['description'] = 'contact id if contact tokens are to be replaced';
   $params['contact_id']['title'] = 'Contact ID';
-  $params['contact_id']['api.aliases'] = array('contactId');
+  $params['contact_id']['api.aliases'] = ['contactId'];
   $params['contact_id']['type'] = CRM_Utils_Type::T_INT;
 
   $params['template_params']['description'] = 'additional template params (other than the ones already set in the template singleton)';
   $params['template_params']['title'] = 'Template Params';
-  $params['template_params']['api.aliases'] = array('tplParams');
+  $params['template_params']['api.aliases'] = ['tplParams'];
   // FIXME: Type??
 
   $params['from']['description'] = 'the From: header';
@@ -166,12 +166,12 @@ function _civicrm_api3_message_template_send_spec(&$params) {
 
   $params['to_name']['description'] = 'the recipient’s name';
   $params['to_name']['title'] = 'Recipient Name';
-  $params['to_name']['api.aliases'] = array('toName');
+  $params['to_name']['api.aliases'] = ['toName'];
   $params['to_name']['type'] = CRM_Utils_Type::T_STRING;
 
   $params['to_email']['description'] = 'the recipient’s email - mail is sent only if set';
   $params['to_email']['title'] = 'Recipient Email';
-  $params['to_email']['api.aliases'] = array('toEmail');
+  $params['to_email']['api.aliases'] = ['toEmail'];
   $params['to_email']['type'] = CRM_Utils_Type::T_STRING;
 
   $params['cc']['description'] = 'the Cc: header';
@@ -184,7 +184,7 @@ function _civicrm_api3_message_template_send_spec(&$params) {
 
   $params['reply_to']['description'] = 'the Reply-To: header';
   $params['reply_to']['title'] = 'Reply To';
-  $params['reply_to']['api.aliases'] = array('replyTo');
+  $params['reply_to']['api.aliases'] = ['replyTo'];
   $params['reply_to']['type'] = CRM_Utils_Type::T_STRING;
 
   $params['attachments']['description'] = 'email attachments';
@@ -193,11 +193,11 @@ function _civicrm_api3_message_template_send_spec(&$params) {
 
   $params['is_test']['description'] = 'whether this is a test email (and hence should include the test banner)';
   $params['is_test']['title'] = 'Is Test';
-  $params['is_test']['api.aliases'] = array('isTest');
+  $params['is_test']['api.aliases'] = ['isTest'];
   $params['is_test']['type'] = CRM_Utils_Type::T_BOOLEAN;
 
   $params['pdf_filename']['description'] = 'filename of optional PDF version to add as attachment (do not include path)';
   $params['pdf_filename']['title'] = 'PDF Filename';
-  $params['pdf_filename']['api.aliases'] = array('PDFFilename');
+  $params['pdf_filename']['api.aliases'] = ['PDFFilename'];
   $params['pdf_filename']['type'] = CRM_Utils_Type::T_STRING;
 }
index d21a1c4baf67d5db854af77be0f800c617c3dd95..fa4ff32a031b35025faf4e96aca0c83496db2249 100644 (file)
@@ -40,10 +40,10 @@ function _civicrm_api3_navigation_reset_spec(&$params) {
   $params['for']['api.required'] = TRUE;
   $params['for']['title'] = "Is this reset for all navigation or reports";
   $params['for']['type'] = CRM_Utils_Type::T_STRING;
-  $params['for']['options'] = array(
+  $params['for']['options'] = [
     'all' => 'General Navigation rebuild from xml',
     'report' => 'Reset report menu to default structure',
-  );
+  ];
   $params['domain_id']['api.default'] = CRM_Core_Config::domainID();
   $params['domain_id']['type'] = CRM_Utils_Type::T_INT;
   $params['domain_id']['title'] = 'Domain ID';
@@ -97,7 +97,7 @@ function civicrm_api3_navigation_get($params) {
  *   API result array.
  */
 function civicrm_api3_navigation_create($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array('name', 'label'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['name', 'label']);
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Navigation');
 }
 
index c570446d1c035e74987f1d32885d2463826966f4..6c86037c90281f94a696cf39bf4f2431b9be14d8 100644 (file)
@@ -113,7 +113,7 @@ function _civicrm_api3_note_get_spec(&$params) {
  *   Nested associative array beginning with direct children of given note.
  */
 function civicrm_api3_note_tree_get($params) {
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
 
   if (!is_numeric($params['id'])) {
     return civicrm_api3_create_error(ts("Invalid note ID"));
index a1bec3d48f9bf7cfe61c42f529c53a889995ad10..d72d3469a2dd81c64177e5c5413ab0ba7dc32886 100644 (file)
@@ -54,7 +54,7 @@ function civicrm_api3_option_group_get($params) {
  */
 function civicrm_api3_option_group_create($params) {
   $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'OptionGroup');
-  civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1));
+  civicrm_api('option_value', 'getfields', ['version' => 3, 'cache_clear' => 1]);
   return $result;
 }
 
index 09fe94fcd2b09ddc54a8dcc3ec5b65322c554872..9a83d26cbc06f72d49f49dfac041b815657d91d2 100644 (file)
@@ -54,7 +54,7 @@ function civicrm_api3_option_value_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_option_value_get_spec(&$params) {
-  $params['option_group_id']['api.aliases'] = array('option_group_name');
+  $params['option_group_id']['api.aliases'] = ['option_group_name'];
 }
 
 /**
@@ -77,7 +77,7 @@ function civicrm_api3_option_value_create($params) {
     $groupId = $params['option_group_id'];
   }
 
-  civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1, 'option_group_id' => $groupId));
+  civicrm_api('option_value', 'getfields', ['version' => 3, 'cache_clear' => 1, 'option_group_id' => $groupId]);
   return $result;
 }
 
@@ -92,7 +92,7 @@ function civicrm_api3_option_value_create($params) {
 function _civicrm_api3_option_value_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
   //continue to support component
-  $params['component_id']['api.aliases'] = array('component');
+  $params['component_id']['api.aliases'] = ['component'];
   //  $params['name']['api.aliases'] = array('label');
   $params['option_group_id']['api.required'] = TRUE;
 }
@@ -106,10 +106,10 @@ function _civicrm_api3_option_value_create_spec(&$params) {
  */
 function civicrm_api3_option_value_delete($params) {
   // We will get the option group id before deleting so we can flush pseudoconstants.
-  $optionGroupID = civicrm_api('option_value', 'getvalue', array('version' => 3, 'id' => $params['id'], 'return' => 'option_group_id'));
+  $optionGroupID = civicrm_api('option_value', 'getvalue', ['version' => 3, 'id' => $params['id'], 'return' => 'option_group_id']);
   $result = CRM_Core_BAO_OptionValue::del($params['id']);
   if ($result) {
-    civicrm_api('option_value', 'getfields', array('version' => 3, 'cache_clear' => 1, 'option_group_id' => $optionGroupID));
+    civicrm_api('option_value', 'getfields', ['version' => 3, 'cache_clear' => 1, 'option_group_id' => $optionGroupID]);
     return civicrm_api3_create_success();
   }
   else {
index bc29312006939eed479dfb8cddf5bfeff6ed8964..fff662a96a61eb02500bd407626b6df1cf373f8f 100644 (file)
@@ -42,8 +42,8 @@
  *   Array of Order, if error an array with an error id and error message
  */
 function civicrm_api3_order_get($params) {
-  $contributions = array();
-  $params['api.line_item.get'] = array('qty' => array('<>' => 0));
+  $contributions = [];
+  $params['api.line_item.get'] = ['qty' => ['<>' => 0]];
   $isSequential = FALSE;
   if (CRM_Utils_Array::value('sequential', $params)) {
     $params['sequential'] = 0;
@@ -87,18 +87,18 @@ function _civicrm_api3_order_get_spec(&$params) {
 function civicrm_api3_order_create(&$params) {
 
   $entity = NULL;
-  $entityIds = array();
+  $entityIds = [];
   if (CRM_Utils_Array::value('line_items', $params) && is_array($params['line_items'])) {
     $priceSetID = NULL;
     CRM_Contribute_BAO_Contribution::checkLineItems($params);
     foreach ($params['line_items'] as $lineItems) {
-      $entityParams = CRM_Utils_Array::value('params', $lineItems, array());
+      $entityParams = CRM_Utils_Array::value('params', $lineItems, []);
       if (!empty($entityParams) && !empty($lineItems['line_item'])) {
         $item = reset($lineItems['line_item']);
         $entity = str_replace('civicrm_', '', $item['entity_table']);
       }
       if ($entityParams) {
-        if (in_array($entity, array('participant', 'membership'))) {
+        if (in_array($entity, ['participant', 'membership'])) {
           $entityParams['skipLineItem'] = TRUE;
           $entityResult = civicrm_api3($entity, 'create', $entityParams);
           $params['contribution_mode'] = $entity;
@@ -113,11 +113,11 @@ function civicrm_api3_order_create(&$params) {
       }
       if (empty($priceSetID)) {
         $item = reset($lineItems['line_item']);
-        $priceSetID = civicrm_api3('PriceField', 'getvalue', array(
+        $priceSetID = civicrm_api3('PriceField', 'getvalue', [
           'return' => 'price_set_id',
           'id' => $item['price_field_id'],
-        ));
-        $params['line_item'][$priceSetID] = array();
+        ]);
+        $params['line_item'][$priceSetID] = [];
       }
       $params['line_item'][$priceSetID] = array_merge($params['line_item'][$priceSetID], $lineItems['line_item']);
     }
@@ -126,10 +126,10 @@ function civicrm_api3_order_create(&$params) {
   // add payments
   if ($entity && CRM_Utils_Array::value('id', $contribution)) {
     foreach ($entityIds as $entityId) {
-      $paymentParams = array(
+      $paymentParams = [
         'contribution_id' => $contribution['id'],
         $entity . '_id' => $entityId,
-      );
+      ];
       // if entity is pledge then build pledge param
       if ($entity == 'pledge') {
         $paymentParams += $entityParams;
@@ -150,10 +150,10 @@ function civicrm_api3_order_create(&$params) {
  * @throws CiviCRM_API3_Exception
  */
 function civicrm_api3_order_delete($params) {
-  $contribution = civicrm_api3('Contribution', 'get', array(
-    'return' => array('is_test'),
+  $contribution = civicrm_api3('Contribution', 'get', [
+    'return' => ['is_test'],
     'id' => $params['id'],
-  ));
+  ]);
   if ($contribution['id'] && $contribution['values'][$contribution['id']]['is_test'] == TRUE) {
     $result = civicrm_api3('Contribution', 'delete', $params);
   }
@@ -188,11 +188,11 @@ function civicrm_api3_order_cancel($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_order_cancel_spec(&$params) {
-  $params['contribution_id'] = array(
+  $params['contribution_id'] = [
     'api.required' => 1 ,
     'title' => 'Contribution ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
 
 /**
@@ -204,17 +204,17 @@ function _civicrm_api3_order_cancel_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_order_create_spec(&$params) {
-  $params['contact_id'] = array(
+  $params['contact_id'] = [
     'name' => 'contact_id',
     'title' => 'Contact ID',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => TRUE,
-  );
-  $params['total_amount'] = array(
+  ];
+  $params['total_amount'] = [
     'name' => 'total_amount',
     'title' => 'Total Amount',
     'api.required' => TRUE,
-  );
+  ];
   $params['financial_type_id'] = [
     'name' => 'financial_type_id',
     'title' => 'Financial Type',
@@ -240,10 +240,10 @@ function _civicrm_api3_order_create_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_order_delete_spec(&$params) {
-  $params['contribution_id'] = array(
+  $params['contribution_id'] = [
     'api.required' => TRUE,
     'title' => 'Contribution ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['id']['api.aliases'] = array('contribution_id');
+  ];
+  $params['id']['api.aliases'] = ['contribution_id'];
 }
index 18a881744dec8344f281ec16e1014b7777170fbb..d9b75b3be00403e64148f573f5edbf9a42ee8a25 100644 (file)
@@ -49,7 +49,7 @@ function civicrm_api3_participant_create($params) {
     }
   }
 
-  $values = $participant = array();
+  $values = $participant = [];
   _civicrm_api3_custom_format_params($params, $values, 'Participant');
   $params = array_merge($values, $params);
 
@@ -104,14 +104,14 @@ function _civicrm_api3_participant_createlineitem(&$params, $participant) {
       where ps.id is not null and pfv.label = %2
     ";
 
-    $qParams = array(
-      1 => array($params['event_id'], 'Integer'),
-      2 => array($label, 'String'),
-    );
+    $qParams = [
+      1 => [$params['event_id'], 'Integer'],
+      2 => [$label, 'String'],
+    ];
 
     $dao = CRM_Core_DAO::executeQuery($sql, $qParams);
     if ($dao->fetch()) {
-      $lineItemParams = array(
+      $lineItemParams = [
         'price_field_id' => $dao->priceFieldID,
         'price_field_value_id' => $dao->priceFieldValueID,
         'entity_table' => 'civicrm_participant',
@@ -121,7 +121,7 @@ function _civicrm_api3_participant_createlineitem(&$params, $participant) {
         'participant_count' => 0,
         'unit_price' => $dao->amount,
         'line_total' => $qty * $dao->amount,
-      );
+      ];
       civicrm_api3('line_item', 'create', $lineItemParams);
     }
 
@@ -143,8 +143,8 @@ function _civicrm_api3_participant_create_spec(&$params) {
   $params['event_id']['api.required'] = 1;
   $params['contact_id']['api.required'] = 1;
   // These are for the sake of search builder options - can be removed if that is fixed
-  $params['role_id']['api.aliases'] = array('participant_role');
-  $params['status_id']['api.aliases'] = array('participant_status');
+  $params['role_id']['api.aliases'] = ['participant_role'];
+  $params['status_id']['api.aliases'] = ['participant_status'];
 }
 
 /**
@@ -161,7 +161,7 @@ function civicrm_api3_participant_get($params) {
 
   list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Participant');
 
-  $participant = array();
+  $participant = [];
   while ($dao->fetch()) {
     $query->convertToPseudoNames($dao, FALSE, TRUE);
     $participant[$dao->participant_id] = $query->store($dao);
@@ -181,11 +181,11 @@ function civicrm_api3_participant_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_participant_get_spec(&$params) {
-  $params['participant_test'] = array(
+  $params['participant_test'] = [
     'api.default' => 0,
     'title' => 'Get Test Participants',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
index a4292a5b6b719e52c24ba52e565cce07fdc5c1c3..25e4ae17e9b6c98b6d2bb517effb84ac2fd6106a 100644 (file)
@@ -41,7 +41,7 @@
  *   Array of financial transactions which are payments, if error an array with an error id and error message
  */
 function civicrm_api3_payment_get($params) {
-  $financialTrxn = array();
+  $financialTrxn = [];
   $limit = '';
   if (isset($params['options']) && CRM_Utils_Array::value('limit', $params['options'])) {
     $limit = CRM_Utils_Array::value('limit', $params['options']);
@@ -49,7 +49,7 @@ function civicrm_api3_payment_get($params) {
   $params['options']['limit'] = 0;
   $eft = civicrm_api3('EntityFinancialTrxn', 'get', $params);
   if (!empty($eft['values'])) {
-    $eftIds = array();
+    $eftIds = [];
     foreach ($eft['values'] as $efts) {
       if (empty($efts['financial_trxn_id'])) {
         continue;
@@ -58,10 +58,10 @@ function civicrm_api3_payment_get($params) {
       $map[$efts['financial_trxn_id']] = $efts['entity_id'];
     }
     if (!empty($eftIds)) {
-      $ftParams = array(
-        'id' => array('IN' => $eftIds),
+      $ftParams = [
+        'id' => ['IN' => $eftIds],
         'is_payment' => 1,
-      );
+      ];
       if ($limit) {
         $ftParams['options']['limit'] = $limit;
       }
@@ -71,7 +71,7 @@ function civicrm_api3_payment_get($params) {
       }
     }
   }
-  return civicrm_api3_create_success(CRM_Utils_Array::value('values', $financialTrxn, array()), $params, 'Payment', 'get');
+  return civicrm_api3_create_success(CRM_Utils_Array::value('values', $financialTrxn, []), $params, 'Payment', 'get');
 }
 
 /**
@@ -99,10 +99,10 @@ function civicrm_api3_payment_delete(&$params) {
  *   Api result array
  */
 function civicrm_api3_payment_cancel(&$params) {
-  $eftParams = array(
+  $eftParams = [
     'entity_table' => 'civicrm_contribution',
     'financial_trxn_id' => $params['id'],
-  );
+  ];
   $entity = civicrm_api3('EntityFinancialTrxn', 'getsingle', $eftParams);
   $contributionId = $entity['entity_id'];
   $params['total_amount'] = $entity['amount'];
@@ -110,7 +110,7 @@ function civicrm_api3_payment_cancel(&$params) {
 
   $trxn = CRM_Contribute_BAO_Contribution::recordAdditionalPayment($contributionId, $params, 'refund', NULL, FALSE);
 
-  $values = array();
+  $values = [];
   _civicrm_api3_object_to_array_unique_fields($trxn, $values[$trxn->id]);
   return civicrm_api3_create_success($values, $params, 'Payment', 'cancel', $trxn);
 }
@@ -134,7 +134,7 @@ function civicrm_api3_payment_create(&$params) {
   }
   $trxn = CRM_Financial_BAO_Payment::create($params);
 
-  $values = array();
+  $values = [];
   _civicrm_api3_object_to_array_unique_fields($trxn, $values[$trxn->id]);
   return civicrm_api3_create_success($values, $params, 'Payment', 'create', $trxn);
 }
@@ -148,28 +148,28 @@ function civicrm_api3_payment_create(&$params) {
  *   Array of parameters.
  */
 function _civicrm_api3_payment_create_spec(&$params) {
-  $params = array(
-    'contribution_id' => array(
+  $params = [
+    'contribution_id' => [
       'api.required' => 1 ,
       'title' => 'Contribution ID',
       'type' => CRM_Utils_Type::T_INT,
-    ),
-    'total_amount' => array(
+    ],
+    'total_amount' => [
       'api.required' => 1 ,
       'title' => 'Total Payment Amount',
       'type' => CRM_Utils_Type::T_FLOAT,
-    ),
-    'payment_processor_id' => array(
+    ],
+    'payment_processor_id' => [
       'title' => 'Payment Processor ID',
       'type' => CRM_Utils_Type::T_INT,
       'description' => ts('Payment processor ID - required for payment processor payments'),
-    ),
-    'id' => array(
+    ],
+    'id' => [
       'title' => 'Payment ID',
       'type' => CRM_Utils_Type::T_INT,
-      'api.aliases' => array('payment_id'),
-    ),
-  );
+      'api.aliases' => ['payment_id'],
+    ],
+  ];
 }
 
 /**
@@ -181,21 +181,21 @@ function _civicrm_api3_payment_create_spec(&$params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_payment_get_spec(&$params) {
-  $params = array(
-    'contribution_id' => array(
+  $params = [
+    'contribution_id' => [
       'title' => 'Contribution ID',
       'type' => CRM_Utils_Type::T_INT,
-    ),
-    'entity_table' => array(
+    ],
+    'entity_table' => [
       'title' => 'Entity Table',
       'api.default' => 'civicrm_contribution',
-    ),
-    'entity_id' => array(
+    ],
+    'entity_id' => [
       'title' => 'Entity ID',
       'type' => CRM_Utils_Type::T_INT,
-      'api.aliases' => array('contribution_id'),
-    ),
-  );
+      'api.aliases' => ['contribution_id'],
+    ],
+  ];
 }
 
 /**
@@ -207,14 +207,14 @@ function _civicrm_api3_payment_get_spec(&$params) {
  *   Array of parameters.
  */
 function _civicrm_api3_payment_delete_spec(&$params) {
-  $params = array(
-    'id' => array(
+  $params = [
+    'id' => [
       'api.required' => 1 ,
       'title' => 'Payment ID',
       'type' => CRM_Utils_Type::T_INT,
-      'api.aliases' => array('payment_id'),
-    ),
-  );
+      'api.aliases' => ['payment_id'],
+    ],
+  ];
 }
 
 /**
@@ -226,14 +226,14 @@ function _civicrm_api3_payment_delete_spec(&$params) {
  *   Array of parameters.
  */
 function _civicrm_api3_payment_cancel_spec(&$params) {
-  $params = array(
-    'id' => array(
+  $params = [
+    'id' => [
       'api.required' => 1 ,
       'title' => 'Payment ID',
       'type' => CRM_Utils_Type::T_INT,
-      'api.aliases' => array('payment_id'),
-    ),
-  );
+      'api.aliases' => ['payment_id'],
+    ],
+  ];
 }
 
 /**
@@ -275,9 +275,9 @@ function civicrm_api3_payment_sendconfirmation($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_payment_sendconfirmation_spec(&$params) {
-  $params['id'] = array(
+  $params['id'] = [
     'api.required' => 1,
     'title' => ts('Payment ID'),
     'type' => CRM_Utils_Type::T_INT,
-  );
+  ];
 }
index 75b82edb7565d0f7f18896e99266e1ed71e7019c..5faa1318f4786a0f868cfd422abe185d14a8dddb 100644 (file)
  */
 function civicrm_api3_payment_processor_create($params) {
   if (empty($params['id']) && empty($params['payment_instrument_id'])) {
-    $params['payment_instrument_id'] = civicrm_api3('PaymentProcessorType', 'getvalue', array(
+    $params['payment_instrument_id'] = civicrm_api3('PaymentProcessorType', 'getvalue', [
       'id' => $params['payment_processor_type_id'],
       'return' => 'payment_instrument_id',
-    ));
+    ]);
   }
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'PaymentProcessor');
 }
@@ -104,14 +104,14 @@ function civicrm_api3_payment_processor_get($params) {
  * @return array
  */
 function _civicrm_api3_payment_processor_getlist_defaults(&$request) {
-  return array(
-    'description_field' => array(
+  return [
+    'description_field' => [
       'payment_processor_type_id',
       'description',
-    ),
-    'params' => array(
+    ],
+    'params' => [
       'is_test' => 0,
       'is_active' => 1,
-    ),
-  );
+    ],
+  ];
 }
index 13c790d45eca9114418902a4a0934fa3ee3c6b6d..282aeec92be83b62f392c633aa4a964c2bc1307a 100644 (file)
@@ -55,9 +55,9 @@ function civicrm_api3_pledge_create($params) {
  */
 function civicrm_api3_pledge_delete($params) {
   if (CRM_Pledge_BAO_Pledge::deletePledge($params['id'])) {
-    return civicrm_api3_create_success(array(
+    return civicrm_api3_create_success([
       'id' => $params['id'],
-    ), $params, 'Pledge', 'delete');
+    ], $params, 'Pledge', 'delete');
   }
   else {
     return civicrm_api3_create_error('Could not delete pledge');
@@ -71,7 +71,7 @@ function civicrm_api3_pledge_delete($params) {
  */
 function _civicrm_api3_pledge_delete_spec(&$params) {
   // set as not required as pledge_id also acceptable & no either/or std yet
-  $params['id']['api.aliases'] = array('pledge_id');
+  $params['id']['api.aliases'] = ['pledge_id'];
 }
 
 /**
@@ -80,15 +80,15 @@ function _civicrm_api3_pledge_delete_spec(&$params) {
  * @param array $params
  */
 function _civicrm_api3_pledge_get_spec(&$params) {
-  $params['next_pay_date'] = array(
+  $params['next_pay_date'] = [
     'name' => 'next_pay_date',
     'type' => 12,
     'title' => 'Pledge Made',
     'api.filter' => 0,
     'api.return' => 1,
-  );
+  ];
   $params['pledge_is_test']['api.default'] = 0;
-  $params['pledge_financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
+  $params['pledge_financial_type_id']['api.aliases'] = ['contribution_type_id', 'contribution_type'];
 
 }
 
@@ -99,13 +99,13 @@ function _civicrm_api3_pledge_get_spec(&$params) {
  */
 function _civicrm_api3_pledge_create_spec(&$params) {
 
-  $required = array('contact_id', 'amount', 'installments', 'start_date', 'financial_type_id');
+  $required = ['contact_id', 'amount', 'installments', 'start_date', 'financial_type_id'];
   foreach ($required as $required_field) {
     $params[$required_field]['api.required'] = 1;
   }
   // @todo this can come from xml
-  $params['amount']['api.aliases'] = array('pledge_amount');
-  $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type');
+  $params['amount']['api.aliases'] = ['pledge_amount'];
+  $params['financial_type_id']['api.aliases'] = ['contribution_type_id', 'contribution_type'];
 }
 
 /**
@@ -122,7 +122,7 @@ function civicrm_api3_pledge_get($params) {
 
   list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Pledge');
 
-  $pledge = array();
+  $pledge = [];
   while ($dao->fetch()) {
     $pledge[$dao->pledge_id] = $query->store($dao);
   }
@@ -134,7 +134,7 @@ function civicrm_api3_pledge_get($params) {
  * Set default to not return test params.
  */
 function _civicrm_api3_pledge_get_defaults() {
-  return array('pledge_test' => 0);
+  return ['pledge_test' => 0];
 }
 
 /**
index 18b06f56e941c9b16ed3199bedc88b891e318c39..4301305a6640ab58f7a2c1fb2a8afddb942ea156 100644 (file)
@@ -61,7 +61,7 @@ function civicrm_api3_pledge_payment_create($params) {
   }
 
   $dao = CRM_Pledge_BAO_PledgePayment::add($paymentParams);
-  $result = array();
+  $result = [];
   if (empty($dao->pledge_id)) {
     $dao->find(TRUE);
   }
@@ -98,7 +98,7 @@ function _civicrm_api3_pledge_payment_create_spec(&$params) {
 function civicrm_api3_pledge_payment_delete($params) {
 
   if (CRM_Pledge_BAO_PledgePayment::del($params['id'])) {
-    return civicrm_api3_create_success(array('id' => $params['id']), $params, 'PledgePayment', 'delete');
+    return civicrm_api3_create_success(['id' => $params['id']], $params, 'PledgePayment', 'delete');
   }
   else {
     return civicrm_api3_create_error('Could not delete payment');
@@ -126,9 +126,9 @@ function civicrm_api3_pledge_payment_get($params) {
  *   Modifiable list of fields allowed for the PledgePayment.get action.
  */
 function civicrm_api3_pledge_payment_get_spec(&$params) {
-  $params['option.create_new'] = array(
+  $params['option.create_new'] = [
     'title' => "Create New",
     'description' => "Create new field rather than update an unpaid payment",
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
index 6f6ecdc3250720f1884bdfae9dbc3777d15dc1b7..c37b94f88732280c75eb0f765f7905cc8cb0eddd 100644 (file)
@@ -78,7 +78,7 @@ function civicrm_api3_premium_delete($params) {
  * @param array $params
  */
 function _civicrm_api3_premium_get_spec(&$params) {
-  $params['premiums_active']['api.aliases'] = array('is_active');
+  $params['premiums_active']['api.aliases'] = ['is_active'];
 }
 
 /**
@@ -87,5 +87,5 @@ function _civicrm_api3_premium_get_spec(&$params) {
  * @param array $params
  */
 function _civicrm_api3_premium_create_spec(&$params) {
-  $params['premiums_active']['api.aliases'] = array('is_active');
+  $params['premiums_active']['api.aliases'] = ['is_active'];
 }
index ff66773f6295779be1860d688338aafd724ca2db..c4533f7d4b7c46243d41aceb12bdbcfd27253822 100644 (file)
  *   API result array.
  */
 function civicrm_api3_price_field_value_create($params) {
-  $ids = array();
+  $ids = [];
   if (!empty($params['id'])) {
     $ids['id'] = $params['id'];
   }
 
   $bao = CRM_Price_BAO_PriceFieldValue::create($params, $ids);
 
-  $values = array();
+  $values = [];
   _civicrm_api3_object_to_array($bao, $values[$bao->id]);
   return civicrm_api3_create_success($values, $params, 'PriceFieldValue', 'create', $bao);
 
index 13e3b2d499c0434a0a3f888690502f6ea5049e82..6c25483f369b21468478bc8e21d9f688313fe71f 100644 (file)
  */
 function civicrm_api3_profile_get($params) {
   $nonStandardLegacyBehaviour = is_numeric($params['profile_id']) ? TRUE : FALSE;
-  if (!empty($params['check_permissions']) && !empty($params['contact_id']) && !1 === civicrm_api3('contact', 'getcount', array('contact_id' => $params['contact_id'], 'check_permissions' => 1))) {
+  if (!empty($params['check_permissions']) && !empty($params['contact_id']) && !1 === civicrm_api3('contact', 'getcount', ['contact_id' => $params['contact_id'], 'check_permissions' => 1])) {
     throw new API_Exception('permission denied');
   }
   $profiles = (array) $params['profile_id'];
-  $values = array();
+  $values = [];
   $ufGroupBAO = new CRM_Core_BAO_UFGroup();
   foreach ($profiles as $profileID) {
     $profileID = _civicrm_api3_profile_getProfileID($profileID);
-    $values[$profileID] = array();
+    $values[$profileID] = [];
     if (strtolower($profileID) == 'billing') {
       $values[$profileID] = _civicrm_api3_profile_getbillingpseudoprofile($params);
       continue;
@@ -84,7 +84,7 @@ function civicrm_api3_profile_get($params) {
     );
 
     if ($isContactActivityProfile) {
-      civicrm_api3_verify_mandatory($params, NULL, array('activity_id'));
+      civicrm_api3_verify_mandatory($params, NULL, ['activity_id']);
 
       $errors = CRM_Profile_Form::validateContactActivityProfile($params['activity_id'],
       $params['contact_id'],
@@ -94,7 +94,7 @@ function civicrm_api3_profile_get($params) {
         throw new API_Exception(array_pop($errors));
       }
 
-      $contactFields = $activityFields = array();
+      $contactFields = $activityFields = [];
       foreach ($profileFields as $fieldName => $field) {
         if (CRM_Utils_Array::value('field_type', $field) == 'Activity') {
           $activityFields[$fieldName] = $field;
@@ -172,12 +172,12 @@ function civicrm_api3_profile_submit($params) {
     throw new API_Exception('Update profiles including more than one entity not currently supported');
   }
 
-  $contactParams = $activityParams = $missingParams = array();
+  $contactParams = $activityParams = $missingParams = [];
 
-  $profileFields = civicrm_api3('Profile', 'getfields', array('action' => 'submit', 'profile_id' => $profileID));
+  $profileFields = civicrm_api3('Profile', 'getfields', ['action' => 'submit', 'profile_id' => $profileID]);
   $profileFields = $profileFields['values'];
   if ($isContactActivityProfile) {
-    civicrm_api3_verify_mandatory($params, NULL, array('activity_id'));
+    civicrm_api3_verify_mandatory($params, NULL, ['activity_id']);
 
     $errors = CRM_Profile_Form::validateContactActivityProfile($params['activity_id'],
       $params['contact_id'],
@@ -205,8 +205,8 @@ function civicrm_api3_profile_submit($params) {
     if ($params[$fieldName] && isset($params[$fieldName . '_id'])) {
       $value = $params[$fieldName . '_id'];
     }
-    $contactEntities = array('contact', 'individual', 'organization', 'household');
-    $locationEntities = array('email', 'address', 'phone', 'website', 'im');
+    $contactEntities = ['contact', 'individual', 'organization', 'household'];
+    $locationEntities = ['email', 'address', 'phone', 'website', 'im'];
 
     $entity = strtolower(CRM_Utils_Array::value('entity', $field));
     if ($entity && !in_array($entity, array_merge($contactEntities, $locationEntities))) {
@@ -246,17 +246,17 @@ function civicrm_api3_profile_submit($params) {
     }
   }
   if (isset($contactParams['api.contribution.create']) && isset($contactParams['api.membership.create'])) {
-    $contactParams['api.membership_payment.create'] = array(
+    $contactParams['api.membership_payment.create'] = [
       'contribution_id' => '$value.api.contribution.create.id',
       'membership_id' => '$value.api.membership.create.id',
-    );
+    ];
   }
 
   if (isset($contactParams['api.contribution.create']) && isset($contactParams['api.participant.create'])) {
-    $contactParams['api.participant_payment.create'] = array(
+    $contactParams['api.participant_payment.create'] = [
       'contribution_id' => '$value.api.contribution.create.id',
       'participant_id' => '$value.api.participant.create.id',
-    );
+    ];
   }
 
   $contactParams['contact_id'] = empty($params['contact_id']) ? CRM_Utils_Array::value('id', $params) : $params['contact_id'];
@@ -422,7 +422,7 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
 
   if (empty($params['contact_id'])) {
     $config = CRM_Core_Config::singleton();
-    $blanks = array(
+    $blanks = [
       'billing_first_name' => '',
       'billing_middle_name' => '',
       'billing_last_name' => '',
@@ -433,27 +433,27 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
       'billing_street_address-' . $locationTypeID => '',
       'billing_country_id-' . $locationTypeID => $config->defaultContactCountry,
       'billing_state_province_id-' . $locationTypeID => $config->defaultContactStateProvince,
-    );
+    ];
     return $blanks;
   }
 
-  $addressFields = array('street_address', 'city', 'state_province_id', 'country_id', 'postal_code');
-  $result = civicrm_api3('contact', 'getsingle', array(
+  $addressFields = ['street_address', 'city', 'state_province_id', 'country_id', 'postal_code'];
+  $result = civicrm_api3('contact', 'getsingle', [
     'id' => $params['contact_id'],
-    'api.address.get.1' => array('location_type_id' => 'Billing', 'return' => $addressFields),
+    'api.address.get.1' => ['location_type_id' => 'Billing', 'return' => $addressFields],
     // getting the is_billing required or not is an extra db call but probably cheap enough as this isn't an import api
-    'api.address.get.2' => array('is_billing' => TRUE, 'return' => $addressFields),
-    'api.email.get.1' => array('location_type_id' => 'Billing'),
-    'api.email.get.2' => array('is_billing' => TRUE),
+    'api.address.get.2' => ['is_billing' => TRUE, 'return' => $addressFields],
+    'api.email.get.1' => ['location_type_id' => 'Billing'],
+    'api.email.get.2' => ['is_billing' => TRUE],
     'return' => 'api.email.get, api.address.get, api.address.getoptions, country, state_province, email, first_name, last_name, middle_name, ' . implode($addressFields, ','),
-   )
+   ]
   );
 
-  $values = array(
+  $values = [
     'billing_first_name' => $result['first_name'],
     'billing_middle_name' => $result['middle_name'],
     'billing_last_name' => $result['last_name'],
-  );
+  ];
 
   if (!empty($result['api.address.get.1']['count'])) {
     foreach ($addressFields as $fieldname) {
@@ -505,9 +505,9 @@ function _civicrm_api3_profile_getbillingpseudoprofile(&$params) {
  * @return array|void
  */
 function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = 1, $is_flush) {
-  static $profileFields = array();
+  static $profileFields = [];
   if ($is_flush) {
-    $profileFields = array();
+    $profileFields = [];
     if (empty($profileID)) {
       return NULL;
     }
@@ -515,26 +515,26 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
   if (isset($profileFields[$profileID])) {
     return $profileFields[$profileID];
   }
-  $fields = civicrm_api3('uf_field', 'get', array('uf_group_id' => $profileID));
-  $entities = array();
+  $fields = civicrm_api3('uf_field', 'get', ['uf_group_id' => $profileID]);
+  $entities = [];
   foreach ($fields['values'] as $field) {
     if (!$field['is_active']) {
       continue;
     }
     list($entity, $fieldName) = _civicrm_api3_map_profile_fields_to_entity($field);
-    $aliasArray = array();
+    $aliasArray = [];
     if (strtolower($fieldName) != $fieldName) {
-      $aliasArray['api.aliases'] = array($fieldName);
+      $aliasArray['api.aliases'] = [$fieldName];
       $fieldName = strtolower($fieldName);
     }
-    $profileFields[$profileID][$fieldName] = array_merge(array(
+    $profileFields[$profileID][$fieldName] = array_merge([
       'api.required' => $field['is_required'],
       'title' => $field['label'],
       'help_pre' => CRM_Utils_Array::value('help_pre', $field),
       'help_post' => CRM_Utils_Array::value('help_post', $field),
       'entity' => $entity,
       'weight' => CRM_Utils_Array::value('weight', $field),
-    ), $aliasArray);
+    ], $aliasArray);
 
     $ufFieldTaleFieldName = $field['field_name'];
     if (isset($entity[$ufFieldTaleFieldName]['name'])) {
@@ -545,7 +545,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
     //see function notes
     // as we build up a list of these we should be able to determine a generic approach
     //
-    $hardCodedEntityFields = array(
+    $hardCodedEntityFields = [
       'state_province' => 'state_province_id',
       'country' => 'country_id',
       'participant_status' => 'status_id',
@@ -555,7 +555,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
       'group' => 'group_id',
       'tag' => 'tag_id',
       'soft_credit_type' => 'soft_credit_type_id',
-    );
+    ];
 
     if (array_key_exists($ufFieldTaleFieldName, $hardCodedEntityFields)) {
       $ufFieldTaleFieldName = $hardCodedEntityFields[$ufFieldTaleFieldName];
@@ -565,7 +565,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
   }
 
   foreach ($entities as $entity => $entityFields) {
-    $result = civicrm_api3($entity, 'getfields', array('action' => 'create'));
+    $result = civicrm_api3($entity, 'getfields', ['action' => 'create']);
     $entityGetFieldsResult = _civicrm_api3_profile_appendaliases($result['values'], $entity);
     foreach ($entityFields as $entityfield => $realName) {
       $fieldName = strtolower($entityfield);
@@ -591,11 +591,11 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour =
       }
       $profileFields[$profileID][$fieldName] = array_merge($entityGetFieldsResult[$realName], $profileFields[$profileID][$entityfield]);
       if (!isset($profileFields[$profileID][$fieldName]['api.aliases'])) {
-        $profileFields[$profileID][$fieldName]['api.aliases'] = array();
+        $profileFields[$profileID][$fieldName]['api.aliases'] = [];
       }
       if ($optionsBehaviour && !empty($entityGetFieldsResult[$realName]['pseudoconstant'])) {
-        if ($optionsBehaviour > 1  || !in_array($realName, array('state_province_id', 'county_id', 'country_id'))) {
-          $options = civicrm_api3($entity, 'getoptions', array('field' => $realName));
+        if ($optionsBehaviour > 1  || !in_array($realName, ['state_province_id', 'county_id', 'country_id'])) {
+          $options = civicrm_api3($entity, 'getoptions', ['field' => $realName]);
           $profileFields[$profileID][$fieldName]['options'] = $options['values'];
         }
       }
@@ -642,12 +642,12 @@ function _civicrm_api3_order_by_weight($a, $b) {
  */
 function _civicrm_api3_map_profile_fields_to_entity(&$field) {
   $entity = $field['field_type'];
-  $contactTypes = civicrm_api3('contact', 'getoptions', array('field' => 'contact_type'));
+  $contactTypes = civicrm_api3('contact', 'getoptions', ['field' => 'contact_type']);
   if (in_array($entity, $contactTypes['values'])) {
     $entity = 'contact';
   }
   $entity = _civicrm_api_get_entity_name_from_camel($entity);
-  $locationFields = array('email' => 'email');
+  $locationFields = ['email' => 'email'];
   $fieldName = $field['field_name'];
   if (!empty($field['location_type_id'])) {
     if ($fieldName == 'email') {
@@ -672,7 +672,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) {
   // not a great solution but probably if we looked in the BAO we'd find a scary switch statement
   // in a perfect world the uf_field table would hold the correct entity for each item
   // & only the relationships between entities would need to be coded
-  $hardCodedEntityMappings = array(
+  $hardCodedEntityMappings = [
     'street_address' => 'address',
     'street_number' => 'address',
     'supplemental_address_1' => 'address',
@@ -698,11 +698,11 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) {
     'group' => 'group_contact',
     'tag' => 'entity_tag',
     'note' => 'note',
-  );
+  ];
   if (array_key_exists($fieldName, $hardCodedEntityMappings)) {
     $entity = $hardCodedEntityMappings[$fieldName];
   }
-  return array($entity, $fieldName);
+  return [$entity, $fieldName];
 }
 
 /**
@@ -716,7 +716,7 @@ function _civicrm_api3_map_profile_fields_to_entity(&$field) {
  */
 function _civicrm_api3_profile_getProfileID($profileID) {
   if (!empty($profileID) && strtolower($profileID) != 'billing' && !is_numeric($profileID)) {
-    $profileID = civicrm_api3('uf_group', 'getvalue', array('return' => 'id', 'name' => $profileID));
+    $profileID = civicrm_api3('uf_group', 'getvalue', ['return' => 'id', 'name' => $profileID]);
   }
   return $profileID;
 }
@@ -745,8 +745,8 @@ function _civicrm_api3_profile_appendaliases($values, $entity) {
     }
   }
   //special case on membership & contribution - can't see how to handle in a generic way
-  if (in_array($entity, array('membership', 'contribution'))) {
-    $values['send_receipt'] = array('title' => 'Send Receipt', 'type' => (int) 16);
+  if (in_array($entity, ['membership', 'contribution'])) {
+    $values['send_receipt'] = ['title' => 'Send Receipt', 'type' => (int) 16];
   }
   return $values;
 }
@@ -757,8 +757,8 @@ function _civicrm_api3_profile_appendaliases($values, $entity) {
  *   Array of deprecated actions
  */
 function _civicrm_api3_profile_deprecation() {
-  return array(
+  return [
     'set' => 'Profile api "set" action is deprecated in favor of "submit".',
     'apply' => 'Profile api "apply" action is deprecated in favor of "submit".',
-  );
+  ];
 }
index 17fbaa4872d16cd3b7f08402765879a23edce216..3d7ec66cce1a9a28aa3be69433c16227293eec69 100644 (file)
@@ -52,10 +52,10 @@ function civicrm_api3_recurring_entity_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_recurring_entity_get_spec(&$params) {
-  $params['entity_table']['options'] = array(
+  $params['entity_table']['options'] = [
     'civicrm_event' => 'civicrm_event',
     'civicrm_activity' => 'civicrm_activity',
-  );
+  ];
 }
 
 /**
@@ -78,10 +78,10 @@ function civicrm_api3_recurring_entity_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_recurring_entity_create_spec(&$params) {
-  $params['entity_table']['options'] = array(
+  $params['entity_table']['options'] = [
     'civicrm_event' => 'civicrm_event',
     'civicrm_activity' => 'civicrm_activity',
-  );
+  ];
   $params['entity_table']['api.required'] = 1;
 }
 
index 30a172e1b6504eebf6a9c4139770ded24022125c..0a7254cc9adcf737e5c21702d363a91a45da90e7 100644 (file)
@@ -121,7 +121,7 @@ function civicrm_api3_relationship_get($params) {
   }
   //perhaps we should add a 'getcount' but at this stage lets just handle getcount output
   if ($options['is_count']) {
-    return array('count' => $relationships);
+    return ['count' => $relationships];
   }
   foreach ($relationships as $relationshipId => $values) {
     _civicrm_api3_custom_data_get($relationships[$relationshipId], CRM_Utils_Array::value('check_permissions', $params), 'Relationship', $relationshipId, NULL, CRM_Utils_Array::value('relationship_type_id', $values));
@@ -158,7 +158,7 @@ function _civicrm_api3_handle_relationship_type(&$params) {
  */
 function civicrm_api3_relationship_setvalue($params) {
   require_once 'api/v3/Generic/Setvalue.php';
-  $result = civicrm_api3_generic_setValue(array("entity" => 'Relationship', 'params' => $params));
+  $result = civicrm_api3_generic_setValue(["entity" => 'Relationship', 'params' => $params]);
 
   if (empty($result['is_error']) && CRM_Utils_String::munge($params['field']) == 'is_active') {
     $action = CRM_Core_Action::DISABLE;
index 6ff0766041348d7b543ee12959776ca3c59154a0..625bca61c0f65d0c849bdfd28aae6cc999d387af 100644 (file)
@@ -100,8 +100,8 @@ function civicrm_api3_relationship_type_delete($params) {
  * @return array
  */
 function _civicrm_api3_relationship_type_getlist_defaults($request) {
-  return array(
+  return [
     'label_field' => 'label_a_b',
     'search_field' => 'label_a_b',
-  );
+  ];
 }
index 9aa67bc356955def9275ed8bc5e1035deaef6da9..0e6fb0d32d58d4818086c7f792b85e823e3993b7 100644 (file)
@@ -71,10 +71,10 @@ function _civicrm_api3_report_instance_create_spec(&$params) {
   $params['view_mode']['api.default'] = 'view';
   $params['view_mode']['title'] = ts('View Mode for Navigation URL');
   $params['view_mode']['type'] = CRM_Utils_Type::T_STRING;
-  $params['view_mode']['options'] = array(
+  $params['view_mode']['options'] = [
     'view' => ts('View'),
     'criteria' => ts('Show Criteria'),
-  );
+  ];
 }
 
 /**
index 4237a6b14ef1c22ae637cd6d5ee20af1f9fc9f51..87d54afdce2e1370db633ce07bf9dfd6f6d4a25c 100644 (file)
@@ -63,7 +63,7 @@ function civicrm_api3_report_template_create($params) {
     'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name'
   );
   if (!empty($params['component_id']) && !is_numeric($params['component_id'])) {
-    $components = CRM_Core_PseudoConstant::get('CRM_Core_DAO_OptionValue', 'component_id', array('onlyActive' => FALSE, 'labelColumn' => 'name'));
+    $components = CRM_Core_PseudoConstant::get('CRM_Core_DAO_OptionValue', 'component_id', ['onlyActive' => FALSE, 'labelColumn' => 'name']);
     $params['component_id'] = array_search($params['component_id'], $components);
   }
   return civicrm_api3_option_value_create($params);
@@ -80,8 +80,8 @@ function civicrm_api3_report_template_create($params) {
 function _civicrm_api3_report_template_create_spec(&$params) {
   require_once 'api/v3/OptionValue.php';
   _civicrm_api3_option_value_create_spec($params);
-  $params['value']['api.aliases'] = array('report_url');
-  $params['name']['api.aliases'] = array('class_name');
+  $params['value']['api.aliases'] = ['report_url'];
+  $params['name']['api.aliases'] = ['class_name'];
   $params['option_group_id']['api.default'] = CRM_Core_DAO::getFieldValue(
     'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name'
   );
@@ -111,7 +111,7 @@ function civicrm_api3_report_template_delete($params) {
  *   API result array
  */
 function civicrm_api3_report_template_getrows($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array('report_id', 'instance_id'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['report_id', 'instance_id']);
   list($rows, $instance, $metadata) = _civicrm_api3_report_template_getrows($params);
   $instance->cleanUpTemporaryTables();
   return civicrm_api3_create_success($rows, $params, 'ReportTemplate', 'getrows', CRM_Core_DAO::$_nullObject, $metadata);
@@ -128,14 +128,14 @@ function civicrm_api3_report_template_getrows($params) {
  */
 function _civicrm_api3_report_template_getrows($params) {
   if (empty($params['report_id'])) {
-    $params['report_id'] = civicrm_api3('report_instance', 'getvalue', array('id' => $params['instance_id'], 'return' => 'report_id'));
+    $params['report_id'] = civicrm_api3('report_instance', 'getvalue', ['id' => $params['instance_id'], 'return' => 'report_id']);
   }
 
-  $class = (string) civicrm_api3('option_value', 'getvalue', array(
+  $class = (string) civicrm_api3('option_value', 'getvalue', [
     'option_group_name' => 'report_template',
     'return' => 'name',
     'value' => $params['report_id'],
-    )
+    ]
   );
 
   $reportInstance = new $class();
@@ -154,7 +154,7 @@ function _civicrm_api3_report_template_getrows($params) {
   $reportInstance->beginPostProcessCommon();
   $sql = $reportInstance->buildQuery();
   $reportInstance->addToDeveloperTab($sql);
-  $rows = $metadata = $requiredMetadata  = array();
+  $rows = $metadata = $requiredMetadata  = [];
   $reportInstance->buildRows($sql, $rows);
   $reportInstance->formatDisplay($rows);
 
@@ -174,7 +174,7 @@ function _civicrm_api3_report_template_getrows($params) {
       $metadata['metadata']['sql'] = $reportInstance->getReportSql();
     }
   }
-  return array($rows, $reportInstance, $metadata);
+  return [$rows, $reportInstance, $metadata];
 }
 
 /**
@@ -198,9 +198,9 @@ function civicrm_api3_report_template_getstatistics($params) {
  *   Input parameters.
  */
 function _civicrm_api3_report_template_getrows_spec(&$params) {
-  $params['report_id'] = array(
+  $params['report_id'] = [
     'title' => 'Report ID - eg. member/lapse',
-  );
+  ];
 }
 
 /* @codingStandardsIgnoreStart
index 65f449e10b0c6f93e8ef7ce1c84c99788c059a0a..4c6b7a2fd4ad46accce437f02d6d154fd75cc822 100644 (file)
@@ -43,7 +43,7 @@
  * @access public
  */
 function civicrm_api3_saved_search_create($params) {
-  civicrm_api3_verify_one_mandatory($params, NULL, array('form_values', 'where_clause'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['form_values', 'where_clause']);
   // The create function of the dao expects a 'formValues' that is
   // not serialized. The get function returns form_values, that is
   // serialized.
index 29df94b76e9cc0776318f77082bf728f698941ae..21a38ed52d6d77357af284786b4135f5d835fc89 100644 (file)
  */
 function civicrm_api3_setting_getfields($params) {
   if (!empty($params['action']) && strtolower($params['action']) == 'getvalue') {
-    $result = array(
-      'name' => array(
+    $result = [
+      'name' => [
         'title' => 'name of setting field',
         'api.required' => 1,
-        'type' => CRM_Utils_Type::T_STRING),
-      'group' => array(
+        'type' => CRM_Utils_Type::T_STRING],
+      'group' => [
         'api.required' => 0,
         'title' => 'Setting Group',
         'description' => 'Settings Group. This is required if the setting is not stored in config',
-        'type' => CRM_Utils_Type::T_STRING),
-    );
+        'type' => CRM_Utils_Type::T_STRING],
+    ];
     return civicrm_api3_create_success($result, $params, 'Setting', 'getfields');
   }
   if (!empty($params['name'])) {
@@ -60,7 +60,7 @@ function civicrm_api3_setting_getfields($params) {
   }
   $result = CRM_Core_BAO_Setting::getSettingSpecification(
     CRM_Utils_Array::value('component_id', $params),
-    CRM_Utils_Array::value('filters', $params, array()),
+    CRM_Utils_Array::value('filters', $params, []),
     CRM_Utils_Array::value('domain_id', $params, NULL),
     CRM_Utils_Array::value('profile', $params, NULL)
   );
@@ -80,18 +80,18 @@ function civicrm_api3_setting_getfields($params) {
  * @param array $params
  */
 function _civicrm_api3_setting_getfields_spec(&$params) {
-  $params['filters'] = array(
+  $params['filters'] = [
     'title' => 'Filters',
     'description' => 'Fields you wish to filter by e.g. array("group_name" => "CiviCRM Preferences")',
-  );
-  $params['component_id'] = array(
+  ];
+  $params['component_id'] = [
     'title' => 'Component ID',
     'description' => 'ID of relevant component',
-  );
-  $params['profile'] = array(
+  ];
+  $params['profile'] = [
     'title' => 'Profile',
     'description' => 'Profile is passed through to hooks & added to cachestring',
-  );
+  ];
 }
 
 /**
@@ -110,9 +110,9 @@ function _civicrm_api3_setting_getfields_spec(&$params) {
 function civicrm_api3_setting_getdefaults(&$params) {
   $settings = civicrm_api3('Setting', 'getfields', $params);
   $domains = _civicrm_api3_setting_getDomainArray($params);
-  $defaults = array();
+  $defaults = [];
   foreach ($domains as $domainID) {
-    $defaults[$domainID] = array();
+    $defaults[$domainID] = [];
     foreach ($settings['values'] as $setting => $spec) {
       if (array_key_exists('default', $spec) && !is_null($spec['default'])) {
         $defaults[$domainID][$setting] = $spec['default'];
@@ -128,12 +128,12 @@ function civicrm_api3_setting_getdefaults(&$params) {
  *   Parameters as passed to the API.
  */
 function _civicrm_api3_setting_getdefaults_spec(&$params) {
-  $params['domain_id'] = array(
+  $params['domain_id'] = [
     'api.default' => 'current_domain',
     'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain
       an array or "all" are acceptable values for multiple domains',
     'title' => 'Setting Domain',
-  );
+  ];
 }
 
 /**
@@ -157,7 +157,7 @@ function civicrm_api3_setting_getoptions($params) {
   // but it's tightly coupled to DAO/field. However, if you really need to support
   // more pseudoconstant types, then probably best to refactor it. For now, KISS.
   if (!empty($pseudoconstant['callback'])) {
-    $values = Civi\Core\Resolver::singleton()->call($pseudoconstant['callback'], array());
+    $values = Civi\Core\Resolver::singleton()->call($pseudoconstant['callback'], []);
     return civicrm_api3_create_success($values, $params, 'Setting', 'getoptions');
   }
   elseif (!empty($pseudoconstant['optionGroupName'])) {
@@ -187,7 +187,7 @@ function civicrm_api3_setting_revert(&$params) {
   $fields = civicrm_api('Setting', 'getfields', $params);
   $fields = $fields['values'];
   $domains = _civicrm_api3_setting_getDomainArray($params);
-  $result = array();
+  $result = [];
   foreach ($domains as $domainID) {
     $valuesToRevert = array_intersect_key($defaults['values'][$domainID], $fields);
     if (!empty($valuesToRevert)) {
@@ -207,20 +207,20 @@ function civicrm_api3_setting_revert(&$params) {
  * @param array $params
  */
 function _civicrm_api3_setting_revert_spec(&$params) {
-  $params['name'] = array(
+  $params['name'] = [
     'title' => 'Name',
     'description' => 'Setting Name belongs to',
-  );
-  $params['component_id'] = array(
+  ];
+  $params['component_id'] = [
     'title' => 'Component ID',
     'description' => 'ID of relevant component',
-  );
-  $params['domain_id'] = array(
+  ];
+  $params['domain_id'] = [
     'api.default' => 'current_domain',
     'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain'
     . ' an array or "all" are acceptable values for multiple domains',
     'title' => 'Setting Domain',
-  );
+  ];
 }
 
 /**
@@ -235,12 +235,12 @@ function _civicrm_api3_setting_revert_spec(&$params) {
 function civicrm_api3_setting_fill(&$params) {
   $defaults = civicrm_api3('Setting', 'getdefaults', $params);
   $domains = _civicrm_api3_setting_getDomainArray($params);
-  $result = array();
+  $result = [];
   foreach ($domains as $domainID) {
-    $apiArray = array(
+    $apiArray = [
       'version' => $params['version'],
       'domain_id' => $domainID,
-    );
+    ];
     $existing = civicrm_api3('Setting', 'get', $apiArray);
     $valuesToFill = array_diff_key($defaults['values'][$domainID], $existing['values'][$domainID]);
     if (!empty($valuesToFill)) {
@@ -256,20 +256,20 @@ function civicrm_api3_setting_fill(&$params) {
  * @param array $params
  */
 function _civicrm_api3_setting_fill_spec(&$params) {
-  $params['name'] = array(
+  $params['name'] = [
     'title' => 'Name',
     'description' => 'Setting Name belongs to',
-  );
-  $params['component_id'] = array(
+  ];
+  $params['component_id'] = [
     'title' => 'Component ID',
     'description' => 'ID of relevant component',
-  );
-  $params['domain_id'] = array(
+  ];
+  $params['domain_id'] = [
     'api.default' => 'current_domain',
     'title' => 'Setting Domain',
     'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the '
     . 'current domain, an array or "all" are acceptable values for multiple domains',
-  );
+  ];
 }
 
 /**
@@ -294,16 +294,16 @@ function civicrm_api3_setting_create($params) {
  *   Parameters as passed to the API.
  */
 function _civicrm_api3_setting_create_spec(&$params) {
-  $params['domain_id'] = array(
+  $params['domain_id'] = [
     'api.default' => 'current_domain',
     'title' => 'Setting Domain',
     'description' => 'if you do not pass in a domain id this will default to the current domain
       an array or "all" are acceptable values for multiple domains',
-  );
-  $params['group'] = array(
+  ];
+  $params['group'] = [
     'title' => 'Setting Group',
     'description' => 'if you know the group defining it will make the api more efficient',
-  );
+  ];
 }
 
 /**
@@ -317,7 +317,7 @@ function _civicrm_api3_setting_create_spec(&$params) {
  */
 function civicrm_api3_setting_get($params) {
   $domains = _civicrm_api3_setting_getDomainArray($params);
-  $result = CRM_Core_BAO_Setting::getItems($params, $domains, CRM_Utils_Array::value('return', $params, array()));
+  $result = CRM_Core_BAO_Setting::getItems($params, $domains, CRM_Utils_Array::value('return', $params, []));
   return civicrm_api3_create_success($result, $params, 'Setting', 'get');
 }
 /**
@@ -327,15 +327,15 @@ function civicrm_api3_setting_get($params) {
  *   Parameters as passed to the API.
  */
 function _civicrm_api3_setting_get_spec(&$params) {
-  $params['domain_id'] = array(
+  $params['domain_id'] = [
     'api.default' => 'current_domain',
     'title' => 'Setting Domain',
     'description' => 'if you do not pass in a domain id this will default to the current domain',
-  );
-  $params['group'] = array(
+  ];
+  $params['group'] = [
     'title' => 'Setting Group',
     'description' => 'if you know the group defining it will make the api more efficient',
-  );
+  ];
 }
 /**
  * Returns value for specific parameter.
@@ -373,27 +373,27 @@ function civicrm_api3_setting_getvalue($params) {
  */
 function _civicrm_api3_setting_getvalue_spec(&$params) {
 
-  $params['group'] = array(
+  $params['group'] = [
     'title' => 'Settings Group',
     'api.required' => TRUE,
-  );
-  $params['name'] = array(
+  ];
+  $params['name'] = [
     'title' => 'Setting Name',
-    'api.aliases' => array('return'),
-  );
-  $params['default_value'] = array(
+    'api.aliases' => ['return'],
+  ];
+  $params['default_value'] = [
     'title' => 'Default Value',
-  );
-  $params['component_id'] = array(
+  ];
+  $params['component_id'] = [
     'title' => 'Component Id',
-  );
-  $params['contact_id'] = array(
+  ];
+  $params['contact_id'] = [
     'title' => 'Contact Id',
-  );
-  $params['domain_id'] = array(
+  ];
+  $params['domain_id'] = [
     'title' => 'Setting Domain',
     'description' => 'if you do not pass in a domain id this will default to the current domain',
-  );
+  ];
 }
 
 /**
@@ -421,7 +421,7 @@ function _civicrm_api3_setting_getDomainArray(&$params) {
   }
 
   if ($params['domain_id'] == 'all') {
-    $domainAPIResult = civicrm_api('domain', 'get', array('version' => 3, 'return' => 'id'));
+    $domainAPIResult = civicrm_api('domain', 'get', ['version' => 3, 'return' => 'id']);
     if (isset($domainAPIResult['values'])) {
       $params['domain_id'] = array_keys($domainAPIResult['values']);
     }
@@ -433,7 +433,7 @@ function _civicrm_api3_setting_getDomainArray(&$params) {
     $domains = $params['domain_id'];
   }
   else {
-    $domains = array($params['domain_id']);
+    $domains = [$params['domain_id']];
   }
   return $domains;
 }
index 45b365c3e4d0d725709a9c9e1c8c1ac907372c6e..dbea9f1ec3b3dd6b32dd46282e0c2ac7c5ad3923 100644 (file)
@@ -99,12 +99,12 @@ function civicrm_api3_survey_delete($params) {
  * @return array
  */
 function _civicrm_api3_survey_getlist_defaults(&$request) {
-  return array(
-    'description_field' => array(
+  return [
+    'description_field' => [
       'campaign_id',
-    ),
-    'params' => array(
+    ],
+    'params' => [
       'is_active' => 1,
-    ),
-  );
+    ],
+  ];
 }
index f8b663eecefec1b3cbc7e124f26dbde3543f1967..5fccf6bc6f57a2d6f9388f60e0d10ce3ba903482 100644 (file)
@@ -56,7 +56,7 @@ function _civicrm_api3_survey_respondant_deprecation() {
  */
 function civicrm_api3_survey_respondant_get(&$params) {
 
-  civicrm_api3_verify_one_mandatory($params, NULL, array('survey_id', 'id'));
+  civicrm_api3_verify_one_mandatory($params, NULL, ['survey_id', 'id']);
 
   if (array_key_exists('survey_id', $params)) {
     $surveyID = $params['survey_id'];
@@ -70,7 +70,7 @@ function civicrm_api3_survey_respondant_get(&$params) {
     $interviewerID = $params['interviewer_id'];
   }
 
-  $statusIds = array();
+  $statusIds = [];
   if (array_key_exists('status_id', $params)) {
     $statusIds = explode(',', $params['status_id']);
   }
index e704db49526e1962576b695b00064f660236ece7..258afb3445dea5fb0d410846beda3ce867660343 100644 (file)
@@ -60,16 +60,16 @@ function civicrm_api3_system_flush($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_system_flush_spec(&$params) {
-  $params['triggers'] = array(
+  $params['triggers'] = [
     'title' => 'Triggers',
     'description' => 'rebuild triggers (boolean)',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $params['session'] = array(
+  ];
+  $params['session'] = [
     'title' => 'Sessions',
     'description' => 'refresh sessions (boolean)',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
+  ];
 }
 
 /**
@@ -83,53 +83,53 @@ function _civicrm_api3_system_flush_spec(&$params) {
  * @see http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
  */
 function _civicrm_api3_system_check_spec(&$spec) {
-  $spec['id'] = array(
+  $spec['id'] = [
     'title' => 'ID',
     'description' => 'Not a real identifier - do not use',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $spec['name'] = array(
+  ];
+  $spec['name'] = [
     'title' => 'Name',
     'description' => 'Unique identifier',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['title'] = array(
+  ];
+  $spec['title'] = [
     'title' => 'Title',
     'description' => 'Short title text',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['message'] = array(
+  ];
+  $spec['message'] = [
     'title' => 'Message',
     'description' => 'Long description html',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['help'] = array(
+  ];
+  $spec['help'] = [
     'title' => 'Help',
     'description' => 'Optional extra help (html string)',
     'type' => CRM_Utils_Type::T_STRING,
-  );
-  $spec['severity'] = array(
+  ];
+  $spec['severity'] = [
     'title' => 'Severity',
     'description' => 'Psr\Log\LogLevel string',
     'type' => CRM_Utils_Type::T_STRING,
     'options' => array_combine(CRM_Utils_Check::getSeverityList(), CRM_Utils_Check::getSeverityList()),
-  );
-  $spec['severity_id'] = array(
+  ];
+  $spec['severity_id'] = [
     'title' => 'Severity ID',
     'description' => 'Integer representation of Psr\Log\LogLevel',
     'type' => CRM_Utils_Type::T_INT,
     'options' => CRM_Utils_Check::getSeverityList(),
-  );
-  $spec['is_visible'] = array(
+  ];
+  $spec['is_visible'] = [
     'title' => 'is visible',
     'description' => '0 if message has been hidden by the user',
     'type' => CRM_Utils_Type::T_BOOLEAN,
-  );
-  $spec['hidden_until'] = array(
+  ];
+  $spec['hidden_until'] = [
     'title' => 'Hidden_until',
     'description' => 'When will hidden message be visible again?',
     'type' => CRM_Utils_Type::T_DATE,
-  );
+  ];
 }
 
 /**
@@ -146,14 +146,14 @@ function _civicrm_api3_system_check_spec(&$spec) {
 function civicrm_api3_system_check($params) {
   // array(array('name'=> $, 'severity'=>$, ...))
   $id = 1;
-  $returnValues = $fields = array();
+  $returnValues = $fields = [];
   _civicrm_api3_system_check_spec($fields);
 
   // array(CRM_Utils_Check_Message)
   $messages = CRM_Utils_Check::checkAll();
 
   foreach ($messages as $msg) {
-    $returnValues[] = $msg->toArray() + array('id' => $id++);
+    $returnValues[] = $msg->toArray() + ['id' => $id++];
   }
 
   return _civicrm_api3_basic_array_get('systemCheck', $params, $returnValues, "id", array_keys($fields));
@@ -171,9 +171,9 @@ function civicrm_api3_system_log($params) {
   // This part means fields with separate db storage are accepted as params which kind of seems more intuitive to me
   // because I felt like not doing this required a bunch of explanation in the spec function - but perhaps other won't see it as helpful?
   if (!isset($params['context'])) {
-    $params['context'] = array();
+    $params['context'] = [];
   }
-  $specialFields = array('contact_id', 'hostname');
+  $specialFields = ['contact_id', 'hostname'];
   foreach ($specialFields as $specialField) {
     if (isset($params[$specialField]) && !isset($params['context'])) {
       $params['context'][$specialField] = $params[$specialField];
@@ -189,34 +189,34 @@ function civicrm_api3_system_log($params) {
  * @param array $params
  */
 function _civicrm_api3_system_log_spec(&$params) {
-  $params['level'] = array(
+  $params['level'] = [
     'title' => 'Log Level',
     'description' => 'Log level as described in PSR3 (info, debug, warning etc)',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => TRUE,
-  );
-  $params['message'] = array(
+  ];
+  $params['message'] = [
     'title' => 'Log Message',
     'description' => 'Standardised message string, you can also ',
     'type' => CRM_Utils_Type::T_STRING,
     'api.required' => TRUE,
-  );
-  $params['context'] = array(
+  ];
+  $params['context'] = [
     'title' => 'Log Context',
     'description' => 'An array of additional data to store.',
     'type' => CRM_Utils_Type::T_LONGTEXT,
-    'api.default' => array(),
-  );
-  $params['contact_id'] = array(
+    'api.default' => [],
+  ];
+  $params['contact_id'] = [
     'title' => 'Log Contact ID',
     'description' => 'Optional ID of relevant contact',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['hostname'] = array(
+  ];
+  $params['hostname'] = [
     'title' => 'Log Hostname',
     'description' => 'Optional name of host',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
 
 /**
@@ -228,29 +228,29 @@ function _civicrm_api3_system_log_spec(&$params) {
  */
 function civicrm_api3_system_get($params) {
   $config = CRM_Core_Config::singleton();
-  $returnValues = array(
-    array(
+  $returnValues = [
+    [
       'version' => CRM_Utils_System::version(), // deprecated in favor of civi.version
       'uf' => CIVICRM_UF, // deprecated in favor of cms.type
-      'php' => array(
+      'php' => [
         'version' => phpversion(),
         'time' => time(),
         'tz' => date_default_timezone_get(),
         'sapi' => php_sapi_name(),
         'extensions' => get_loaded_extensions(),
         'ini' => _civicrm_api3_system_get_redacted_ini(),
-      ),
-      'mysql' => array(
+      ],
+      'mysql' => [
         'version' => CRM_Core_DAO::singleValueQuery('SELECT @@version'),
         'time' => CRM_Core_DAO::singleValueQuery('SELECT unix_timestamp()'),
         'vars' => _civicrm_api3_system_get_redacted_mysql(),
-      ),
-      'cms' => array(
+      ],
+      'cms' => [
         'version' => $config->userSystem->getVersion(),
         'type' => CIVICRM_UF,
         'modules' => CRM_Core_Module::collectStatuses($config->userSystem->getModules()),
-      ),
-      'civi' => array(
+      ],
+      'civi' => [
         'version' => CRM_Utils_System::version(),
         'dev' => (bool) CRM_Utils_System::isDevelopment(),
         'components' => array_keys(CRM_Core_Component::getEnabledComponents()),
@@ -262,20 +262,20 @@ function civicrm_api3_system_get($params) {
         'multidomain' => CRM_Core_DAO::singleValueQuery('SELECT count(*) FROM civicrm_domain') > 1,
         'settings' => _civicrm_api3_system_get_redacted_settings(),
         'exampleUrl' => CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE),
-      ),
-      'http' => array(
+      ],
+      'http' => [
         'software' => CRM_Utils_Array::value('SERVER_SOFTWARE', $_SERVER),
         'forwarded' => !empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['X_FORWARDED_PROTO']),
         'port' => (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? 'Standard' : 'Nonstandard',
-      ),
-      'os' => array(
+      ],
+      'os' => [
         'type' => php_uname('s'),
         'release' => php_uname('r'),
         'version' => php_uname('v'),
         'machine' => php_uname('m'),
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return civicrm_api3_create_success($returnValues, $params, 'System', 'get');
 }
@@ -308,7 +308,7 @@ function _civicrm_api3_system_get_redacted_ini() {
   }
 
   $inis = ini_get_all(NULL, FALSE);
-  $result = array();
+  $result = [];
   foreach ($inis as $k => $v) {
     if (empty($v) || in_array($k, $whitelist)) {
       $result[$k] = $v;
@@ -334,7 +334,7 @@ function _civicrm_api3_system_get_redacted_mysql() {
   }
 
   $inis = ini_get_all(NULL, FALSE);
-  $result = array();
+  $result = [];
   $dao = CRM_Core_DAO::executeQuery('SHOW VARIABLES');
   while ($dao->fetch()) {
     if (empty($dao->Variable_name) || in_array($dao->Variable_name, $whitelist)) {
@@ -360,8 +360,8 @@ function _civicrm_api3_system_get_redacted_settings() {
     $whitelist = _civicrm_api3_system_get_whitelist(__DIR__ . '/System/setting-whitelist.txt');
   }
 
-  $apiResult = civicrm_api3('Setting', 'get', array());
-  $result = array();
+  $apiResult = civicrm_api3('Setting', 'get', []);
+  $result = [];
   foreach ($apiResult['values'] as $settings) {
     foreach ($settings as $key => $value) {
       if (in_array($key, $whitelist)) {
index 7d66d3741b9982deef25f08a47d29a354dc9495b..a2077a592b3496442933596a5b64d593725581ab 100644 (file)
@@ -62,7 +62,7 @@ function civicrm_api3_tag_create($params) {
 function _civicrm_api3_tag_create_spec(&$params) {
   $params['used_for']['api.default'] = 'civicrm_contact';
   $params['name']['api.required'] = 1;
-  $params['id']['api.aliases'] = array('tag');
+  $params['id']['api.aliases'] = ['tag'];
 }
 
 /**
index 765f410bd92ca773483dc0012df6a8ecc2dbc29c..19e676f75f46e5ea6b74a810defac91f7b5cea76 100644 (file)
@@ -55,12 +55,12 @@ function _civicrm_api3_uf_field_create_spec(&$params) {
   $params['field_name']['api.required'] = TRUE;
   $params['uf_group_id']['api.required'] = TRUE;
 
-  $params['option.autoweight'] = array(
+  $params['option.autoweight'] = [
     'title' => "Auto Weight",
     'description' => "Automatically adjust weights in UFGroup to align with UFField",
     'type' => CRM_Utils_Type::T_BOOLEAN,
     'api.default' => TRUE,
-  );
+  ];
   $params['is_active']['api.default'] = TRUE;
 }
 
@@ -108,5 +108,5 @@ function civicrm_api3_uf_field_delete($params) {
  */
 function _civicrm_api3_uf_field_delete_spec(&$params) {
   // legacy support for field_id
-  $params['id']['api.aliases'] = array('field_id');
+  $params['id']['api.aliases'] = ['field_id'];
 }
index f2b176738095ae6466db9dc28f9098cb9792eeb4..653ebf02bb3df8fbfe2346d0aa8aeefb7764fc2e 100644 (file)
@@ -96,15 +96,15 @@ function civicrm_api3_uf_group_delete($params) {
  * @return array
  */
 function _civicrm_api3_uf_group_getlist_defaults(&$request) {
-  return array(
-    'description_field' => array(
+  return [
+    'description_field' => [
       'description',
       'group_type',
-    ),
-    'params' => array(
+    ],
+    'params' => [
       'is_active' => 1,
-    ),
-  );
+    ],
+  ];
 }
 
 /**
@@ -120,15 +120,15 @@ function _civicrm_api3_uf_group_getlist_defaults(&$request) {
  * @return array
  */
 function _civicrm_api3_uf_group_getlist_output($result, $request, $entity, $fields) {
-  $output = array();
+  $output = [];
   if (!empty($result['values'])) {
     foreach ($result['values'] as $row) {
-      $data = array(
+      $data = [
         'id' => $row[$request['id_field']],
         'label' => $row[$request['label_field']],
-      );
+      ];
       if (!empty($request['description_field'])) {
-        $data['description'] = array();
+        $data['description'] = [];
         foreach ((array) $request['description_field'] as $field) {
           if (!empty($row[$field])) {
             // Special formatting for group_type field
index e16ad2ddeb4d65e17df167c647373b539b94269c..47ebc7c98af7a1d3307ede35ffbf036662a2a110 100644 (file)
  */
 function civicrm_api3_user_get($params) {
   if (empty($params['contact_id'])) {
-    $params['contact_id'] = civicrm_api3('UFMatch', 'getvalue', array(
+    $params['contact_id'] = civicrm_api3('UFMatch', 'getvalue', [
       'uf_id' => $params['id'],
       'domain_id' => CRM_Core_Config::domainID(),
       'return' => 'contact_id',
-    ));
+    ]);
   }
   $result = CRM_Core_Config::singleton()->userSystem->getUser($params['contact_id']);
   $result['contact_id'] = $params['contact_id'];
   return civicrm_api3_create_success(
-    array($result['id'] => $result),
+    [$result['id'] => $result],
     $params,
     'user',
     'get'
@@ -67,17 +67,17 @@ function civicrm_api3_user_get($params) {
  */
 function _civicrm_api3_user_get_spec(&$params) {
   // At this stage contact-id is required - we may be able to loosen this.
-  $params['contact_id'] = array(
+  $params['contact_id'] = [
     'title' => 'Contact ID',
     'type' => CRM_Utils_Type::T_INT,
     'api.required' => 1,
-  );
-  $params['id'] = array(
+  ];
+  $params['id'] = [
     'title' => 'CMS User ID',
     'type' => CRM_Utils_Type::T_INT,
-  );
-  $params['name'] = array(
+  ];
+  $params['name'] = [
     'title' => 'Username',
     'type' => CRM_Utils_Type::T_STRING,
-  );
+  ];
 }
index b7e650b6e3ebdd1f7f2f4daf0ee133ea719509a5..7c70fcb0b6b6e069713c99c48e5164f844d42474 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function activity_create_example() {
-  $params = array(
+  $params = [
     'source_contact_id' => 1,
     'activity_type_id' => 'Test activity type',
     'subject' => 'test activity type id',
@@ -19,7 +19,7 @@ function activity_create_example() {
     'location' => 'Pennsylvania',
     'details' => 'a test activity',
     'custom_2' => '1',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'create', $params);
@@ -29,12 +29,12 @@ function activity_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -48,13 +48,13 @@ function activity_create_example() {
  */
 function activity_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'source_record_id' => '',
         'activity_type_id' => '9999',
@@ -80,9 +80,9 @@ function activity_create_expectedresult() {
         'engagement_level' => '',
         'weight' => '',
         'is_star' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 47e797e5b546dab3b0413578b625ea038ef4ec59..1b1ee194a388cb01f5e1b944ad09ecef6a1bc599 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function activity_get_example() {
-  $params = array(
+  $params = [
     'return.custom_2' => 1,
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'get', $params);
@@ -21,12 +21,12 @@ function activity_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function activity_get_example() {
  */
 function activity_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'activity_type_id' => '9999',
         'subject' => 'test activity type id',
@@ -68,9 +68,9 @@ function activity_get_expectedresult() {
         'custom_1_1' => 'defaultValue',
         'custom_2_1' => 'Anderson, Anthony',
         'custom_2_1_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0a3c1474f34fa6b31cb8f1ca88f96af6faf705ef..3d48bdddeb07e7ac75cdc462f23e8316d92e28d1 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function activity_create_example() {
-  $params = array(
+  $params = [
     'source_contact_id' => 1,
     'activity_type_id' => 'Test activity type',
     'subject' => 'test activity type id',
@@ -17,7 +17,7 @@ function activity_create_example() {
     'location' => 'Pennsylvania',
     'details' => 'a test activity',
     'custom_1' => 'custom string',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'create', $params);
@@ -27,12 +27,12 @@ function activity_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function activity_create_example() {
  */
 function activity_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'source_record_id' => '',
         'activity_type_id' => '9999',
@@ -78,9 +78,9 @@ function activity_create_expectedresult() {
         'engagement_level' => '',
         'weight' => '',
         'is_star' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b41659c20515cfc48ecb483e42723b126b9e4d1d..7f8009b078660fd9ae4ce943b426b4b51d140e1d 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function activity_get_example() {
-  $params = array(
+  $params = [
     'source_contact_id' => 1,
     'filter.activity_date_time_high' => '20120101000000',
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'get', $params);
@@ -22,12 +22,12 @@ function activity_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function activity_get_example() {
  */
 function activity_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'activity_type_id' => '9999',
         'subject' => 'Make-it-Happen Meeting',
@@ -63,9 +63,9 @@ function activity_get_expectedresult() {
         'is_deleted' => 0,
         'is_star' => 0,
         'source_contact_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index dec83787debbb812079e84916cc67c80659d8e2c..c4ccee6a683d6b2287964affbeff93e82d5ec21d 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function activity_get_example() {
-  $params = array(
+  $params = [
     'filter.activity_date_time_low' => '20120101000000',
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'get', $params);
@@ -21,12 +21,12 @@ function activity_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function activity_get_example() {
  */
 function activity_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '2',
         'activity_type_id' => '9999',
         'subject' => 'Make-it-Happen Meeting',
@@ -62,9 +62,9 @@ function activity_get_expectedresult() {
         'is_deleted' => 0,
         'is_star' => 0,
         'source_contact_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f2e9bbfa5772a191742552a0e80c8a326f3a4626..131e8ad31cf9667fbd4046c36b40ff2550731eab 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function activity_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'delete', $params);
@@ -18,12 +18,12 @@ function activity_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function activity_delete_example() {
  */
 function activity_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 9a208f9df17f11c073920312d0c7ae2c89530c8c..0c8055de06febd2ec2c51a2e44f0c64bd95c3869 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function activity_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'activity_type_id' => 9999,
     'sequential' => 1,
     'return.custom_1' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'get', $params);
@@ -21,12 +21,12 @@ function activity_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function activity_get_example() {
  */
 function activity_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'activity_type_id' => '9999',
         'subject' => 'test activity type id',
@@ -66,9 +66,9 @@ function activity_get_expectedresult() {
         'status' => 'Completed',
         'activity_name' => 'Test activity type',
         'custom_1_1' => 'custom string',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 76bca1d50070e383df652783a3fbed50260e4ca3..6155aa26ed744964a5407319d6ddf2c6d4b498ad 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function activity_getfields_example() {
-  $params = array(
+  $params = [
     'action' => 'create',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'getfields', $params);
@@ -18,12 +18,12 @@ function activity_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function activity_getfields_example() {
  */
 function activity_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 29,
-    'values' => array(
-      'source_record_id' => array(
+    'values' => [
+      'source_record_id' => [
         'name' => 'source_record_id',
         'type' => 1,
         'title' => 'Source Record',
@@ -50,8 +50,8 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-      ),
-      'activity_type_id' => array(
+      ],
+      'activity_type_id' => [
         'name' => 'activity_type_id',
         'type' => 1,
         'title' => 'Activity Type ID',
@@ -65,17 +65,17 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'activity_type',
           'optionEditPath' => 'civicrm/admin/options/activity_type',
-        ),
-      ),
-      'activity_date_time' => array(
+        ],
+      ],
+      'activity_date_time' => [
         'name' => 'activity_date_time',
         'type' => 12,
         'title' => 'Activity Date',
@@ -87,12 +87,12 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select Date',
           'format' => 'activityDateTime',
-        ),
-      ),
-      'phone_id' => array(
+        ],
+      ],
+      'phone_id' => [
         'name' => 'phone_id',
         'type' => 1,
         'title' => 'Phone (called) ID',
@@ -101,14 +101,14 @@ function activity_getfields_expectedresult() {
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
         'FKClassName' => 'CRM_Core_DAO_Phone',
-        'html' => array(
+        'html' => [
           'type' => 'EntityRef',
           'size' => 6,
           'maxlength' => 14,
-        ),
+        ],
         'FKApiName' => 'Phone',
-      ),
-      'phone_number' => array(
+      ],
+      'phone_number' => [
         'name' => 'phone_number',
         'type' => 2,
         'title' => 'Phone (called) Number',
@@ -118,13 +118,13 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
-      ),
-      'priority_id' => array(
+        ],
+      ],
+      'priority_id' => [
         'name' => 'priority_id',
         'type' => 1,
         'title' => 'Priority',
@@ -132,17 +132,17 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'priority',
           'optionEditPath' => 'civicrm/admin/options/priority',
-        ),
-      ),
-      'parent_id' => array(
+        ],
+      ],
+      'parent_id' => [
         'name' => 'parent_id',
         'type' => 1,
         'title' => 'Parent Activity Id',
@@ -152,16 +152,16 @@ function activity_getfields_expectedresult() {
         'bao' => 'CRM_Activity_BAO_Activity',
         'FKClassName' => 'CRM_Activity_DAO_Activity',
         'FKApiName' => 'Activity',
-      ),
-      'is_auto' => array(
+      ],
+      'is_auto' => [
         'name' => 'is_auto',
         'type' => 16,
         'title' => 'Auto',
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-      ),
-      'relationship_id' => array(
+      ],
+      'relationship_id' => [
         'name' => 'relationship_id',
         'type' => 1,
         'title' => 'Relationship Id',
@@ -172,8 +172,8 @@ function activity_getfields_expectedresult() {
         'bao' => 'CRM_Activity_BAO_Activity',
         'FKClassName' => 'CRM_Contact_DAO_Relationship',
         'FKApiName' => 'Relationship',
-      ),
-      'is_current_revision' => array(
+      ],
+      'is_current_revision' => [
         'name' => 'is_current_revision',
         'type' => 16,
         'title' => 'Is this activity a current revision in versioning chain?',
@@ -185,11 +185,11 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'original_id' => array(
+        ],
+      ],
+      'original_id' => [
         'name' => 'original_id',
         'type' => 1,
         'title' => 'Original Activity ID ',
@@ -199,21 +199,21 @@ function activity_getfields_expectedresult() {
         'bao' => 'CRM_Activity_BAO_Activity',
         'FKClassName' => 'CRM_Activity_DAO_Activity',
         'FKApiName' => 'Activity',
-      ),
-      'weight' => array(
+      ],
+      'weight' => [
         'name' => 'weight',
         'type' => 1,
         'title' => 'Order',
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'size' => 6,
           'maxlength' => 14,
-        ),
-      ),
-      'is_star' => array(
+        ],
+      ],
+      'is_star' => [
         'name' => 'is_star',
         'type' => 16,
         'title' => 'Is Starred',
@@ -225,8 +225,8 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-      ),
-      'id' => array(
+      ],
+      'id' => [
         'name' => 'id',
         'type' => 1,
         'title' => 'Activity ID',
@@ -239,11 +239,11 @@ function activity_getfields_expectedresult() {
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
         'uniqueName' => 'activity_id',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'activity_id',
-        ),
-      ),
-      'subject' => array(
+        ],
+      ],
+      'subject' => [
         'name' => 'subject',
         'type' => 2,
         'title' => 'Subject',
@@ -257,14 +257,14 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
+        ],
         'uniqueName' => 'activity_subject',
-      ),
-      'duration' => array(
+      ],
+      'duration' => [
         'name' => 'duration',
         'type' => 1,
         'title' => 'Duration',
@@ -276,14 +276,14 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'size' => 6,
           'maxlength' => 14,
-        ),
+        ],
         'uniqueName' => 'activity_duration',
-      ),
-      'location' => array(
+      ],
+      'location' => [
         'name' => 'location',
         'type' => 2,
         'title' => 'Location',
@@ -297,14 +297,14 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
+        ],
         'uniqueName' => 'activity_location',
-      ),
-      'details' => array(
+      ],
+      'details' => [
         'name' => 'details',
         'type' => 32,
         'title' => 'Details',
@@ -316,14 +316,14 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'RichTextEditor',
           'rows' => 2,
           'cols' => 80,
-        ),
+        ],
         'uniqueName' => 'activity_details',
-      ),
-      'status_id' => array(
+      ],
+      'status_id' => [
         'name' => 'status_id',
         'type' => 1,
         'title' => 'Activity Status',
@@ -334,21 +334,21 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'activity_status',
           'optionEditPath' => 'civicrm/admin/options/activity_status',
-        ),
+        ],
         'uniqueName' => 'activity_status_id',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'activity_status',
-        ),
-      ),
-      'is_test' => array(
+        ],
+      ],
+      'is_test' => [
         'name' => 'is_test',
         'type' => 16,
         'title' => 'Test',
@@ -359,12 +359,12 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
-        ),
+        ],
         'uniqueName' => 'activity_is_test',
-      ),
-      'medium_id' => array(
+      ],
+      'medium_id' => [
         'name' => 'medium_id',
         'type' => 1,
         'title' => 'Activity Medium',
@@ -373,18 +373,18 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'encounter_medium',
           'optionEditPath' => 'civicrm/admin/options/encounter_medium',
-        ),
+        ],
         'uniqueName' => 'activity_medium_id',
-      ),
-      'result' => array(
+      ],
+      'result' => [
         'name' => 'result',
         'type' => 2,
         'title' => 'Result',
@@ -394,14 +394,14 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
+        ],
         'uniqueName' => 'activity_result',
-      ),
-      'is_deleted' => array(
+      ],
+      'is_deleted' => [
         'name' => 'is_deleted',
         'type' => 16,
         'title' => 'Activity is in the Trash',
@@ -412,12 +412,12 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
-        ),
+        ],
         'uniqueName' => 'activity_is_deleted',
-      ),
-      'campaign_id' => array(
+      ],
+      'campaign_id' => [
         'name' => 'campaign_id',
         'type' => 1,
         'title' => 'Campaign',
@@ -429,20 +429,20 @@ function activity_getfields_expectedresult() {
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
         'FKClassName' => 'CRM_Campaign_DAO_Campaign',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'table' => 'civicrm_campaign',
           'keyColumn' => 'id',
           'labelColumn' => 'title',
-        ),
+        ],
         'uniqueName' => 'activity_campaign_id',
         'FKApiName' => 'Campaign',
-      ),
-      'engagement_level' => array(
+      ],
+      'engagement_level' => [
         'name' => 'engagement_level',
         'type' => 1,
         'title' => 'Engagement Index',
@@ -453,18 +453,18 @@ function activity_getfields_expectedresult() {
         'table_name' => 'civicrm_activity',
         'entity' => 'Activity',
         'bao' => 'CRM_Activity_BAO_Activity',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'engagement_index',
           'optionEditPath' => 'civicrm/admin/options/engagement_index',
-        ),
+        ],
         'uniqueName' => 'activity_engagement_level',
-      ),
-      'source_contact_id' => array(
+      ],
+      'source_contact_id' => [
         'name' => 'source_contact_id',
         'title' => 'Activity Source Contact',
         'description' => 'Person who created this activity. Defaults to current user.',
@@ -472,33 +472,33 @@ function activity_getfields_expectedresult() {
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'api.default' => 'user_contact_id',
         'FKApiName' => 'Contact',
-      ),
-      'assignee_contact_id' => array(
+      ],
+      'assignee_contact_id' => [
         'name' => 'assignee_id',
         'title' => 'Activity Assignee',
         'description' => 'Contact(s) assigned to this activity.',
         'type' => 1,
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-      'target_contact_id' => array(
+      ],
+      'target_contact_id' => [
         'name' => 'target_id',
         'title' => 'Activity Target',
         'description' => 'Contact(s) participating in this activity.',
         'type' => 1,
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-      'case_id' => array(
+      ],
+      'case_id' => [
         'name' => 'case_id',
         'title' => 'Case ID',
         'description' => 'For creating an activity as part of a case.',
         'type' => 1,
         'FKClassName' => 'CRM_Case_DAO_Case',
         'FKApiName' => 'Case',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c225c8d38e6afefb6e4b925bcfc7bc631de898f2..1cdffbae4b702d3d658593df286f77b83a5e667c 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function activity_create_example() {
-  $params = array(
+  $params = [
     'source_contact_id' => 1,
     'subject' => 'Make-it-Happen Meeting',
     'activity_date_time' => '20110316',
@@ -20,7 +20,7 @@ function activity_create_example() {
     'priority_id' => 1,
     'target_contact_id' => 1,
     'assignee_contact_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'create', $params);
@@ -30,12 +30,12 @@ function activity_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -49,13 +49,13 @@ function activity_create_example() {
  */
 function activity_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'source_record_id' => '',
         'activity_type_id' => '1',
@@ -81,9 +81,9 @@ function activity_create_expectedresult() {
         'engagement_level' => '',
         'weight' => '',
         'is_star' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 003b333d37daf5152ef254d97c2174410ae6c884..7eaa7b8f9b7c41d91f996cabbedab56fecee858d 100644 (file)
@@ -8,15 +8,15 @@
  *   API result array
  */
 function activity_getsingle_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-    'return' => array(
+    'return' => [
       '0' => 'source_contact_name',
       '1' => 'target_contact_name',
       '2' => 'assignee_contact_name',
       '3' => 'subject',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'getsingle', $params);
@@ -26,12 +26,12 @@ function activity_getsingle_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,23 +45,23 @@ function activity_getsingle_example() {
  */
 function activity_getsingle_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'id' => '1',
     'subject' => 'Make-it-Happen Meeting',
     'source_contact_id' => '6',
     'source_contact_name' => 'D Bug',
-    'target_contact_id' => array(
+    'target_contact_id' => [
       '1' => '4',
-    ),
-    'target_contact_name' => array(
+    ],
+    'target_contact_name' => [
       '3' => 'A Cat',
       '4' => 'B Good',
-    ),
-    'assignee_contact_id' => array(),
-    'assignee_contact_name' => array(
+    ],
+    'assignee_contact_id' => [],
+    'assignee_contact_name' => [
       '5' => 'C Shore',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 66177e8eaf5110744a43922f87bef96564496b09..3c61ec8b8a83a280d1833b7dd209c489bdf574e3 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function activity_get_example() {
-  $params = array(
+  $params = [
     'activity_id' => 1,
     'sequential' => 1,
     'return.assignee_contact_id' => 1,
-    'api.contact.get' => array(
+    'api.contact.get' => [
       'id' => '$value.source_contact_id',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Activity', 'get', $params);
@@ -25,12 +25,12 @@ function activity_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function activity_get_example() {
  */
 function activity_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'activity_type_id' => '9999',
         'subject' => 'test activity type id',
@@ -65,17 +65,17 @@ function activity_get_expectedresult() {
         'is_current_revision' => '1',
         'is_deleted' => 0,
         'is_star' => 0,
-        'assignee_contact_id' => array(
+        'assignee_contact_id' => [
           '0' => '3',
-        ),
+        ],
         'source_contact_id' => '1',
-        'api.contact.get' => array(
+        'api.contact.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'contact_id' => '1',
               'contact_type' => 'Individual',
               'contact_sub_type' => '',
@@ -144,12 +144,12 @@ function activity_get_expectedresult() {
               'state_province' => '',
               'country' => '',
               'id' => '1',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f01e72a52181c7a301fffb15ad78fe800657d89d..551318b11489fa59b57bf3ad362e94ea965698cd 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function activity_contact_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'activity_id' => 1,
     'record_type_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ActivityContact', 'create', $params);
@@ -20,12 +20,12 @@ function activity_contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function activity_contact_create_example() {
  */
 function activity_contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'activity_id' => '1',
         'contact_id' => '3',
         'record_type_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d627dcac85413d74a223752e81b2d137620e829b..e3cc42dceb6a681f8f75120fba9770fdb51a472b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function activity_contact_delete_example() {
-  $params = array(
+  $params = [
     'id' => 8,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ActivityContact', 'delete', $params);
@@ -18,12 +18,12 @@ function activity_contact_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function activity_contact_delete_example() {
  */
 function activity_contact_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index b3a231503be5467655f41d4ebed3d3bb47631938..10325428f7c5900f755ed6201a6158f879e8b751 100644 (file)
@@ -9,14 +9,14 @@
  *   API result array
  */
 function activity_type_create_example() {
-  $params = array(
+  $params = [
     'weight' => '2',
     'label' => 'send out letters',
     'filter' => 0,
     'is_active' => 1,
     'is_optgroup' => 1,
     'is_default' => 0,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ActivityType', 'create', $params);
@@ -26,12 +26,12 @@ function activity_type_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,13 +45,13 @@ function activity_type_create_example() {
  */
 function activity_type_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 849,
-    'values' => array(
-      '849' => array(
+    'values' => [
+      '849' => [
         'id' => '849',
         'option_group_id' => '2',
         'label' => 'send out letters',
@@ -70,10 +70,10 @@ function activity_type_create_expectedresult() {
         'visibility_id' => '',
         'icon' => '',
         'color' => '',
-      ),
-    ),
+      ],
+    ],
     'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
-  );
+  ];
 
   return $expectedResult;
 }
index 3befa05035d7e485d1fc4e5bb1c4229caf9c3886..a1d8d70fd9140ea507dc53a36de90a4fedc3737c 100644 (file)
@@ -9,7 +9,7 @@
  *   API result array
  */
 function activity_type_get_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('ActivityType', 'get', $params);
@@ -19,12 +19,12 @@ function activity_type_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,11 +38,11 @@ function activity_type_get_example() {
  */
 function activity_type_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 54,
-    'values' => array(
+    'values' => [
       '1' => 'Meeting',
       '2' => 'Phone Call',
       '3' => 'Email',
@@ -97,9 +97,9 @@ function activity_type_get_expectedresult() {
       '52' => 'Contact Deleted by Merge',
       '53' => 'Failed Payment',
       '54' => 'Close Accounting Period',
-    ),
+    ],
     'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
-  );
+  ];
 
   return $expectedResult;
 }
index 74d0da4545e46e2d10a8ed86a4512320be175c94..b781816ce6c4123dc6653600d4ede3028045d6f9 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function address_get_example() {
-  $params = array(
-    'street_address' => array(
+  $params = [
+    'street_address' => [
       'LIKE' => '%mb%',
-    ),
+    ],
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'get', $params);
@@ -23,12 +23,12 @@ function address_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function address_get_example() {
  */
 function address_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'contact_id' => '20',
         'location_type_id' => '18',
@@ -61,9 +61,9 @@ function address_get_expectedresult() {
         'postal_code' => '6971 BN',
         'country_id' => '1152',
         'manual_geo_code' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 329f7c071da63ea3c28d720173979d1e84148c09..ddd86d3cc0ac85a8b454d5594099178d026466ee 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function address_create_example() {
-  $params = array(
+  $params = [
     'street_parsing' => 1,
     'street_address' => '54A Excelsior Ave. Apt 1C',
     'location_type_id' => 7,
     'contact_id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'create', $params);
@@ -23,12 +23,12 @@ function address_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function address_create_example() {
  */
 function address_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '4',
         'location_type_id' => '7',
@@ -60,9 +60,9 @@ function address_create_expectedresult() {
         'street_name' => 'Excelsior Ave.',
         'street_unit' => 'Apt 1C',
         'manual_geo_code' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index de36d5b903f57a688a3580acecdb8fde1ac3f837..edde7694d211afe3728a0cd35b1d06ac22dcdb50 100644 (file)
@@ -8,13 +8,13 @@
  *   API result array
  */
 function address_get_example() {
-  $params = array(
-    'options' => array(
+  $params = [
+    'options' => [
       'sort' => 'street_address DESC',
       'limit' => 2,
-    ),
+    ],
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'get', $params);
@@ -24,12 +24,12 @@ function address_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,12 +43,12 @@ function address_get_example() {
  */
 function address_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '2',
         'contact_id' => '19',
         'location_type_id' => '17',
@@ -61,8 +61,8 @@ function address_get_expectedresult() {
         'postal_code' => '6971 BN',
         'country_id' => '1152',
         'manual_geo_code' => 0,
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'id' => '1',
         'contact_id' => '19',
         'location_type_id' => '17',
@@ -75,9 +75,9 @@ function address_get_expectedresult() {
         'postal_code' => '6971 BN',
         'country_id' => '1152',
         'manual_geo_code' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index cabd73c7be8b026575fadb53aab244abf2f86203..d4075de134aa650c29ffce894fedb5e13665f5a5 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function address_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'location_type_id' => 6,
     'street_name' => 'Ambachtstraat',
@@ -16,7 +16,7 @@ function address_create_example() {
     'country_id' => '1152',
     'city' => 'Brummen',
     'is_primary' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'create', $params);
@@ -26,12 +26,12 @@ function address_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,13 +45,13 @@ function address_create_example() {
  */
 function address_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '3',
         'location_type_id' => '6',
@@ -64,9 +64,9 @@ function address_create_expectedresult() {
         'postal_code' => '6971 BN',
         'country_id' => '1152',
         'manual_geo_code' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 09e586766976700983dda9fd6b39882b64c54cff..0f9508a113c10faebaa5b7f3fbf84ac353fb40d1 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function address_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'delete', $params);
@@ -18,12 +18,12 @@ function address_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function address_delete_example() {
  */
 function address_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index f19315e08536129f62193d83e50116f0e2e2460e..89cb571ae345aab902c85a4593bf6869f6e97d36 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function address_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 17,
     'street_name' => 'Ambachtstraat',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'get', $params);
@@ -19,12 +19,12 @@ function address_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function address_get_example() {
  */
 function address_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '17',
         'location_type_id' => '15',
@@ -57,9 +57,9 @@ function address_get_expectedresult() {
         'postal_code' => '6971 BN',
         'country_id' => '1152',
         'manual_geo_code' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 436b1e475a7c89c79109180d2cf52eca15124851..3ec7f662b928cfd2db86349f55581cb1f7a7d6e7 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function address_getoptions_example() {
-  $params = array(
+  $params = [
     'field' => 'location_type_id',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Address', 'getoptions', $params);
@@ -18,12 +18,12 @@ function address_getoptions_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,18 +37,18 @@ function address_getoptions_example() {
  */
 function address_getoptions_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
-    'values' => array(
+    'values' => [
       '5' => 'Billing',
       '1' => 'Home',
       '3' => 'Main',
       '4' => 'Other',
       '2' => 'Work',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 6b4c9f19910b7d87337cb2fb3f02ba220bfb10eb..e8cf61299b81ccf1380e98af522dd7acec293ef4 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function batch_create_example() {
-  $params = array(
+  $params = [
     'name' => 'New_Batch_04',
     'title' => 'New Batch 04',
     'description' => 'This is description for New Batch 04',
     'total' => '400.44',
     'item_count' => 4,
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Batch', 'create', $params);
@@ -23,12 +23,12 @@ function batch_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function batch_create_example() {
  */
 function batch_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'name' => 'New_Batch_04',
         'title' => 'New Batch 04',
@@ -66,9 +66,9 @@ function batch_create_expectedresult() {
         'payment_instrument_id' => '',
         'exported_date' => '',
         'data' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index bed04ab9bdb5cf787c120d8a304815a352290f69..a8478434a5719365e03cb62dd7c686943e08b262 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function batch_delete_example() {
-  $params = array(
+  $params = [
     'id' => 5,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Batch', 'delete', $params);
@@ -18,12 +18,12 @@ function batch_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function batch_delete_example() {
  */
 function batch_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 9deff39a48664ef73c0eb72d6e42237444f3eb61..45420adb86af1a36d880e9dc73b6f67fd853087d 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function batch_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Batch', 'get', $params);
@@ -18,12 +18,12 @@ function batch_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,21 +37,21 @@ function batch_get_example() {
  */
 function batch_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'Batch_433397',
         'title' => 'Batch_433397',
         'modified_date' => '2012-11-14 16:02:35',
         'status_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index df859472e4b309248b36257d2eec5acf0cbc0760..5eed12da7e5e9ec3e661f978ff376fb3a3a7a9d9 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function batch_update_example() {
-  $params = array(
+  $params = [
     'name' => 'New_Batch_04',
     'title' => 'New Batch 04',
     'description' => 'This is description for New Batch 04',
     'total' => '400.44',
     'item_count' => 4,
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('batch', 'update', $params);
@@ -23,11 +23,11 @@ function batch_update_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function batch_update_example() {
  */
 function batch_update_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'name' => 'New_Batch_04',
         'title' => 'New Batch 04',
@@ -65,9 +65,9 @@ function batch_update_expectedresult() {
         'payment_instrument_id' => '',
         'exported_date' => '',
         'data' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 86f1df29d11342da66dc56d709d3b6426f4dcae2..1a8e74242d0dbbdce61d8cd907e0396e4de8bb2b 100644 (file)
@@ -9,11 +9,11 @@
  *   API result array
  */
 function campaign_create_example() {
-  $params = array(
+  $params = [
     'title' => 'campaign title',
     'description' => 'Call people, ask for money',
     'created_date' => 'first sat of July 2008',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Campaign', 'create', $params);
@@ -23,12 +23,12 @@ function campaign_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function campaign_create_example() {
  */
 function campaign_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'campaign_title',
         'title' => 'campaign title',
@@ -66,9 +66,9 @@ function campaign_create_expectedresult() {
         'last_modified_date' => '',
         'goal_general' => '',
         'goal_revenue' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d6b5fd5eaea09b71089f8d7a227ffbb1c31aae8a..b6d5d3c420907bd4e8482a1030367b958e4fa722 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function campaign_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Campaign', 'delete', $params);
@@ -18,12 +18,12 @@ function campaign_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function campaign_delete_example() {
  */
 function campaign_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index afad3b080a156bb9dd26a9f9218c3c5e2d1ad2ea..5e6fb6a0f022d06ab53ad7e52457e72cadea670d 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function campaign_get_example() {
-  $params = array(
+  $params = [
     'title' => 'campaign title',
     'description' => 'Call people, ask for money',
     'created_date' => 'first sat of July 2008',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Campaign', 'get', $params);
@@ -20,12 +20,12 @@ function campaign_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,22 +39,22 @@ function campaign_get_example() {
  */
 function campaign_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'name' => 'campaign_title',
         'title' => 'campaign title',
         'description' => 'Call people, ask for money',
         'is_active' => '1',
         'created_date' => '2013-07-28 08:49:19',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index bfffed40bb9672fd2725074f64366e75ba7e1ac9..d57c589a9c28d9a26d40f915ad39c934a42bd2e2 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function case_create_example() {
-  $params = array(
+  $params = [
     'subject' => 'Test case',
     'contact_id' => 17,
     'case_type' => 'housing_support',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Case', 'create', $params);
@@ -20,12 +20,12 @@ function case_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function case_create_example() {
  */
 function case_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'case_type_id' => '1',
         'subject' => 'Test case',
@@ -54,9 +54,9 @@ function case_create_expectedresult() {
         'details' => '',
         'status_id' => '1',
         'is_deleted' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b4070df73a1223034c30c81c873ea2f6b93102a1..3f12514ceae4849d88c01a6069230e42dba800b3 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function case_contact_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 19,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CaseContact', 'get', $params);
@@ -18,12 +18,12 @@ function case_contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,19 +37,19 @@ function case_contact_get_example() {
  */
 function case_contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'case_id' => '2',
         'contact_id' => '19',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 561e259a1eb5ccce15ed53f2f6dc3ee265716562..c147be4c928a3c077d465c1b2be3205671c32453 100644 (file)
@@ -9,9 +9,9 @@
  *   API result array
  */
 function constant_get_example() {
-  $params = array(
+  $params = [
     'name' => 'activityType',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Constant', 'get', $params);
@@ -21,12 +21,12 @@ function constant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,11 +40,11 @@ function constant_get_example() {
  */
 function constant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 36,
-    'values' => array(
+    'values' => [
       '1' => 'Meeting',
       '2' => 'Phone Call',
       '3' => 'Email',
@@ -81,9 +81,9 @@ function constant_get_expectedresult() {
       '52' => 'Contact Deleted by Merge',
       '53' => 'Failed Payment',
       '54' => 'Close Accounting Period',
-    ),
+    ],
     'deprecated' => 'The Constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.',
-  );
+  ];
 
   return $expectedResult;
 }
index 4a6ed7ea9e108fb9829c62faf9ba2e8a5c449858..d69e48ce4c34e293caead31bcd9354164d3c3b97 100644 (file)
@@ -9,15 +9,15 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-    'api.website.get' => array(),
-    'api.Contribution.get' => array(
+    'api.website.get' => [],
+    'api.Contribution.get' => [
       'total_amount' => '120.00',
-    ),
+    ],
     'api.CustomValue.get' => 1,
     'api.Note.get' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -27,12 +27,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -121,26 +121,26 @@ function contact_get_expectedresult() {
         'state_province' => '',
         'country' => '',
         'id' => '3',
-        'api.website.get' => array(
+        'api.website.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'contact_id' => '3',
               'url' => 'http://civicrm.org',
-            ),
-          ),
-        ),
-        'api.Contribution.get' => array(
+            ],
+          ],
+        ],
+        'api.Contribution.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 2,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'contact_id' => '3',
               'contact_type' => 'Individual',
               'contact_sub_type' => '',
@@ -190,24 +190,24 @@ function contact_get_expectedresult() {
               'instrument_id' => '1',
               'id' => '2',
               'contribution_type_id' => '1',
-            ),
-          ),
-        ),
-        'api.CustomValue.get' => array(
+            ],
+          ],
+        ],
+        'api.CustomValue.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 0,
-          'values' => array(),
-        ),
-        'api.Note.get' => array(
+          'values' => [],
+        ],
+        'api.Note.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 0,
-          'values' => array(),
-        ),
-      ),
-    ),
-  );
+          'values' => [],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 83f9f60cf9ac9f101db3dbb3cf06c856840343f9..a0c462fceea96ac5223b79ac26e0f34cb5f0a66c 100644 (file)
@@ -9,16 +9,16 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-    'api.website.getValue' => array(
+    'api.website.getValue' => [
       'return' => 'url',
-    ),
-    'api.Contribution.getCount' => array(),
+    ],
+    'api.Contribution.getCount' => [],
     'api.CustomValue.get' => 1,
     'api.Note.get' => 1,
-    'api.Membership.getCount' => array(),
-  );
+    'api.Membership.getCount' => [],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -28,12 +28,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -47,13 +47,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -124,22 +124,22 @@ function contact_get_expectedresult() {
         'id' => '3',
         'api.website.getValue' => 'http://civicrm.org',
         'api.Contribution.getCount' => 2,
-        'api.CustomValue.get' => array(
+        'api.CustomValue.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 0,
-          'values' => array(),
-        ),
-        'api.Note.get' => array(
+          'values' => [],
+        ],
+        'api.Note.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 0,
-          'values' => array(),
-        ),
+          'values' => [],
+        ],
         'api.Membership.getCount' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index cbc095d01c9ff3ee4f57cb4522943a56a4045db4..555b0d3bc1f71f901d34ebf2c26d361074fa176f 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-    'api.website.getValue' => array(
+    'api.website.getValue' => [
       'return' => 'url',
-    ),
-    'api.Contribution.getCount' => array(),
+    ],
+    'api.Contribution.getCount' => [],
     'api.CustomValue.get' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -25,12 +25,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -121,67 +121,67 @@ function contact_get_expectedresult() {
         'id' => '3',
         'api.website.getValue' => 'http://civicrm.org',
         'api.Contribution.getCount' => 2,
-        'api.CustomValue.get' => array(
+        'api.CustomValue.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 7,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => 'value 4',
               'id' => '1',
-            ),
-            '1' => array(
+            ],
+            '1' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => 'value 3',
               'id' => '2',
               '1' => 'value 2',
               '2' => 'value 3',
-            ),
-            '2' => array(
+            ],
+            '2' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => '',
               'id' => '3',
               '1' => 'warm beer',
               '2' => '',
-            ),
-            '3' => array(
+            ],
+            '3' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => '',
               'id' => '4',
               '1' => '',
               '2' => '',
-            ),
-            '4' => array(
+            ],
+            '4' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => 'defaultValue',
               'id' => '5',
               '1' => 'defaultValue',
-            ),
-            '5' => array(
+            ],
+            '5' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => 'vegemite',
               'id' => '6',
               '1' => 'vegemite',
-            ),
-            '6' => array(
+            ],
+            '6' => [
               'entity_id' => '3',
               'entity_table' => 'Contact',
               'latest' => '',
               'id' => '7',
               '1' => '',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 6bca265586b6a07580e2d29c5694e23008c542fc..91f2eae1924e1987009b71f0482889a98ad9825e 100644 (file)
@@ -9,18 +9,18 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'display_name' => 'batman',
     'contact_type' => 'Individual',
-    'api.tag.create' => array(
+    'api.tag.create' => [
       'name' => '$value.id',
       'description' => '$value.display_name',
       'format.only_id' => 1,
-    ),
-    'api.entity_tag.create' => array(
+    ],
+    'api.entity_tag.create' => [
       'tag_id' => '$value.api.tag.create',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -30,12 +30,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -49,13 +49,13 @@ function contact_create_example() {
  */
 function contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -106,15 +106,15 @@ function contact_create_expectedresult() {
         'created_date' => '2013-07-28 08:49:19',
         'modified_date' => '2012-11-14 16:02:35',
         'api.tag.create' => 6,
-        'api.entity_tag.create' => array(
+        'api.entity_tag.create' => [
           'is_error' => 0,
           'not_added' => 1,
           'added' => 1,
           'total_count' => 2,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0c1f887ed412d029d91fddbd3ba81362da828ce6..1d2d0159674c1510340949841f60aecc7ca149de 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'first_name' => 'abc3',
     'last_name' => 'xyz3',
     'contact_type' => 'Individual',
     'email' => 'man3@yahoo.com',
-    'api.contribution.create' => array(
+    'api.contribution.create' => [
       'receive_date' => '2010-01-01',
       'total_amount' => '100',
       'financial_type_id' => 1,
@@ -25,14 +25,14 @@ function contact_create_example() {
       'invoice_id' => 67990,
       'source' => 'SSF',
       'contribution_status_id' => 1,
-    ),
-    'api.website.create' => array(
+    ],
+    'api.website.create' => [
       'url' => 'http://civicrm.org',
-    ),
-    'api.website.create.2' => array(
+    ],
+    'api.website.create.2' => [
       'url' => 'http://chained.org',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -42,12 +42,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -61,13 +61,13 @@ function contact_create_example() {
  */
 function contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -117,13 +117,13 @@ function contact_create_expectedresult() {
         'user_unique_id' => '',
         'created_date' => '2013-07-28 08:49:19',
         'modified_date' => '2012-11-14 16:02:35',
-        'api.contribution.create' => array(
+        'api.contribution.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'contact_id' => '3',
               'financial_type_id' => '1',
@@ -154,40 +154,40 @@ function contact_create_expectedresult() {
               'tax_amount' => '',
               'revenue_recognition_date' => '',
               'contribution_type_id' => '1',
-            ),
-          ),
-        ),
-        'api.website.create' => array(
+            ],
+          ],
+        ],
+        'api.website.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'contact_id' => '3',
               'url' => 'http://civicrm.org',
               'website_type_id' => '',
-            ),
-          ),
-        ),
-        'api.website.create.2' => array(
+            ],
+          ],
+        ],
+        'api.website.create.2' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 2,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '2',
               'contact_id' => '3',
               'url' => 'http://chained.org',
               'website_type_id' => '',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f6ae673091d10b66f7f37279f5e413a9a520129b..d3050a7b940fe05dca363c80732e2c47577b2890 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'first_name' => 'abc3',
     'last_name' => 'xyz3',
     'contact_type' => 'Individual',
     'email' => 'man3@yahoo.com',
-    'api.contribution.create' => array(
+    'api.contribution.create' => [
       'receive_date' => '2010-01-01',
       'total_amount' => '100',
       'financial_type_id' => 1,
@@ -25,17 +25,17 @@ function contact_create_example() {
       'invoice_id' => 67890,
       'source' => 'SSF',
       'contribution_status_id' => 1,
-    ),
-    'api.website.create' => array(
-      '0' => array(
+    ],
+    'api.website.create' => [
+      '0' => [
         'url' => 'http://civicrm.org',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'url' => 'http://chained.org',
         'website_type_id' => 2,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -45,12 +45,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -64,13 +64,13 @@ function contact_create_example() {
  */
 function contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -120,13 +120,13 @@ function contact_create_expectedresult() {
         'user_unique_id' => '',
         'created_date' => '2013-07-28 08:49:19',
         'modified_date' => '2012-11-14 16:02:35',
-        'api.contribution.create' => array(
+        'api.contribution.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'contact_id' => '3',
               'financial_type_id' => '1',
@@ -157,42 +157,42 @@ function contact_create_expectedresult() {
               'tax_amount' => '',
               'revenue_recognition_date' => '',
               'contribution_type_id' => '1',
-            ),
-          ),
-        ),
-        'api.website.create' => array(
-          '0' => array(
+            ],
+          ],
+        ],
+        'api.website.create' => [
+          '0' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 1,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '1',
                 'contact_id' => '3',
                 'url' => 'http://civicrm.org',
                 'website_type_id' => '',
-              ),
-            ),
-          ),
-          '1' => array(
+              ],
+            ],
+          ],
+          '1' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 2,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '2',
                 'contact_id' => '3',
                 'url' => 'http://chained.org',
                 'website_type_id' => '2',
-              ),
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+              ],
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f69947ecc4936065db028aec7fd98ae8e7b74fd1..c38bd4708b39152a5999fb2449b5b8a5b5b01d1e 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 'user_contact_id',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -20,12 +20,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -113,9 +113,9 @@ function contact_get_expectedresult() {
         'state_province' => '',
         'country' => '',
         'id' => '3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 107c95ded389111e7f356d9dc8a3f726a2f90c35..a0727ef7e0aac2e9e51f0656576950d9941bdb87 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'first_name' => 'abc1',
     'contact_type' => 'Individual',
     'last_name' => 'xyz1',
     'custom_1' => 'custom string',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -23,12 +23,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function contact_create_example() {
  */
 function contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -98,9 +98,9 @@ function contact_create_expectedresult() {
         'user_unique_id' => '',
         'created_date' => '2013-07-28 08:49:19',
         'modified_date' => '2012-11-14 16:02:35',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 7a66c4277b84121cde4e1269030a122a60d13866..9cc9537ae83410be56136795b1f589294beb79ba 100644 (file)
@@ -9,25 +9,25 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'contact_type' => 'Individual',
     'display_name' => 'dlobo',
-    'api.participant' => array(
+    'api.participant' => [
       'event_id' => 42,
       'status_id' => 1,
       'role_id' => 1,
       'format.only_id' => 1,
-    ),
-    'api.contribution.create' => array(
+    ],
+    'api.contribution.create' => [
       'financial_type_id' => 1,
       'total_amount' => 100,
       'format.only_id' => 1,
-    ),
-    'api.participant_payment.create' => array(
+    ],
+    'api.participant_payment.create' => [
       'contribution_id' => '$value.api.contribution.create',
       'participant_id' => '$value.api.participant',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -37,12 +37,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -56,13 +56,13 @@ function contact_create_example() {
  */
 function contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 5,
-    'values' => array(
-      '5' => array(
+    'values' => [
+      '5' => [
         'id' => '5',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -114,22 +114,22 @@ function contact_create_expectedresult() {
         'modified_date' => '2012-11-14 16:02:35',
         'api.participant' => 4,
         'api.contribution.create' => 1,
-        'api.participant_payment.create' => array(
+        'api.participant_payment.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'participant_id' => '4',
               'contribution_id' => '1',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 07e8ae1e6e6ed9970a952f5481f3a16d83ebd78b..32e6c2218a2fb6891075bf392657cf5687f57b5b 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'return.custom_1' => 1,
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -21,12 +21,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,20 +40,20 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'civicrm_value_testgetwithcu_1_id' => '1',
         'custom_1' => 'custom string',
         'id' => '3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c1e47702bff5f10dd82092acd931ab33160b747d..4e130c6fbf66397d4f6759519ac91d6addb691d3 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'return' => 'custom_1',
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -21,12 +21,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,20 +40,20 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'civicrm_value_testgetwithcu_1_id' => '1',
         'custom_1' => 'custom string',
         'id' => '3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1bb7f83feb3e21c2eea3bbc3f45bc60e84626884..c6d0df354bb043d7f92e64c3b72d13a117fd32d4 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contact_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'delete', $params);
@@ -18,12 +18,12 @@ function contact_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function contact_delete_example() {
  */
 function contact_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index add6872f4b45d646e1365b51fb272edf898ea0a3..c0625de77675463d27825a9c56e132f87c254274 100644 (file)
@@ -9,10 +9,10 @@
  *   API result array
  */
 function contact_create_example() {
-  $params = array(
+  $params = [
     'id' => 500,
     'format.is_success' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'create', $params);
@@ -22,12 +22,12 @@ function contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 9f46af903faf70d2429e118210937560d612844b..14d29195ea5222d31366027df15f3a3f3c2e9d7b 100644 (file)
@@ -9,10 +9,10 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 17,
     'format.is_success' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -22,12 +22,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index e208faeddb88d9c5d656e4072543b98202cd9d07..201111a312ea97dcda5e4e78b8ed7dcc22d64d0b 100644 (file)
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 17,
     'format.only_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -23,12 +23,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 49d52becc1b09f9dd70fffe023c5acdf0d55441a..fa3f23783e4e0c6dc6b0b7f7a6f59d074d411bf7 100644 (file)
  *   API result array
  */
 function contact_getvalue_example() {
-  $params = array(
+  $params = [
     'id' => 17,
     'return' => 'display_name',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'getvalue', $params);
@@ -23,12 +23,12 @@ function contact_getvalue_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 58120fefd2d195e0b43c516bbd7704be169873e1..17b6b621028760d26db3c015ea37d3259fae7cba 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'email' => 'man2@yahoo.com',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -18,12 +18,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -112,9 +112,9 @@ function contact_get_expectedresult() {
         'state_province' => '',
         'country' => '',
         'id' => '3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 585e5e8dca83137190c6126b0b619d2837f1ad06..459b2e1e6441565d4e484aead943e8a030dd8f8a 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contact_getactions_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('Contact', 'getactions', $params);
@@ -18,12 +18,12 @@ function contact_getactions_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,11 +37,11 @@ function contact_getactions_example() {
  */
 function contact_getactions_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 20,
-    'values' => array(
+    'values' => [
       '0' => 'create',
       '1' => 'delete',
       '2' => 'duplicatecheck',
@@ -62,13 +62,13 @@ function contact_getactions_expectedresult() {
       '17' => 'setvalue',
       '18' => 'update',
       '19' => 'validate',
-    ),
-    'deprecated' => array(
+    ],
+    'deprecated' => [
       'getquick' => 'The "getquick" action is deprecated in favor of "getlist".',
       'setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.',
       'update' => 'The "update" action is deprecated. Use "create" with an id instead.',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 7a775e80f202e06768ba46ebbb40d838e1ff2784..5bffef16fcd6aa1e57348fcfc749e327ffe40e03 100644 (file)
@@ -9,9 +9,9 @@
  *   API result array
  */
 function contact_getcount_example() {
-  $params = array(
+  $params = [
     'id' => 17,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'getcount', $params);
@@ -21,12 +21,12 @@ function contact_getcount_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 57972c52525932146d426b8efb3f28adc51895f1..d800b7268051f682b52f2d61332ddab4a20b306c 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function contact_getfields_example() {
-  $params = array(
-    'options' => array(
+  $params = [
+    'options' => [
       'get_options' => 'custom_1',
-    ),
+    ],
     'action' => 'create',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'getfields', $params);
@@ -23,12 +23,12 @@ function contact_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,12 +42,12 @@ function contact_getfields_example() {
  */
 function contact_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 55,
-    'values' => array(
-      'id' => array(
+    'values' => [
+      'id' => [
         'name' => 'id',
         'type' => 1,
         'title' => 'Contact ID',
@@ -60,11 +60,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'contact_id',
-        ),
-      ),
-      'contact_type' => array(
+        ],
+      ],
+      'contact_type' => [
         'name' => 'contact_type',
         'type' => 2,
         'title' => 'Contact Type',
@@ -76,20 +76,20 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 64,
           'size' => 30,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'table' => 'civicrm_contact_type',
           'keyColumn' => 'name',
           'labelColumn' => 'label',
           'condition' => 'parent_id IS NULL',
-        ),
+        ],
         'api.required' => 1,
-      ),
-      'contact_sub_type' => array(
+      ],
+      'contact_sub_type' => [
         'name' => 'contact_sub_type',
         'type' => 2,
         'title' => 'Contact Subtype',
@@ -103,19 +103,19 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 255,
           'size' => 45,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'table' => 'civicrm_contact_type',
           'keyColumn' => 'name',
           'labelColumn' => 'label',
           'condition' => 'parent_id IS NOT NULL',
-        ),
-      ),
-      'do_not_email' => array(
+        ],
+      ],
+      'do_not_email' => [
         'name' => 'do_not_email',
         'type' => 16,
         'title' => 'Do Not Email',
@@ -127,11 +127,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'do_not_phone' => array(
+        ],
+      ],
+      'do_not_phone' => [
         'name' => 'do_not_phone',
         'type' => 16,
         'title' => 'Do Not Phone',
@@ -143,11 +143,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'do_not_mail' => array(
+        ],
+      ],
+      'do_not_mail' => [
         'name' => 'do_not_mail',
         'type' => 16,
         'title' => 'Do Not Mail',
@@ -159,11 +159,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'do_not_sms' => array(
+        ],
+      ],
+      'do_not_sms' => [
         'name' => 'do_not_sms',
         'type' => 16,
         'title' => 'Do Not Sms',
@@ -175,11 +175,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'do_not_trade' => array(
+        ],
+      ],
+      'do_not_trade' => [
         'name' => 'do_not_trade',
         'type' => 16,
         'title' => 'Do Not Trade',
@@ -191,11 +191,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'is_opt_out' => array(
+        ],
+      ],
+      'is_opt_out' => [
         'name' => 'is_opt_out',
         'type' => 16,
         'title' => 'No Bulk Emails (User Opt Out)',
@@ -207,11 +207,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'legal_identifier' => array(
+        ],
+      ],
+      'legal_identifier' => [
         'name' => 'legal_identifier',
         'type' => 2,
         'title' => 'Legal Identifier',
@@ -227,13 +227,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 32,
           'size' => 20,
-        ),
-      ),
-      'external_identifier' => array(
+        ],
+      ],
+      'external_identifier' => [
         'name' => 'external_identifier',
         'type' => 2,
         'title' => 'External Identifier',
@@ -248,13 +248,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 8,
-        ),
-      ),
-      'sort_name' => array(
+        ],
+      ],
+      'sort_name' => [
         'name' => 'sort_name',
         'type' => 2,
         'title' => 'Sort Name',
@@ -266,13 +266,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'display_name' => array(
+        ],
+      ],
+      'display_name' => [
         'name' => 'display_name',
         'type' => 2,
         'title' => 'Display Name',
@@ -284,13 +284,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'nick_name' => array(
+        ],
+      ],
+      'nick_name' => [
         'name' => 'nick_name',
         'type' => 2,
         'title' => 'Nickname',
@@ -305,13 +305,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'legal_name' => array(
+        ],
+      ],
+      'legal_name' => [
         'name' => 'legal_name',
         'type' => 2,
         'title' => 'Legal Name',
@@ -325,13 +325,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'image_URL' => array(
+        ],
+      ],
+      'image_URL' => [
         'name' => 'image_URL',
         'type' => 32,
         'title' => 'Image Url',
@@ -342,13 +342,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'File',
           'rows' => 2,
           'cols' => 80,
-        ),
-      ),
-      'preferred_communication_method' => array(
+        ],
+      ],
+      'preferred_communication_method' => [
         'name' => 'preferred_communication_method',
         'type' => 2,
         'title' => 'Preferred Communication Method',
@@ -363,17 +363,17 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 255,
           'size' => 45,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'preferred_communication_method',
           'optionEditPath' => 'civicrm/admin/options/preferred_communication_method',
-        ),
-      ),
-      'preferred_language' => array(
+        ],
+      ],
+      'preferred_language' => [
         'name' => 'preferred_language',
         'type' => 2,
         'title' => 'Preferred Language',
@@ -387,18 +387,18 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 5,
           'size' => 6,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'languages',
           'keyColumn' => 'name',
           'optionEditPath' => 'civicrm/admin/options/languages',
-        ),
-      ),
-      'preferred_mail_format' => array(
+        ],
+      ],
+      'preferred_mail_format' => [
         'name' => 'preferred_mail_format',
         'type' => 2,
         'title' => 'Preferred Mail Format',
@@ -413,16 +413,16 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 8,
           'size' => 8,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::pmf',
-        ),
-      ),
-      'hash' => array(
+        ],
+      ],
+      'hash' => [
         'name' => 'hash',
         'type' => 2,
         'title' => 'Contact Hash',
@@ -434,8 +434,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'api_key' => array(
+      ],
+      'api_key' => [
         'name' => 'api_key',
         'type' => 2,
         'title' => 'Api Key',
@@ -445,8 +445,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'first_name' => array(
+      ],
+      'first_name' => [
         'name' => 'first_name',
         'type' => 2,
         'title' => 'First Name',
@@ -461,13 +461,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
-      ),
-      'middle_name' => array(
+        ],
+      ],
+      'middle_name' => [
         'name' => 'middle_name',
         'type' => 2,
         'title' => 'Middle Name',
@@ -482,13 +482,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
-      ),
-      'last_name' => array(
+        ],
+      ],
+      'last_name' => [
         'name' => 'last_name',
         'type' => 2,
         'title' => 'Last Name',
@@ -503,13 +503,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
-      ),
-      'prefix_id' => array(
+        ],
+      ],
+      'prefix_id' => [
         'name' => 'prefix_id',
         'type' => 1,
         'title' => 'Individual Prefix',
@@ -522,21 +522,21 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'individual_prefix',
           'optionEditPath' => 'civicrm/admin/options/individual_prefix',
-        ),
-        'api.aliases' => array(
+        ],
+        'api.aliases' => [
           '0' => 'individual_prefix',
           '1' => 'individual_prefix_id',
-        ),
-      ),
-      'suffix_id' => array(
+        ],
+      ],
+      'suffix_id' => [
         'name' => 'suffix_id',
         'type' => 1,
         'title' => 'Individual Suffix',
@@ -549,21 +549,21 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'individual_suffix',
           'optionEditPath' => 'civicrm/admin/options/individual_suffix',
-        ),
-        'api.aliases' => array(
+        ],
+        'api.aliases' => [
           '0' => 'individual_suffix',
           '1' => 'individual_suffix_id',
-        ),
-      ),
-      'formal_title' => array(
+        ],
+      ],
+      'formal_title' => [
         'name' => 'formal_title',
         'type' => 2,
         'title' => 'Formal Title',
@@ -577,13 +577,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
-      ),
-      'communication_style_id' => array(
+        ],
+      ],
+      'communication_style_id' => [
         'name' => 'communication_style_id',
         'type' => 1,
         'title' => 'Communication Style',
@@ -593,17 +593,17 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'communication_style',
           'optionEditPath' => 'civicrm/admin/options/communication_style',
-        ),
-      ),
-      'email_greeting_id' => array(
+        ],
+      ],
+      'email_greeting_id' => [
         'name' => 'email_greeting_id',
         'type' => 1,
         'title' => 'Email Greeting ID',
@@ -611,8 +611,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'email_greeting_custom' => array(
+      ],
+      'email_greeting_custom' => [
         'name' => 'email_greeting_custom',
         'type' => 2,
         'title' => 'Email Greeting Custom',
@@ -624,13 +624,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 45,
-        ),
-      ),
-      'email_greeting_display' => array(
+        ],
+      ],
+      'email_greeting_display' => [
         'name' => 'email_greeting_display',
         'type' => 2,
         'title' => 'Email Greeting',
@@ -640,13 +640,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
-      ),
-      'postal_greeting_id' => array(
+        ],
+      ],
+      'postal_greeting_id' => [
         'name' => 'postal_greeting_id',
         'type' => 1,
         'title' => 'Postal Greeting ID',
@@ -654,13 +654,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'size' => 6,
           'maxlength' => 14,
-        ),
-      ),
-      'postal_greeting_custom' => array(
+        ],
+      ],
+      'postal_greeting_custom' => [
         'name' => 'postal_greeting_custom',
         'type' => 2,
         'title' => 'Postal Greeting Custom',
@@ -672,13 +672,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 45,
-        ),
-      ),
-      'postal_greeting_display' => array(
+        ],
+      ],
+      'postal_greeting_display' => [
         'name' => 'postal_greeting_display',
         'type' => 2,
         'title' => 'Postal Greeting',
@@ -688,13 +688,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
-      ),
-      'addressee_id' => array(
+        ],
+      ],
+      'addressee_id' => [
         'name' => 'addressee_id',
         'type' => 1,
         'title' => 'Addressee ID',
@@ -702,8 +702,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'addressee_custom' => array(
+      ],
+      'addressee_custom' => [
         'name' => 'addressee_custom',
         'type' => 2,
         'title' => 'Addressee Custom',
@@ -715,13 +715,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 45,
-        ),
-      ),
-      'addressee_display' => array(
+        ],
+      ],
+      'addressee_display' => [
         'name' => 'addressee_display',
         'type' => 2,
         'title' => 'Addressee',
@@ -731,13 +731,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
-      ),
-      'job_title' => array(
+        ],
+      ],
+      'job_title' => [
         'name' => 'job_title',
         'type' => 2,
         'title' => 'Job Title',
@@ -752,13 +752,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 30,
-        ),
-      ),
-      'gender_id' => array(
+        ],
+      ],
+      'gender_id' => [
         'name' => 'gender_id',
         'type' => 1,
         'title' => 'Gender',
@@ -770,20 +770,20 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'gender',
           'optionEditPath' => 'civicrm/admin/options/gender',
-        ),
-        'api.aliases' => array(
+        ],
+        'api.aliases' => [
           '0' => 'gender',
-        ),
-      ),
-      'birth_date' => array(
+        ],
+      ],
+      'birth_date' => [
         'name' => 'birth_date',
         'type' => 4,
         'title' => 'Birth Date',
@@ -796,12 +796,12 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select Date',
           'format' => 'birth',
-        ),
-      ),
-      'is_deceased' => array(
+        ],
+      ],
+      'is_deceased' => [
         'name' => 'is_deceased',
         'type' => 16,
         'title' => 'Deceased',
@@ -812,11 +812,11 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
-      ),
-      'deceased_date' => array(
+        ],
+      ],
+      'deceased_date' => [
         'name' => 'deceased_date',
         'type' => 4,
         'title' => 'Deceased Date',
@@ -828,12 +828,12 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select Date',
           'format' => 'birth',
-        ),
-      ),
-      'household_name' => array(
+        ],
+      ],
+      'household_name' => [
         'name' => 'household_name',
         'type' => 2,
         'title' => 'Household Name',
@@ -848,13 +848,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'primary_contact_id' => array(
+        ],
+      ],
+      'primary_contact_id' => [
         'name' => 'primary_contact_id',
         'type' => 1,
         'title' => 'Household Primary Contact ID',
@@ -863,14 +863,14 @@ function contact_getfields_expectedresult() {
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
+        ],
         'FKApiName' => 'Contact',
-      ),
-      'organization_name' => array(
+      ],
+      'organization_name' => [
         'name' => 'organization_name',
         'type' => 2,
         'title' => 'Organization Name',
@@ -885,13 +885,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'sic_code' => array(
+        ],
+      ],
+      'sic_code' => [
         'name' => 'sic_code',
         'type' => 2,
         'title' => 'Sic Code',
@@ -905,13 +905,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 8,
           'size' => 8,
-        ),
-      ),
-      'user_unique_id' => array(
+        ],
+      ],
+      'user_unique_id' => [
         'name' => 'user_unique_id',
         'type' => 2,
         'title' => 'Unique ID (OpenID)',
@@ -927,13 +927,13 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 45,
-        ),
-      ),
-      'created_date' => array(
+        ],
+      ],
+      'created_date' => [
         'name' => 'created_date',
         'type' => 256,
         'title' => 'Created Date',
@@ -945,8 +945,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'modified_date' => array(
+      ],
+      'modified_date' => [
         'name' => 'modified_date',
         'type' => 256,
         'title' => 'Modified Date',
@@ -958,8 +958,8 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-      ),
-      'source' => array(
+      ],
+      'source' => [
         'name' => 'source',
         'type' => 2,
         'title' => 'Contact Source',
@@ -973,14 +973,14 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 255,
           'size' => 30,
-        ),
+        ],
         'uniqueName' => 'contact_source',
-      ),
-      'employer_id' => array(
+      ],
+      'employer_id' => [
         'name' => 'employer_id',
         'type' => 1,
         'title' => 'Current Employer',
@@ -991,15 +991,15 @@ function contact_getfields_expectedresult() {
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'EntityRef',
           'size' => 6,
           'maxlength' => 14,
-        ),
+        ],
         'uniqueName' => 'current_employer_id',
         'FKApiName' => 'Contact',
-      ),
-      'is_deleted' => array(
+      ],
+      'is_deleted' => [
         'name' => 'is_deleted',
         'type' => 16,
         'title' => 'Contact is in Trash',
@@ -1009,12 +1009,12 @@ function contact_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'Contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'CheckBox',
-        ),
+        ],
         'uniqueName' => 'contact_is_deleted',
-      ),
-      'custom_1' => array(
+      ],
+      'custom_1' => [
         'label' => 'Our special field',
         'groupTitle' => 'select_test_g',
         'data_type' => 'String',
@@ -1035,32 +1035,32 @@ function contact_getfields_expectedresult() {
         'is_required' => '1',
         'table_name' => 'civicrm_value_select_test_g_1',
         'column_name' => 'our_special_field_1',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'our_special_field_20170207021937',
           'optionEditPath' => 'civicrm/admin/options/our_special_field_20170207021937',
-        ),
+        ],
         'name' => 'custom_1',
         'title' => 'Our special field',
         'type' => 2,
-        'options' => array(
+        'options' => [
           '1' => 'Label1',
           '2' => 'Label2',
-        ),
-      ),
-      'current_employer' => array(
+        ],
+      ],
+      'current_employer' => [
         'title' => 'Current Employer',
         'description' => 'Name of Current Employer',
         'type' => 2,
         'name' => 'current_employer',
-      ),
-      'dupe_check' => array(
+      ],
+      'dupe_check' => [
         'title' => 'Check for Duplicates',
         'description' => 'Throw error if contact create matches dedupe rule',
         'type' => 16,
         'name' => 'dupe_check',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 454f7a78aab8a84480809231796b9f3c88adc65d..352a2296ea123ec56017f063e7c33232447106ca 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function contact_getoptions_example() {
-  $params = array(
+  $params = [
     'field' => 'custom_1',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'getoptions', $params);
@@ -20,12 +20,12 @@ function contact_getoptions_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,15 +39,15 @@ function contact_getoptions_example() {
  */
 function contact_getoptions_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
+    'values' => [
       '1' => 'Label1',
       '2' => 'Label2',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 3bc4f8750f653479d43a99cce5380269e22a8a6b..de75c962f48b863050f0bff0042406238cdcebc4 100644 (file)
@@ -10,9 +10,9 @@
  *   API result array
  */
 function contact_getsingle_example() {
-  $params = array(
+  $params = [
     'id' => 17,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'getsingle', $params);
@@ -22,12 +22,12 @@ function contact_getsingle_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,7 +41,7 @@ function contact_getsingle_example() {
  */
 function contact_getsingle_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'contact_id' => '17',
     'contact_type' => 'Individual',
     'contact_sub_type' => '',
@@ -110,7 +110,7 @@ function contact_getsingle_expectedresult() {
     'state_province' => '',
     'country' => '',
     'id' => '17',
-  );
+  ];
 
   return $expectedResult;
 }
index e341ce7035197ebf474afb85a75bcf861e7ae08a..43d22f067b87025f629d657ca77e147d012c3935 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
-    'group' => array(
-      'IN' => array(
+  $params = [
+    'group' => [
+      'IN' => [
         '0' => 'Test group C',
         '1' => 'Test group D',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -25,12 +25,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -119,9 +119,9 @@ function contact_get_expectedresult() {
         'state_province' => '',
         'country' => '',
         'id' => '3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f4ebd0047164799a9dcd170633cc50ad4bc9f0e1..753e3ffa7845713687da60bf00fd75a47bbad908 100644 (file)
@@ -8,38 +8,38 @@
  *   API result array
  */
 function contact_get_example() {
-  $params = array(
+  $params = [
     'id' => 10,
-    'api.email.replace' => array(
-      'values' => array(
-        '0' => array(
+    'api.email.replace' => [
+      'values' => [
+        '0' => [
           'location_type_id' => 20,
           'email' => '1-1@example.com',
           'is_primary' => 1,
-        ),
-        '1' => array(
+        ],
+        '1' => [
           'location_type_id' => 20,
           'email' => '1-2@example.com',
           'is_primary' => 0,
-        ),
-        '2' => array(
+        ],
+        '2' => [
           'location_type_id' => 20,
           'email' => '1-3@example.com',
           'is_primary' => 0,
-        ),
-        '3' => array(
+        ],
+        '3' => [
           'location_type_id' => 21,
           'email' => '2-1@example.com',
           'is_primary' => 0,
-        ),
-        '4' => array(
+        ],
+        '4' => [
           'location_type_id' => 21,
           'email' => '2-2@example.com',
           'is_primary' => 0,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contact', 'get', $params);
@@ -49,12 +49,12 @@ function contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -68,13 +68,13 @@ function contact_get_example() {
  */
 function contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 10,
-    'values' => array(
-      '10' => array(
+    'values' => [
+      '10' => [
         'contact_id' => '10',
         'contact_type' => 'Organization',
         'contact_sub_type' => '',
@@ -142,12 +142,12 @@ function contact_get_expectedresult() {
         'state_province' => '',
         'country' => '',
         'id' => '10',
-        'api.email.replace' => array(
+        'api.email.replace' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 5,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '18',
               'contact_id' => '10',
               'location_type_id' => '20',
@@ -160,8 +160,8 @@ function contact_get_expectedresult() {
               'reset_date' => '',
               'signature_text' => '',
               'signature_html' => '',
-            ),
-            '1' => array(
+            ],
+            '1' => [
               'id' => '19',
               'contact_id' => '10',
               'location_type_id' => '20',
@@ -174,8 +174,8 @@ function contact_get_expectedresult() {
               'reset_date' => '',
               'signature_text' => '',
               'signature_html' => '',
-            ),
-            '2' => array(
+            ],
+            '2' => [
               'id' => '20',
               'contact_id' => '10',
               'location_type_id' => '20',
@@ -188,8 +188,8 @@ function contact_get_expectedresult() {
               'reset_date' => '',
               'signature_text' => '',
               'signature_html' => '',
-            ),
-            '3' => array(
+            ],
+            '3' => [
               'id' => '21',
               'contact_id' => '10',
               'location_type_id' => '21',
@@ -202,8 +202,8 @@ function contact_get_expectedresult() {
               'reset_date' => '',
               'signature_text' => '',
               'signature_html' => '',
-            ),
-            '4' => array(
+            ],
+            '4' => [
               'id' => '22',
               'contact_id' => '10',
               'location_type_id' => '21',
@@ -216,12 +216,12 @@ function contact_get_expectedresult() {
               'reset_date' => '',
               'signature_text' => '',
               'signature_html' => '',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0ed270153050d214d61279657712a169de9eeacd..fc33466272557215f2b1ae7046b2fe1e9af4924f 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 28,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -19,7 +19,7 @@ function contribution_create_example() {
     'source' => 'SSF',
     'contribution_status_id' => 1,
     'honor_contact_id' => 29,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -29,12 +29,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -48,13 +48,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '28',
         'financial_type_id' => '1',
@@ -85,9 +85,9 @@ function contribution_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 394b0c36ada2a4d1a1700b253afc594e5da44103..d9e863ea23c8470f38984ad5eb61b60668b359f3 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 22,
     'receive_date' => '2012-01-01',
     'total_amount' => '100',
@@ -22,7 +22,7 @@ function contribution_create_example() {
     'source' => 'SSF',
     'contribution_status_id' => 1,
     'note' => 'my contribution note',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -32,12 +32,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -51,13 +51,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '22',
         'financial_type_id' => '1',
@@ -88,9 +88,9 @@ function contribution_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a798c940b10f96510fbd7cf23ae5b1229f3b717e..e8f3cf62b44f8637bda0bd3a9c5b343840fc1929 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 24,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -18,14 +18,14 @@ function contribution_create_example() {
     'net_amount' => '95',
     'source' => 'SSF',
     'contribution_status_id' => 1,
-    'soft_credit' => array(
-      '1' => array(
+    'soft_credit' => [
+      '1' => [
         'contact_id' => 25,
         'amount' => 50,
         'soft_credit_type_id' => 3,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -35,12 +35,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -54,13 +54,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '24',
         'financial_type_id' => '1',
@@ -91,9 +91,9 @@ function contribution_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 5209aa9aea94479b470d6f89333a9ba6d7eaaa22..9698b850e538043e7169a69d62250c22f34a9cf9 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 26,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -19,7 +19,7 @@ function contribution_create_example() {
     'source' => 'SSF',
     'contribution_status_id' => 1,
     'soft_credit_to' => 27,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -29,12 +29,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -48,13 +48,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '26',
         'financial_type_id' => '1',
@@ -85,9 +85,9 @@ function contribution_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a1ffbf661bfc0ef6b1d98afdc6217310479ad6e3..df458f5908dfa0a972ebafd300fdfb8982b88dca 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -17,7 +17,7 @@ function contribution_create_example() {
     'invoice_id' => 67890,
     'source' => 'SSF',
     'contribution_status_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -27,12 +27,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '1',
         'financial_type_id' => '1',
@@ -84,9 +84,9 @@ function contribution_create_expectedresult() {
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
         'invoice_number' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 741e1763979750fe7d6a16188a4c9a372346f20d..dd23dd07a66378ca52f7cf75aea80c32a30e0452 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function contribution_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 11,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -22,21 +22,21 @@ function contribution_create_example() {
     'source' => 'SSF',
     'contribution_status_id' => 1,
     'skipLineItem' => 1,
-    'api.line_item.create' => array(
-      '0' => array(
+    'api.line_item.create' => [
+      '0' => [
         'price_field_id' => 1,
         'qty' => 2,
         'line_total' => '20',
         'unit_price' => '10',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'price_field_id' => 1,
         'qty' => 1,
         'line_total' => '80',
         'unit_price' => '80',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'create', $params);
@@ -46,12 +46,12 @@ function contribution_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -65,13 +65,13 @@ function contribution_create_example() {
  */
 function contribution_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '11',
         'financial_type_id' => '1',
@@ -102,14 +102,14 @@ function contribution_create_expectedresult() {
         'tax_amount' => 0,
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-        'api.line_item.create' => array(
-          '0' => array(
+        'api.line_item.create' => [
+          '0' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 1,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '1',
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
@@ -124,16 +124,16 @@ function contribution_create_expectedresult() {
                 'financial_type_id' => '',
                 'non_deductible_amount' => '',
                 'tax_amount' => '',
-              ),
-            ),
-          ),
-          '1' => array(
+              ],
+            ],
+          ],
+          '1' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 2,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '2',
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
@@ -148,13 +148,13 @@ function contribution_create_expectedresult() {
                 'financial_type_id' => '',
                 'non_deductible_amount' => '',
                 'tax_amount' => '',
-              ),
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+              ],
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c22b1b102d2219623ce027337592c4b5ae5fc69f..bb445f01b52e5c7e058acfaa8ea62631461a9cda 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'delete', $params);
@@ -18,12 +18,12 @@ function contribution_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,15 +37,15 @@ function contribution_delete_example() {
  */
 function contribution_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
+    'values' => [
       '1' => 1,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 0c5c06f58f2f04481605f20ec4e5a02f10530337..ee07a1ab53ce2854f849ba249cb7ce394bc43331 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_get_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Contribution', 'get', $params);
@@ -18,12 +18,12 @@ function contribution_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function contribution_get_example() {
  */
 function contribution_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -93,9 +93,9 @@ function contribution_get_expectedresult() {
         'check_number' => '',
         'id' => '1',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 8139aa301a4e42e16d11f01503aca666b5bed2eb..2b18e3ffca083d479fef9202b42af92f94e48d71 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function contribution_page_create_example() {
-  $params = array(
+  $params = [
     'title' => 'Test Contribution Page',
     'financial_type_id' => 1,
     'currency' => 'NZD',
@@ -16,7 +16,7 @@ function contribution_page_create_example() {
     'is_email_receipt' => TRUE,
     'receipt_from_email' => 'yourconscience@donate.com',
     'receipt_from_name' => 'Ego Freud',
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionPage', 'create', $params);
@@ -26,12 +26,12 @@ function contribution_page_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,13 +45,13 @@ function contribution_page_create_example() {
  */
 function contribution_page_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'title' => 'Test Contribution Page',
         'intro_text' => '',
@@ -97,9 +97,9 @@ function contribution_page_create_expectedresult() {
         'campaign_id' => '',
         'is_share' => '',
         'is_billing_required' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b0ffc33052430e6206b92717f63ebe84f75b6ae2..87221bb754e9eed0657cf9d7fd3de654ac454ddb 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_page_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionPage', 'delete', $params);
@@ -18,12 +18,12 @@ function contribution_page_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function contribution_page_delete_example() {
  */
 function contribution_page_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 0a6b234e907ec8f5066f488f1e2754c78f2525f0..f5b2b365ba7dd49c143bc5aeccd08985fcdb56a8 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function contribution_page_get_example() {
-  $params = array(
+  $params = [
     'currency' => 'NZD',
     'financial_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionPage', 'get', $params);
@@ -19,12 +19,12 @@ function contribution_page_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function contribution_page_get_example() {
  */
 function contribution_page_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'title' => 'Test Contribution Page',
         'financial_type_id' => '1',
@@ -68,9 +68,9 @@ function contribution_page_get_expectedresult() {
         'is_share' => '1',
         'is_billing_required' => 0,
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a1d8932776c8f8de2de3607d3ea67eaf56c30fef..e58d1ef989c32e90f9abd2fe32ced1379c2c51a8 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function contribution_page_submit_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-    'pledge_amount' => array(
+    'pledge_amount' => [
       '2' => 1,
-    ),
+    ],
     'billing_first_name' => 'Billy',
     'billing_middle_name' => 'Goat',
     'billing_last_name' => 'Gruff',
@@ -20,10 +20,10 @@ function contribution_page_submit_example() {
     'payment_processor_id' => 1,
     'credit_card_number' => '4111111111111111',
     'credit_card_type' => 'Visa',
-    'credit_card_exp_date' => array(
+    'credit_card_exp_date' => [
       'M' => 9,
       'Y' => 2040,
-    ),
+    ],
     'cvv2' => 123,
     'pledge_id' => '1',
     'cid' => '83',
@@ -31,7 +31,7 @@ function contribution_page_submit_example() {
     'amount' => '100',
     'is_pledge' => TRUE,
     'pledge_block_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionPage', 'submit', $params);
@@ -41,12 +41,12 @@ function contribution_page_submit_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -60,12 +60,12 @@ function contribution_page_submit_example() {
  */
 function contribution_page_submit_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
     'values' => '',
-  );
+  ];
 
   return $expectedResult;
 }
index fdfac34b8d6d5f96e4fadd77195444241fc966a5..dc953c9d4f8b2d2a7829d536220da2d8e7a73835 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function contribution_recur_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'installments' => '12',
     'frequency_interval' => '1',
@@ -15,7 +15,7 @@ function contribution_recur_create_example() {
     'start_date' => '2012-01-01 00:00:00',
     'currency' => 'USD',
     'frequency_unit' => 'day',
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionRecur', 'create', $params);
@@ -25,12 +25,12 @@ function contribution_recur_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function contribution_recur_create_example() {
  */
 function contribution_recur_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'amount' => '500',
@@ -79,9 +79,9 @@ function contribution_recur_create_expectedresult() {
         'payment_instrument_id' => '',
         'campaign_id' => '',
         'is_email_receipt' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index fba4f0585044d1bb82c40d67f66c061b1c22574d..d27fe4de885043ef4ec1273f4cf22f0a6a290bfd 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_recur_delete_example() {
-  $params = array(
+  $params = [
     'id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionRecur', 'delete', $params);
@@ -18,12 +18,12 @@ function contribution_recur_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function contribution_recur_delete_example() {
  */
 function contribution_recur_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 44defa9acebc329c25359bbe3fc5bd3081c787b3..de3ae0566648710712b92a2c2982c0f6e8c39411 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_recur_get_example() {
-  $params = array(
+  $params = [
     'amount' => '500',
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionRecur', 'get', $params);
@@ -18,12 +18,12 @@ function contribution_recur_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function contribution_recur_get_example() {
  */
 function contribution_recur_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '4',
         'amount' => '500.00',
@@ -60,9 +60,9 @@ function contribution_recur_get_expectedresult() {
         'failure_count' => 0,
         'auto_renew' => 0,
         'is_email_receipt' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 8450990dfc2409e9301cd7079452d8f08f44465b..523683a58f1573ae894e82ea18ab9ac676bf7000 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function contribution_soft_create_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 6,
     'contact_id' => 19,
     'amount' => '10',
     'currency' => 'USD',
     'soft_credit_type_id' => 5,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionSoft', 'create', $params);
@@ -22,12 +22,12 @@ function contribution_soft_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function contribution_soft_create_example() {
  */
 function contribution_soft_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 5,
-    'values' => array(
-      '5' => array(
+    'values' => [
+      '5' => [
         'id' => '5',
         'contribution_id' => '6',
         'contact_id' => '19',
@@ -58,9 +58,9 @@ function contribution_soft_create_expectedresult() {
         'pcp_roll_nickname' => '',
         'pcp_personal_note' => '',
         'soft_credit_type_id' => '5',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0a6ccc5508f8a698ca5da3cf291237ed76720813..5c663ddaa464fa29e8664e8c50732e4b548229c8 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_soft_delete_example() {
-  $params = array(
+  $params = [
     'id' => 7,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionSoft', 'delete', $params);
@@ -18,12 +18,12 @@ function contribution_soft_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 91f49635faf3e6fd11ceeeedb31cb1547ae38343..00f58d7e95a0b871180c9c3383d448ec262e8cb4 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function contribution_soft_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ContributionSoft', 'get', $params);
@@ -18,12 +18,12 @@ function contribution_soft_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function contribution_soft_get_example() {
  */
 function contribution_soft_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contribution_id' => '1',
         'contact_id' => '4',
@@ -51,9 +51,9 @@ function contribution_soft_get_expectedresult() {
         'currency' => 'USD',
         'pcp_display_in_roll' => 0,
         'soft_credit_type_id' => '4',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 988b9bcfc9158c3b8a5ec4f29d5e9242623043d8..1d76d52b87890086ba814a8164990d0ad2968486 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function country_create_example() {
-  $params = array(
+  $params = [
     'name' => 'Made Up Land',
     'iso_code' => 'ZZ',
     'region_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Country', 'create', $params);
@@ -20,12 +20,12 @@ function country_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function country_create_example() {
  */
 function country_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1254,
-    'values' => array(
-      '1254' => array(
+    'values' => [
+      '1254' => [
         'id' => '1254',
         'name' => 'Made Up Land',
         'iso_code' => 'ZZ',
@@ -55,9 +55,9 @@ function country_create_expectedresult() {
         'ndd_prefix' => '',
         'region_id' => '1',
         'is_province_abbreviated' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 79fcb15348a4d63e1086bffc6bc9c23d83435b37..07676caec1daf0a6e9c5acc63747e600d0fb2d43 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function country_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1255,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Country', 'delete', $params);
@@ -18,12 +18,12 @@ function country_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function country_delete_example() {
  */
 function country_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index dcd4d4431e8c707f23eb0d97179c09a087196c2b..7ff129241439a6f1639338546a183a0083acae0f 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function country_get_example() {
-  $params = array(
+  $params = [
     'iso_code' => 'ZZ',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Country', 'get', $params);
@@ -18,12 +18,12 @@ function country_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,21 +37,21 @@ function country_get_example() {
  */
 function country_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1256,
-    'values' => array(
-      '1256' => array(
+    'values' => [
+      '1256' => [
         'id' => '1256',
         'name' => 'Made Up Land',
         'iso_code' => 'ZZ',
         'region_id' => '1',
         'is_province_abbreviated' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 5316d37f6174fc275fa55bf718d61b89908fb945..a29f9842cb6b3be6972e020011c8edfa8bbb5c3d 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function custom_field_create_example() {
-  $params = array(
+  $params = [
     'custom_group_id' => 1,
     'name' => 'test_textfield2',
     'label' => 'Name1',
@@ -17,7 +17,7 @@ function custom_field_create_example() {
     'is_required' => 1,
     'is_searchable' => 0,
     'is_active' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomField', 'create', $params);
@@ -27,12 +27,12 @@ function custom_field_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function custom_field_create_example() {
  */
 function custom_field_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'custom_group_id' => '1',
         'name' => 'test_textfield2',
@@ -83,9 +83,9 @@ function custom_field_create_expectedresult() {
         'option_group_id' => '',
         'filter' => '',
         'in_selector' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ed130904d7dd57a609e165af3f2bc8dd508ab1a5..90c6985ef086ae82dacf5f2771272c49ca93a28c 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function custom_field_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomField', 'delete', $params);
@@ -18,12 +18,12 @@ function custom_field_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function custom_field_delete_example() {
  */
 function custom_field_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 5a29551feb58b5305612854c46328191138fe97f..950622f0ea7f036100f122cca7f943124ef4a169 100644 (file)
@@ -6,19 +6,19 @@
  *   API result array
  */
 function custom_group_create_example() {
-  $params = array(
+  $params = [
     'title' => 'Test_Group_1',
     'name' => 'test_group_1',
-    'extends' => array(
+    'extends' => [
       '0' => 'Individual',
-    ),
+    ],
     'weight' => 4,
     'collapse_display' => 1,
     'style' => 'Inline',
     'help_pre' => 'This is Pre Help For Test Group 1',
     'help_post' => 'This is Post Help For Test Group 1',
     'is_active' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomGroup', 'create', $params);
@@ -28,12 +28,12 @@ function custom_group_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -47,13 +47,13 @@ function custom_group_create_example() {
  */
 function custom_group_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'test_group_1',
         'title' => 'Test_Group_1',
@@ -74,9 +74,9 @@ function custom_group_create_expectedresult() {
         'created_id' => '',
         'created_date' => '',
         'is_reserved' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index db517f083f96f755aeb3080129b7b9eec9c81b55..d05b071399029e62846eb2219df4e75b5c010268 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function custom_group_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomGroup', 'delete', $params);
@@ -18,12 +18,12 @@ function custom_group_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function custom_group_delete_example() {
  */
 function custom_group_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 3a8a90a800263c565fd2263108d7b537276c28c9..1ed12b4930961fd902036353b31c6af25fd67dcd 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function custom_group_get_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('CustomGroup', 'get', $params);
@@ -16,12 +16,12 @@ function custom_group_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -35,13 +35,13 @@ function custom_group_get_example() {
  */
 function custom_group_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'test_group_1',
         'title' => 'Test_Group_1',
@@ -56,9 +56,9 @@ function custom_group_get_expectedresult() {
         'is_multiple' => 0,
         'collapse_adv_display' => 0,
         'is_reserved' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f53d3a0f18c4b7da4f51741a1d6fe4b3ff77fd14..966133dacd09a947e331dd8eac34b194d0d76ade 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function custom_value_create_example() {
-  $params = array(
+  $params = [
     'custom_1' => 'customString',
     'entity_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomValue', 'create', $params);
@@ -19,11 +19,11 @@ function custom_value_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function custom_value_create_example() {
  */
 function custom_value_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => TRUE,
-  );
+  ];
 
   return $expectedResult;
 }
index 8aab39ddf9ca032eb8bbd76f6368f6ff9cf2e90d..b901dade8a03b9d16b63b7f798ffbad9413b2d0b 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function custom_value_get_example() {
-  $params = array(
+  $params = [
     'id' => 2,
     'entity_id' => 2,
     'format.field_names' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomValue', 'get', $params);
@@ -22,11 +22,11 @@ function custom_value_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,60 +40,60 @@ function custom_value_get_example() {
  */
 function custom_value_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 7,
-    'values' => array(
-      'mySingleField' => array(
+    'values' => [
+      'mySingleField' => [
         'entity_id' => '2',
         'latest' => 'value 1',
         'id' => 'mySingleField',
-      ),
-      'field_12' => array(
+      ],
+      'field_12' => [
         'entity_id' => '2',
         'latest' => 'value 3',
         'id' => 'field_12',
         '1' => 'value 2',
         '2' => 'value 3',
-      ),
-      'field_22' => array(
+      ],
+      'field_22' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => 'field_22',
         '1' => 'warm beer',
         '2' => '',
-      ),
-      'field_32' => array(
+      ],
+      'field_32' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => 'field_32',
         '1' => 'fl* w*',
         '2' => '',
-      ),
-      'field_13' => array(
+      ],
+      'field_13' => [
         'entity_id' => '2',
         'latest' => 'coffee',
         'id' => 'field_13',
         '1' => 'defaultValue',
         '2' => 'coffee',
-      ),
-      'field_23' => array(
+      ],
+      'field_23' => [
         'entity_id' => '2',
         'latest' => 'value 4',
         'id' => 'field_23',
         '1' => '',
         '2' => 'value 4',
-      ),
-      'field_33' => array(
+      ],
+      'field_33' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => 'field_33',
         '1' => 'vegemite',
         '2' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 578f5a3e51471b1b1597de1d6011ba1a0f8977d9..126b6e350f2e0958bc69e58b9befa2e9d126ccec 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function custom_value_get_example() {
-  $params = array(
+  $params = [
     'id' => 2,
     'entity_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('CustomValue', 'get', $params);
@@ -21,11 +21,11 @@ function custom_value_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,60 +39,60 @@ function custom_value_get_example() {
  */
 function custom_value_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 7,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'entity_id' => '2',
         'latest' => 'value 1',
         'id' => '1',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'entity_id' => '2',
         'latest' => 'value 3',
         'id' => '2',
         '1' => 'value 2',
         '2' => 'value 3',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => '3',
         '1' => 'warm beer',
         '2' => '',
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => '4',
         '1' => 'fl* w*',
         '2' => '',
-      ),
-      '5' => array(
+      ],
+      '5' => [
         'entity_id' => '2',
         'latest' => 'coffee',
         'id' => '5',
         '1' => 'defaultValue',
         '2' => 'coffee',
-      ),
-      '6' => array(
+      ],
+      '6' => [
         'entity_id' => '2',
         'latest' => 'value 4',
         'id' => '6',
         '1' => '',
         '2' => 'value 4',
-      ),
-      '7' => array(
+      ],
+      '7' => [
         'entity_id' => '2',
         'latest' => '',
         'id' => '7',
         '1' => 'vegemite',
         '2' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 71fc08495cabf4570c1eb3b0e66ca18a34e14a84..328446478ed37a4d8df31035636fc74824e48a66 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function domain_create_example() {
-  $params = array(
+  $params = [
     'name' => 'A-team domain',
     'description' => 'domain of chaos',
     'domain_version' => '4.2',
     'contact_id' => 6,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Domain', 'create', $params);
@@ -21,12 +21,12 @@ function domain_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function domain_create_example() {
  */
 function domain_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'name' => 'A-team domain',
         'description' => 'domain of chaos',
@@ -55,9 +55,9 @@ function domain_create_expectedresult() {
         'locales' => '',
         'locale_custom_strings' => '',
         'domain_version' => '4.2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 2867d850ca5d54f638b66dc9159553fced3a3783..8ea402bbaaea87b042c9a4070f8371b43058698a 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function domain_get_example() {
-  $params = array(
+  $params = [
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Domain', 'get', $params);
@@ -18,12 +18,12 @@ function domain_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,23 +37,23 @@ function domain_get_example() {
  */
 function domain_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'name' => 'Default Domain Name',
         'version' => '4.6.alpha1',
         'contact_id' => '3',
         'locale_custom_strings' => 'a:1:{s:5:\"en_US\";a:0:{}}',
         'domain_email' => 'my@email.com',
-        'domain_phone' => array(
+        'domain_phone' => [
           'phone_type' => 'Phone',
           'phone' => '456-456',
-        ),
-        'domain_address' => array(
+        ],
+        'domain_address' => [
           'street_address' => '45 Penny Lane',
           'supplemental_address_1' => '',
           'supplemental_address_2' => '',
@@ -64,22 +64,22 @@ function domain_get_expectedresult() {
           'country_id' => '',
           'geo_code_1' => '',
           'geo_code_2' => '',
-        ),
+        ],
         'from_email' => 'info@EXAMPLE.ORG',
         'from_name' => 'FIXME',
         'domain_version' => '4.6.alpha1',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'id' => '2',
         'name' => 'Second Domain',
         'version' => '4.6.alpha1',
         'contact_id' => '2',
         'domain_email' => '\"Domain Email\" <domainemail2@example.org>',
-        'domain_phone' => array(
+        'domain_phone' => [
           'phone_type' => 'Phone',
           'phone' => '204 555-1001',
-        ),
-        'domain_address' => array(
+        ],
+        'domain_address' => [
           'street_address' => '15 Main St',
           'supplemental_address_1' => '',
           'supplemental_address_2' => '',
@@ -90,13 +90,13 @@ function domain_get_expectedresult() {
           'country_id' => '1228',
           'geo_code_1' => '41.8328',
           'geo_code_2' => '-72.9253',
-        ),
+        ],
         'from_email' => 'info@EXAMPLE.ORG',
         'from_name' => 'FIXME',
         'domain_version' => '4.6.alpha1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index aa7b3f24e729c469dda9b5f6f1e9e7ebe42acb92..98abb059d18e97a24fd41e19c995fb8b82993c56 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function email_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'location_type_id' => 6,
     'email' => 'api@a-team.com',
     'is_primary' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Email', 'create', $params);
@@ -21,12 +21,12 @@ function email_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function email_create_example() {
  */
 function email_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_id' => '3',
         'location_type_id' => '6',
@@ -59,9 +59,9 @@ function email_create_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index fa65dd94ae25cc01b4fff50b0c7fbf1590553c84..4f10a208cbc013d4ad5153493a2807299359cf0f 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function email_delete_example() {
-  $params = array(
+  $params = [
     'id' => 11,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Email', 'delete', $params);
@@ -18,12 +18,12 @@ function email_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function email_delete_example() {
  */
 function email_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 650709d46f00d768c12f04f8c8d363f514d594c2..f85feea54790dcec6572dc0427f5e816dd7a2995 100644 (file)
@@ -6,36 +6,36 @@
  *   API result array
  */
 function email_replace_example() {
-  $params = array(
+  $params = [
     'contact_id' => 9,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'location_type_id' => 18,
         'email' => '1-1@example.com',
         'is_primary' => 1,
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'location_type_id' => 18,
         'email' => '1-2@example.com',
         'is_primary' => 0,
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'location_type_id' => 18,
         'email' => '1-3@example.com',
         'is_primary' => 0,
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'location_type_id' => 19,
         'email' => '2-1@example.com',
         'is_primary' => 0,
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'location_type_id' => 19,
         'email' => '2-2@example.com',
         'is_primary' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Email', 'replace', $params);
@@ -45,12 +45,12 @@ function email_replace_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -64,12 +64,12 @@ function email_replace_example() {
  */
 function email_replace_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
-    'values' => array(
-      '12' => array(
+    'values' => [
+      '12' => [
         'id' => '12',
         'contact_id' => '9',
         'location_type_id' => '18',
@@ -82,8 +82,8 @@ function email_replace_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-      '13' => array(
+      ],
+      '13' => [
         'id' => '13',
         'contact_id' => '9',
         'location_type_id' => '18',
@@ -96,8 +96,8 @@ function email_replace_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-      '14' => array(
+      ],
+      '14' => [
         'id' => '14',
         'contact_id' => '9',
         'location_type_id' => '18',
@@ -110,8 +110,8 @@ function email_replace_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-      '15' => array(
+      ],
+      '15' => [
         'id' => '15',
         'contact_id' => '9',
         'location_type_id' => '19',
@@ -124,8 +124,8 @@ function email_replace_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-      '16' => array(
+      ],
+      '16' => [
         'id' => '16',
         'contact_id' => '9',
         'location_type_id' => '19',
@@ -138,9 +138,9 @@ function email_replace_expectedresult() {
         'reset_date' => '',
         'signature_text' => '',
         'signature_html' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 85486c61e0e846ced7ae47c0ef8e4d0ab2dfe390..71bf9bbf30f69c467db69d43cd0aadf3141dcf2a 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function entity_batch_create_example() {
-  $params = array(
+  $params = [
     'entity_id' => 1,
     'batch_id' => 1,
     'entity_table' => 'civicrm_financial_trxn',
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityBatch', 'create', $params);
@@ -20,12 +20,12 @@ function entity_batch_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function entity_batch_create_example() {
  */
 function entity_batch_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'entity_table' => 'civicrm_financial_trxn',
         'entity_id' => '1',
         'batch_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ed94376e3f4d73dfbf303117eb25b715041e220c..af39a1564b093cebc560df4dc39bf791ee841df3 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function entity_batch_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityBatch', 'delete', $params);
@@ -18,12 +18,12 @@ function entity_batch_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function entity_batch_delete_example() {
  */
 function entity_batch_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index d1aa10a3e169e7d089b02d1fd57a64658d67106f..fbe65d197ab8555a4c7e826a41f0d4f10f0e4061 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function entity_batch_get_example() {
-  $params = array(
+  $params = [
     'entity_id' => 2,
     'batch_id' => 2,
     'entity_table' => 'civicrm_financial_trxn',
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityBatch', 'get', $params);
@@ -20,12 +20,12 @@ function entity_batch_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function entity_batch_get_example() {
  */
 function entity_batch_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'entity_table' => 'civicrm_financial_trxn',
         'entity_id' => '2',
         'batch_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index e114b9fbe60189c7ed945c705060ffd28955387c..d819a96e80dbd7dd29327bc274415116202e4f38 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function entity_tag_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'tag_id' => '6',
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityTag', 'create', $params);
@@ -19,11 +19,11 @@ function entity_tag_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function entity_tag_create_example() {
  */
 function entity_tag_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'not_added' => 0,
     'added' => 1,
     'total_count' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 83d812b1bfc975af24f6354fde4f14e169704984..f79f4925efc3d30ede4047d9b1518da4f13c02ee 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function entity_tag_delete_example() {
-  $params = array(
+  $params = [
     'contact_id_h' => 31,
     'tag_id' => '15',
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityTag', 'delete', $params);
@@ -19,12 +19,12 @@ function entity_tag_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,12 +38,12 @@ function entity_tag_delete_example() {
  */
 function entity_tag_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'not_removed' => 0,
     'removed' => 1,
     'total_count' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index d3b1392145351614c7051d5409c80683dcf74496..94bb042ccc18db6cde711b430f7e681bec26ca45 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function entity_tag_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 15,
-  );
+  ];
 
   try{
     $result = civicrm_api3('EntityTag', 'get', $params);
@@ -18,12 +18,12 @@ function entity_tag_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,20 +37,20 @@ function entity_tag_get_example() {
  */
 function entity_tag_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 5,
-    'values' => array(
-      '5' => array(
+    'values' => [
+      '5' => [
         'id' => '5',
         'entity_table' => 'civicrm_contact',
         'entity_id' => '15',
         'tag_id' => '10',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 77adb0b8f7917a05ded27a79921a9965a6e0cf77..776dcc35a7f2102f6576de0b2e2e2de05b6d49dd 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function event_get_example() {
-  $params = array(
+  $params = [
     'return.custom_2' => 1,
     'custom_2' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'get', $params);
@@ -21,12 +21,12 @@ function event_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function event_get_example() {
  */
 function event_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'title' => 'My test event.',
         'event_title' => 'My test event.',
@@ -79,9 +79,9 @@ function event_get_expectedresult() {
         'custom_1' => 'defaultValue',
         'custom_2_id' => '4',
         'custom_2' => 'Contact, Test',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d5f0bb942af270f541376385fe0b4e6bb0ad0b71..b94693c427f9ae3ed111c67e11975b37a8d6c852 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function event_create_example() {
-  $params = array(
+  $params = [
     'title' => 'Annual CiviCRM meet',
     'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
     'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
@@ -22,7 +22,7 @@ function event_create_example() {
     'is_monetary' => 0,
     'is_active' => 1,
     'is_show_location' => 0,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'create', $params);
@@ -32,12 +32,12 @@ function event_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -51,13 +51,13 @@ function event_create_example() {
  */
 function event_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'title' => 'Annual CiviCRM meet',
         'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
@@ -127,9 +127,9 @@ function event_create_expectedresult() {
         'slot_label_id' => '',
         'dedupe_rule_group_id' => '',
         'is_billing_required' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9f12de13c0d6cbabd87364166d0e62d234f26307..9e50397ccae3fec98481bc432d8ae2046f866e1d 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function event_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'delete', $params);
@@ -18,12 +18,12 @@ function event_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function event_delete_example() {
  */
 function event_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 68637fc4c97a6afab1319b4bb0eeb9adce2fcea1..a616f289f2fc0954b7e2fdd28423391b312a6a5d 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function event_get_example() {
-  $params = array(
+  $params = [
     'event_title' => 'Annual CiviCRM meet',
     'sequential' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'get', $params);
@@ -19,12 +19,12 @@ function event_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function event_get_example() {
  */
 function event_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'title' => 'Annual CiviCRM meet',
         'event_title' => 'Annual CiviCRM meet',
@@ -74,9 +74,9 @@ function event_get_expectedresult() {
         'is_share' => '1',
         'is_confirm_enabled' => '1',
         'is_billing_required' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9d60d43064f5cd9b3587397f0da1a9d532296b6e..1c3cc7f06b85283cd7df948046932433e951c574 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function event_get_example() {
-  $params = array(
+  $params = [
     'isCurrent' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'get', $params);
@@ -20,12 +20,12 @@ function event_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function event_get_example() {
  */
 function event_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'title' => 'Annual CiviCRM meet 2',
         'event_title' => 'Annual CiviCRM meet 2',
@@ -82,9 +82,9 @@ function event_get_expectedresult() {
         'is_share' => '1',
         'is_confirm_enabled' => '1',
         'is_billing_required' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 556e307c48656940be379eaa24d2daeadc451534..4afe21ddc2d5bc91a0b9f97745e68a3bc79203f6 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function event_getsingle_example() {
-  $params = array(
+  $params = [
     'id' => 1,
     'return.is_full' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Event', 'getsingle', $params);
@@ -21,12 +21,12 @@ function event_getsingle_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,7 +40,7 @@ function event_getsingle_example() {
  */
 function event_getsingle_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'id' => '1',
     'title' => 'Annual CiviCRM meet',
     'event_title' => 'Annual CiviCRM meet',
@@ -73,7 +73,7 @@ function event_getsingle_expectedresult() {
     'is_billing_required' => 0,
     'available_places' => 0,
     'is_full' => '1',
-  );
+  ];
 
   return $expectedResult;
 }
index f968d9a2a4018a51c1998ef154a839a2d29a5b51..ceb0dd71ce78a3ea715c5378e7e7cb7038f8468e 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function grant_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'application_received_date' => 'now',
     'decision_date' => 'next Monday',
@@ -15,7 +15,7 @@ function grant_create_example() {
     'rationale' => 'Just Because',
     'currency' => 'USD',
     'grant_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Grant', 'create', $params);
@@ -25,12 +25,12 @@ function grant_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function grant_create_example() {
  */
 function grant_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'application_received_date' => '20130728084957',
@@ -66,9 +66,9 @@ function grant_create_expectedresult() {
         'rationale' => 'Just Because',
         'status_id' => '1',
         'financial_type_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index de116031e3d27719e0312262152dda0257fdb2b3..4c0222a01eae9603bf30fbeb56590bcd7fc65e29 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function grant_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Grant', 'delete', $params);
@@ -18,12 +18,12 @@ function grant_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function grant_delete_example() {
  */
 function grant_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 78920988712cee08e22a443486be3dcad4b509bb..a85ffc2317a9067b51c3385e12fde2a746bf5d11 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function grant_get_example() {
-  $params = array(
+  $params = [
     'rationale' => 'Just Because',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Grant', 'get', $params);
@@ -18,12 +18,12 @@ function grant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function grant_get_example() {
  */
 function grant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '5',
         'application_received_date' => '20130728084957',
@@ -53,9 +53,9 @@ function grant_get_expectedresult() {
         'currency' => 'USD',
         'rationale' => 'Just Because',
         'status_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ca31ca89fc0363df06608eab281b634258ac1221..9c6f7c0e1454783530acce2c71f6ed3e6344aaa5 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function group_get_example() {
-  $params = array(
+  $params = [
     'name' => 'Test Group 1',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Group', 'get', $params);
@@ -18,12 +18,12 @@ function group_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function group_get_example() {
  */
 function group_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'name' => 'Test Group 1',
         'title' => 'New Test Group Created',
@@ -53,15 +53,15 @@ function group_get_expectedresult() {
         'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 )   ) ',
         'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}',
         'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}',
-        'group_type' => array(
+        'group_type' => [
           '0' => '1',
           '1' => '2',
-        ),
+        ],
         'is_hidden' => 0,
         'is_reserved' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0247cb3e9e92f0ad8ba75f5f380fe7070c2f30ec..a93b6f8754acba82cd7c7b330b0593423be203b8 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function group_getfields_example() {
-  $params = array(
+  $params = [
     'action' => 'create',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Group', 'getfields', $params);
@@ -20,12 +20,12 @@ function group_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,12 +39,12 @@ function group_getfields_example() {
  */
 function group_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 20,
-    'values' => array(
-      'id' => array(
+    'values' => [
+      'id' => [
         'name' => 'id',
         'type' => 1,
         'title' => 'Group ID',
@@ -53,11 +53,11 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'group_id',
-        ),
-      ),
-      'name' => array(
+        ],
+      ],
+      'name' => [
         'name' => 'name',
         'type' => 2,
         'title' => 'Group Name',
@@ -67,8 +67,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'title' => array(
+      ],
+      'title' => [
         'name' => 'title',
         'type' => 2,
         'title' => 'Group Title',
@@ -79,8 +79,8 @@ function group_getfields_expectedresult() {
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
         'api.required' => 1,
-      ),
-      'description' => array(
+      ],
+      'description' => [
         'name' => 'description',
         'type' => 32,
         'title' => 'Group Description',
@@ -90,13 +90,13 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-        'html' => array(
+        'html' => [
           'type' => 'TextArea',
           'rows' => 2,
           'cols' => 60,
-        ),
-      ),
-      'source' => array(
+        ],
+      ],
+      'source' => [
         'name' => 'source',
         'type' => 2,
         'title' => 'Group Source',
@@ -106,8 +106,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'saved_search_id' => array(
+      ],
+      'saved_search_id' => [
         'name' => 'saved_search_id',
         'type' => 1,
         'title' => 'Saved Search ID',
@@ -117,8 +117,8 @@ function group_getfields_expectedresult() {
         'bao' => 'CRM_Contact_BAO_Group',
         'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
         'FKApiName' => 'SavedSearch',
-      ),
-      'is_active' => array(
+      ],
+      'is_active' => [
         'name' => 'is_active',
         'type' => 16,
         'title' => 'Group Enabled',
@@ -127,8 +127,8 @@ function group_getfields_expectedresult() {
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
         'api.default' => 1,
-      ),
-      'visibility' => array(
+      ],
+      'visibility' => [
         'name' => 'visibility',
         'type' => 2,
         'title' => 'Group Visibility Setting',
@@ -139,16 +139,16 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 24,
           'size' => 20,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::groupVisibility',
-        ),
-      ),
-      'where_clause' => array(
+        ],
+      ],
+      'where_clause' => [
         'name' => 'where_clause',
         'type' => 32,
         'title' => 'Group Where Clause',
@@ -156,8 +156,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'select_tables' => array(
+      ],
+      'select_tables' => [
         'name' => 'select_tables',
         'type' => 32,
         'title' => 'Tables For Select Clause',
@@ -165,8 +165,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'where_tables' => array(
+      ],
+      'where_tables' => [
         'name' => 'where_tables',
         'type' => 32,
         'title' => 'Tables For Where Clause',
@@ -174,8 +174,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'group_type' => array(
+      ],
+      'group_type' => [
         'name' => 'group_type',
         'type' => 2,
         'title' => 'Group Type',
@@ -185,12 +185,12 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'group_type',
           'optionEditPath' => 'civicrm/admin/options/group_type',
-        ),
-      ),
-      'cache_date' => array(
+        ],
+      ],
+      'cache_date' => [
         'name' => 'cache_date',
         'type' => 256,
         'title' => 'Group Cache Date',
@@ -199,8 +199,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'refresh_date' => array(
+      ],
+      'refresh_date' => [
         'name' => 'refresh_date',
         'type' => 256,
         'title' => 'Next Group Refresh Time',
@@ -209,8 +209,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'parents' => array(
+      ],
+      'parents' => [
         'name' => 'parents',
         'type' => 32,
         'title' => 'Group Parents',
@@ -218,8 +218,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'children' => array(
+      ],
+      'children' => [
         'name' => 'children',
         'type' => 32,
         'title' => 'Group Children',
@@ -227,8 +227,8 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'is_hidden' => array(
+      ],
+      'is_hidden' => [
         'name' => 'is_hidden',
         'type' => 16,
         'title' => 'Group is Hidden',
@@ -236,16 +236,16 @@ function group_getfields_expectedresult() {
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'is_reserved' => array(
+      ],
+      'is_reserved' => [
         'name' => 'is_reserved',
         'type' => 16,
         'title' => 'Group is Reserved',
         'table_name' => 'civicrm_group',
         'entity' => 'Group',
         'bao' => 'CRM_Contact_BAO_Group',
-      ),
-      'created_id' => array(
+      ],
+      'created_id' => [
         'name' => 'created_id',
         'type' => 1,
         'title' => 'Group Created By',
@@ -255,8 +255,8 @@ function group_getfields_expectedresult() {
         'bao' => 'CRM_Contact_BAO_Group',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-      'modified_id' => array(
+      ],
+      'modified_id' => [
         'name' => 'modified_id',
         'type' => 1,
         'title' => 'Group Modified By',
@@ -266,9 +266,9 @@ function group_getfields_expectedresult() {
         'bao' => 'CRM_Contact_BAO_Group',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 515848316a08d06c7661f22d2a63144fae919c8c..4f8eff192c100142f13ce7fe6cda17b1463e3f93 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function group_contact_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 8,
     'contact_id.2' => 9,
     'group_id' => 11,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupContact', 'create', $params);
@@ -20,12 +20,12 @@ function group_contact_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,7 +39,7 @@ function group_contact_create_example() {
  */
 function group_contact_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
@@ -47,7 +47,7 @@ function group_contact_create_expectedresult() {
     'total_count' => 2,
     'added' => 1,
     'not_added' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index f0118e15e9d185eadf7c82d675938fa1c70643f1..b87de53d2a95774e5f47cc613766f11f7690b203 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function group_contact_delete_example() {
-  $params = array(
+  $params = [
     'id' => 9,
     'skip_undelete' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupContact', 'delete', $params);
@@ -19,12 +19,12 @@ function group_contact_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,7 +38,7 @@ function group_contact_delete_example() {
  */
 function group_contact_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
@@ -46,7 +46,7 @@ function group_contact_delete_expectedresult() {
     'total_count' => 1,
     'removed' => 0,
     'not_removed' => 0,
-  );
+  ];
 
   return $expectedResult;
 }
index 47511c3dead24bb0b5b38bb65c886ed8df7097da..a8dda828c6ff7a4ed2dcaa1bcc29703da69a41b8 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function group_contact_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupContact', 'get', $params);
@@ -18,12 +18,12 @@ function group_contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function group_contact_get_example() {
  */
 function group_contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'group_id' => '1',
         'title' => 'New Test Group Created',
@@ -51,9 +51,9 @@ function group_contact_get_expectedresult() {
         'is_hidden' => 0,
         'in_date' => '2013-07-28 08:50:19',
         'in_method' => 'API',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3fa9f14035ed5458ba9cb0b4af079c463578b7c8..e60f16df58722a20a2fb4144f5add341ac97ce84 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function group_contact_get_example() {
-  $params = array(
+  $params = [
     'group_id' => 3,
     'api.group.get' => 1,
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupContact', 'get', $params);
@@ -22,12 +22,12 @@ function group_contact_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,24 +41,24 @@ function group_contact_get_example() {
  */
 function group_contact_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '2',
         'group_id' => '3',
         'contact_id' => '4',
         'status' => 'Added',
-        'api.group.get' => array(
+        'api.group.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 3,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '3',
               'name' => 'Test Group 1',
               'title' => 'New Test Group Created',
@@ -68,18 +68,18 @@ function group_contact_get_expectedresult() {
               'where_clause' => ' ( `civicrm_group_contact-3`.group_id IN ( 3 )   ) ',
               'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}',
               'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}',
-              'group_type' => array(
+              'group_type' => [
                 '0' => '1',
                 '1' => '2',
-              ),
+              ],
               'is_hidden' => 0,
               'is_reserved' => 0,
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 149dd02864e45186f98c7d19d3ada3c8beda32b8..f45099640947c7ac1a28b87439fd6e4368ebf4e0 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function group_nesting_create_example() {
-  $params = array(
+  $params = [
     'parent_group_id' => 1,
     'child_group_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupNesting', 'create', $params);
@@ -19,12 +19,12 @@ function group_nesting_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,15 +38,15 @@ function group_nesting_create_example() {
  */
 function group_nesting_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 'is_error',
-    'values' => array(
+    'values' => [
       'is_error' => 0,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 7a8ab837aea4ecd2c93b560d42f4a43adc85354f..baaea1baaa2f10d5d12d8a9e8fa838b4d850f7e5 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function group_nesting_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupNesting', 'delete', $params);
@@ -18,12 +18,12 @@ function group_nesting_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function group_nesting_delete_example() {
  */
 function group_nesting_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 3683dad770294e5970f9926e459e5f6da533e363..3e19ef53b1040fa333c2a005f8863fdf5abc6903 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function group_nesting_get_example() {
-  $params = array(
+  $params = [
     'parent_group_id' => 1,
     'child_group_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupNesting', 'get', $params);
@@ -19,12 +19,12 @@ function group_nesting_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,19 +38,19 @@ function group_nesting_get_example() {
  */
 function group_nesting_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'child_group_id' => '2',
         'parent_group_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 4ebee078ed3f39cbe444fc158ccaae0231034ee7..1a669375783bfff63e8bdf444533cb94fa8429be 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function group_organization_create_example() {
-  $params = array(
+  $params = [
     'organization_id' => 8,
     'group_id' => 6,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupOrganization', 'create', $params);
@@ -19,12 +19,12 @@ function group_organization_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,17 +38,17 @@ function group_organization_create_example() {
  */
 function group_organization_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
     'id' => 3,
-    'values' => array(
+    'values' => [
       'id' => '3',
       'group_id' => '6',
       'organization_id' => '8',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index ad41dc6cad6f4eb77fc0bef55380398a3657ef38..79f776f3b07d5aecc12fbd890bb64eb1f92fd90b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function group_organization_delete_example() {
-  $params = array(
+  $params = [
     'id' => 5,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupOrganization', 'delete', $params);
@@ -18,12 +18,12 @@ function group_organization_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function group_organization_delete_example() {
  */
 function group_organization_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 'Deleted Group Organization successfully',
-  );
+  ];
 
   return $expectedResult;
 }
index 696179d9a7382cc8c5199b8bbd750fb72defea05..1ebfc68c3fefeeb23dfea5ec837dc5a13609d0bf 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function group_organization_get_example() {
-  $params = array(
+  $params = [
     'organization_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('GroupOrganization', 'get', $params);
@@ -18,12 +18,12 @@ function group_organization_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function group_organization_get_example() {
  */
 function group_organization_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
-    'values' => array(),
-  );
+    'values' => [],
+  ];
 
   return $expectedResult;
 }
index 440e89a0af4c1327169bd2f63d909674ea4f2d73..c32a2ea5f8ee0af3a47277da8ef23e4e1493ea90 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function im_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'name' => 'My Yahoo IM Handle',
     'location_type_id' => 1,
     'provider_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Im', 'create', $params);
@@ -21,12 +21,12 @@ function im_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function im_create_example() {
  */
 function im_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'location_type_id' => '1',
@@ -54,9 +54,9 @@ function im_create_expectedresult() {
         'provider_id' => '1',
         'is_primary' => '',
         'is_billing' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c1d2e2b091f1fdcf4249f6cd8dd7aa07864b4766..81438d73021258cef35833dd5c028e33dc78671d 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function im_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Im', 'delete', $params);
@@ -18,12 +18,12 @@ function im_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function im_delete_example() {
  */
 function im_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index b1daaeaee2d29c26205f2aa51a7f5f7c78fbf6af..90d23fe359068924199bf996d0ac36c833713b37 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function im_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 4,
     'name' => 'My Yahoo IM Handle',
     'location_type_id' => 1,
     'provider_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Im', 'get', $params);
@@ -21,12 +21,12 @@ function im_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function im_get_example() {
  */
 function im_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '4',
         'location_type_id' => '1',
@@ -54,9 +54,9 @@ function im_get_expectedresult() {
         'provider_id' => '1',
         'is_primary' => 0,
         'is_billing' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1060d3ccf79f6a0fc7963cb1831ecacb52434be6..3e64c91d75df1949c9cf29905948105e491bc442 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function job_create_example() {
-  $params = array(
+  $params = [
     'sequential' => 1,
     'name' => 'API_Test_Job',
     'description' => 'A long description written by hand in cursive',
@@ -15,7 +15,7 @@ function job_create_example() {
     'api_action' => 'apitestaction',
     'parameters' => 'Semi-formal explanation of runtime job parameters',
     'is_active' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Job', 'create', $params);
@@ -25,12 +25,12 @@ function job_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function job_create_example() {
  */
 function job_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 30,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '30',
         'domain_id' => '1',
         'run_frequency' => 'Daily',
@@ -62,9 +62,9 @@ function job_create_expectedresult() {
         'api_action' => 'apitestaction',
         'parameters' => 'Semi-formal explanation of runtime job parameters',
         'is_active' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 40264b4c11e1e4753a067f3b73ce4aff39cc181f..3fb114359874c5ad84b83e4ddfc7dde3de4f50f4 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function job_delete_example() {
-  $params = array(
+  $params = [
     'id' => 31,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Job', 'delete', $params);
@@ -18,12 +18,12 @@ function job_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 761cd1c2642e4a2646c047ff7aa7462415f1f236..44d22760961cf0b539be2acf2ecd590a20c13e4d 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function line_item_create_example() {
-  $params = array(
+  $params = [
     'price_field_value_id' => 1,
     'price_field_id' => 1,
     'entity_table' => 'civicrm_contribution',
@@ -15,7 +15,7 @@ function line_item_create_example() {
     'unit_price' => 50,
     'line_total' => 50,
     'debug' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('LineItem', 'create', $params);
@@ -25,12 +25,12 @@ function line_item_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function line_item_create_example() {
  */
 function line_item_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'entity_table' => 'civicrm_contribution',
         'entity_id' => '1',
@@ -65,9 +65,9 @@ function line_item_create_expectedresult() {
         'financial_type_id' => '',
         'non_deductible_amount' => '',
         'tax_amount' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 98c0496723a8949d2c9025a96427862621a8857a..2381abb56257426bbdfe9646148f8e8f024fe5a5 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function line_item_delete_example() {
-  $params = array(
+  $params = [
     'id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('LineItem', 'delete', $params);
@@ -18,12 +18,12 @@ function line_item_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function line_item_delete_example() {
  */
 function line_item_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index f1f8756091d8775b020855bb8817b5fbb3bc47fb..68a319605bf014682050e4135d607e2a98868ee4 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function line_item_get_example() {
-  $params = array(
+  $params = [
     'entity_table' => 'civicrm_contribution',
-  );
+  ];
 
   try{
     $result = civicrm_api3('LineItem', 'get', $params);
@@ -18,12 +18,12 @@ function line_item_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function line_item_get_example() {
  */
 function line_item_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'entity_table' => 'civicrm_contribution',
         'entity_id' => '2',
@@ -57,9 +57,9 @@ function line_item_get_expectedresult() {
         'financial_type_id' => '1',
         'non_deductible_amount' => '0.00',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 328cec565fddc0371313feabc9fcd63b1a63218d..723137931ccc0884f97b848eebf6700a1b534b35 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function loc_block_create_example() {
-  $params = array(
+  $params = [
     'address_id' => 2,
     'phone_id' => 2,
     'email_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('LocBlock', 'create', $params);
@@ -22,12 +22,12 @@ function loc_block_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function loc_block_create_example() {
  */
 function loc_block_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'address_id' => '2',
         'email_id' => '3',
@@ -57,9 +57,9 @@ function loc_block_create_expectedresult() {
         'email_2_id' => '',
         'phone_2_id' => '',
         'im_2_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 4af4802789748ee28a6302eb8add3b9cf3da9177..2cb6213339880c16542d7c08fad3ab8ef6271bb5 100644 (file)
@@ -8,24 +8,24 @@
  *   API result array
  */
 function loc_block_create_example() {
-  $params = array(
-    'email' => array(
+  $params = [
+    'email' => [
       'location_type_id' => 1,
       'email' => 'test2@loc.block',
-    ),
-    'phone' => array(
+    ],
+    'phone' => [
       'location_type_id' => 1,
       'phone' => '987654321',
-    ),
-    'phone_2' => array(
+    ],
+    'phone_2' => [
       'location_type_id' => 1,
       'phone' => '456-7890',
-    ),
-    'address' => array(
+    ],
+    'address' => [
       'location_type_id' => 1,
       'street_address' => '987654321',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('LocBlock', 'create', $params);
@@ -35,12 +35,12 @@ function loc_block_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -54,22 +54,22 @@ function loc_block_create_example() {
  */
 function loc_block_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
-        'address' => array(
+    'values' => [
+      '3' => [
+        'address' => [
           'id' => '3',
           'location_type_id' => '1',
           'is_primary' => 0,
           'is_billing' => 0,
           'street_address' => '987654321',
           'manual_geo_code' => 0,
-        ),
-        'email' => array(
+        ],
+        'email' => [
           'id' => '4',
           'contact_id' => '',
           'location_type_id' => '1',
@@ -82,8 +82,8 @@ function loc_block_create_expectedresult() {
           'reset_date' => '',
           'signature_text' => '',
           'signature_html' => '',
-        ),
-        'phone' => array(
+        ],
+        'phone' => [
           'id' => '3',
           'contact_id' => '',
           'location_type_id' => '1',
@@ -94,8 +94,8 @@ function loc_block_create_expectedresult() {
           'phone_ext' => '',
           'phone_numeric' => '',
           'phone_type_id' => '',
-        ),
-        'phone_2' => array(
+        ],
+        'phone_2' => [
           'id' => '4',
           'contact_id' => '',
           'location_type_id' => '1',
@@ -106,7 +106,7 @@ function loc_block_create_expectedresult() {
           'phone_ext' => '',
           'phone_numeric' => '',
           'phone_type_id' => '',
-        ),
+        ],
         'id' => '3',
         'address_id' => '3',
         'email_id' => '4',
@@ -116,9 +116,9 @@ function loc_block_create_expectedresult() {
         'email_2_id' => '',
         'phone_2_id' => '4',
         'im_2_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c323e43fb7ec3291b10e38fb38050c7f3bdbd382..dccde31f7b9ec353c50f5e24e93fc636ed6a2bed 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function loc_block_get_example() {
-  $params = array(
+  $params = [
     'id' => 3,
     'return' => 'all',
-  );
+  ];
 
   try{
     $result = civicrm_api3('LocBlock', 'get', $params);
@@ -21,12 +21,12 @@ function loc_block_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,27 +40,27 @@ function loc_block_get_example() {
  */
 function loc_block_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'address_id' => '3',
         'email_id' => '4',
         'phone_id' => '3',
         'phone_2_id' => '4',
-        'address' => array(
+        'address' => [
           'id' => '3',
           'location_type_id' => '1',
           'is_primary' => 0,
           'is_billing' => 0,
           'street_address' => '987654321',
           'manual_geo_code' => 0,
-        ),
-        'email' => array(
+        ],
+        'email' => [
           'id' => '4',
           'location_type_id' => '1',
           'email' => 'test2@loc.block',
@@ -68,26 +68,26 @@ function loc_block_get_expectedresult() {
           'is_billing' => 0,
           'on_hold' => 0,
           'is_bulkmail' => 0,
-        ),
-        'phone' => array(
+        ],
+        'phone' => [
           'id' => '3',
           'location_type_id' => '1',
           'is_primary' => 0,
           'is_billing' => 0,
           'phone' => '987654321',
           'phone_numeric' => '987654321',
-        ),
-        'phone_2' => array(
+        ],
+        'phone_2' => [
           'id' => '4',
           'location_type_id' => '1',
           'is_primary' => 0,
           'is_billing' => 0,
           'phone' => '456-7890',
           'phone_numeric' => '4567890',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0e95cdaf508e1322e1fe312ac810423f96f84c9a..f6d921898b62f04f6bae2c8096c7a6472dcfa1ce 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function logging_get_example() {
-  $params = array(
+  $params = [
     'log_conn_id' => 'wooty wop wop',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Logging', 'get', $params);
@@ -18,12 +18,12 @@ function logging_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function logging_get_example() {
  */
 function logging_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 17,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'action' => 'Update',
         'id' => '3',
         'field' => 'sort_name',
@@ -51,8 +51,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_contact',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'action' => 'Update',
         'id' => '3',
         'field' => 'display_name',
@@ -61,8 +61,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_contact',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'action' => 'Update',
         'id' => '3',
         'field' => 'first_name',
@@ -71,8 +71,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_contact',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'action' => 'Update',
         'id' => '3',
         'field' => 'last_name',
@@ -81,8 +81,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_contact',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'action' => 'Update',
         'id' => '3',
         'field' => 'modified_date',
@@ -91,8 +91,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_contact',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '5' => array(
+      ],
+      '5' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'id',
@@ -101,8 +101,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '6' => array(
+      ],
+      '6' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'contact_id',
@@ -111,8 +111,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '7' => array(
+      ],
+      '7' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'location_type_id',
@@ -121,8 +121,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '8' => array(
+      ],
+      '8' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'email',
@@ -131,8 +131,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '9' => array(
+      ],
+      '9' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'is_primary',
@@ -141,8 +141,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '10' => array(
+      ],
+      '10' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'is_billing',
@@ -151,8 +151,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '11' => array(
+      ],
+      '11' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'on_hold',
@@ -161,8 +161,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '12' => array(
+      ],
+      '12' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'is_bulkmail',
@@ -171,8 +171,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '13' => array(
+      ],
+      '13' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'hold_date',
@@ -181,8 +181,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '14' => array(
+      ],
+      '14' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'reset_date',
@@ -191,8 +191,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '15' => array(
+      ],
+      '15' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'signature_text',
@@ -201,8 +201,8 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-      '16' => array(
+      ],
+      '16' => [
         'action' => 'Insert',
         'id' => '2',
         'field' => 'signature_html',
@@ -211,9 +211,9 @@ function logging_get_expectedresult() {
         'table' => 'civicrm_email',
         'log_date' => '2017-02-07 02:36:46',
         'log_conn_id' => 'wooty wop wop',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c085b4497c1d80e89821be1a7bb0b99affd91bb8..01642fc870b2c99069035c402953e7a46886c937 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function logging_revert_example() {
-  $params = array(
+  $params = [
     'log_conn_id' => 'woot',
     'log_date' => '2017-02-07 02:35:06',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Logging', 'revert', $params);
@@ -19,12 +19,12 @@ function logging_revert_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,12 +38,12 @@ function logging_revert_example() {
  */
 function logging_revert_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 39840638f095e6cb1edda24285a06d8f1b551423..966d269684030e98608589ea4d4a1fa999e0db5f 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function mail_settings_get_example() {
-  $params = array(
+  $params = [
     'title' => 'MailSettings title',
     'api.MailSettings.delete' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailSettings', 'get', $params);
@@ -21,12 +21,12 @@ function mail_settings_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,25 +40,25 @@ function mail_settings_get_example() {
  */
 function mail_settings_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'domain_id' => '1',
         'name' => 'default',
         'is_default' => 0,
         'domain' => 'EXAMPLE.ORG',
-        'api.MailSettings.delete' => array(
+        'api.MailSettings.delete' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'values' => 1,
-        ),
-      ),
-      '6' => array(
+        ],
+      ],
+      '6' => [
         'id' => '6',
         'domain_id' => '1',
         'name' => 'my mail setting',
@@ -68,15 +68,15 @@ function mail_settings_get_expectedresult() {
         'username' => 'sue',
         'password' => 'pass',
         'is_ssl' => 0,
-        'api.MailSettings.delete' => array(
+        'api.MailSettings.delete' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'values' => 1,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1542f116dd2bc130a020c653f3b651592089b7d1..43fbf4385668766fad205dbffeea32cc7d794ac4 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function mail_settings_create_example() {
-  $params = array(
+  $params = [
     'domain_id' => 1,
     'name' => 'my mail setting',
     'domain' => 'setting.com',
@@ -15,7 +15,7 @@ function mail_settings_create_example() {
     'username' => 'sue',
     'password' => 'pass',
     'is_default' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailSettings', 'create', $params);
@@ -25,12 +25,12 @@ function mail_settings_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function mail_settings_create_example() {
  */
 function mail_settings_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 5,
-    'values' => array(
-      '5' => array(
+    'values' => [
+      '5' => [
         'id' => '5',
         'domain_id' => '1',
         'name' => 'my mail setting',
@@ -65,9 +65,9 @@ function mail_settings_create_expectedresult() {
         'password' => 'pass',
         'is_ssl' => '',
         'source' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ffd138fc2d31f5f77a4fcc0b235f570f0a9d641f..a1cc7a50b457ef25d1e67d281a2c88b23138a971 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mail_settings_delete_example() {
-  $params = array(
+  $params = [
     'id' => 5,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailSettings', 'delete', $params);
@@ -18,12 +18,12 @@ function mail_settings_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function mail_settings_delete_example() {
  */
 function mail_settings_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 53c8b81cb6b09baa73ef4a49cceae55455ea1813..19c75bb4be14df071aef2d13fc9064ce7ed7a004 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function mail_settings_get_example() {
-  $params = array(
+  $params = [
     'domain_id' => 1,
     'name' => 'my mail setting',
     'domain' => 'setting.com',
@@ -15,7 +15,7 @@ function mail_settings_get_example() {
     'username' => 'sue',
     'password' => 'pass',
     'is_default' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailSettings', 'get', $params);
@@ -25,12 +25,12 @@ function mail_settings_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function mail_settings_get_example() {
  */
 function mail_settings_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'domain_id' => '1',
         'name' => 'my mail setting',
@@ -60,9 +60,9 @@ function mail_settings_get_expectedresult() {
         'username' => 'sue',
         'password' => 'pass',
         'is_ssl' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ae99328f23206478310579c0df8211b4c852e815..5a8de53942555a569a312661836eb32315a181a7 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mail_settings_getoptions_example() {
-  $params = array(
+  $params = [
     'field' => 'protocol',
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailSettings', 'getoptions', $params);
@@ -18,12 +18,12 @@ function mail_settings_getoptions_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,17 +37,17 @@ function mail_settings_getoptions_example() {
  */
 function mail_settings_getoptions_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 4,
-    'values' => array(
+    'values' => [
       '1' => 'IMAP',
       '2' => 'Maildir',
       '3' => 'POP3',
       '4' => 'Localdir',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index c91b47714f79fc63ac233225e415fd27d14048c4..7d5c86c2c57f511bd7fbc95e8913fec8bf39937e 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mailing_clone_example() {
-  $params = array(
+  $params = [
     'id' => 21,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mailing', 'clone', $params);
@@ -18,12 +18,12 @@ function mailing_clone_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function mailing_clone_example() {
  */
 function mailing_clone_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 22,
-    'values' => array(
-      '22' => array(
+    'values' => [
+      '22' => [
         'id' => '22',
         'domain_id' => '1',
         'header_id' => '1',
@@ -88,9 +88,9 @@ https://civicrm.org
         'location_type_id' => '',
         'email_selection_method' => 'automatic',
         'language' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b07b4fdb56b9c6378e3b56344ab3ea6c3b9f3005..026d9fc2c1136ef86f91f68bccf867c401f8a1f0 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function mailing_create_example() {
-  $params = array(
+  $params = [
     'subject' => 'Hello {contact.display_name}',
     'body_text' => 'This is {contact.display_name}.
 https://civicrm.org
@@ -16,32 +16,32 @@ https://civicrm.org
     'created_id' => 3,
     'header_id' => '',
     'footer_id' => '',
-    'groups' => array(
-      'include' => array(
+    'groups' => [
+      'include' => [
         '0' => 2,
-      ),
-      'exclude' => array(
+      ],
+      'exclude' => [
         '0' => 3,
-      ),
-    ),
-    'mailings' => array(
-      'include' => array(),
-      'exclude' => array(),
-    ),
-    'options' => array(
+      ],
+    ],
+    'mailings' => [
+      'include' => [],
+      'exclude' => [],
+    ],
+    'options' => [
       'force_rollback' => 1,
-    ),
+    ],
     'api.mailing_job.create' => 1,
-    'api.MailingRecipients.get' => array(
+    'api.MailingRecipients.get' => [
       'mailing_id' => '$value.id',
-      'api.contact.getvalue' => array(
+      'api.contact.getvalue' => [
         'return' => 'display_name',
-      ),
-      'api.email.getvalue' => array(
+      ],
+      'api.email.getvalue' => [
         'return' => 'email',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Mailing', 'create', $params);
@@ -51,12 +51,12 @@ https://civicrm.org
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -70,13 +70,13 @@ https://civicrm.org
  */
 function mailing_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'domain_id' => '1',
         'header_id' => '',
@@ -121,13 +121,13 @@ https://civicrm.org
         'location_type_id' => '',
         'email_selection_method' => '',
         'language' => '',
-        'api.mailing_job.create' => array(
+        'api.mailing_job.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'mailing_id' => '1',
               'scheduled_date' => '20130728085413',
@@ -139,28 +139,28 @@ https://civicrm.org
               'parent_id' => '',
               'job_offset' => '',
               'job_limit' => '',
-            ),
-          ),
-        ),
-        'api.MailingRecipients.get' => array(
+            ],
+          ],
+        ],
+        'api.MailingRecipients.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'mailing_id' => '1',
               'contact_id' => '4',
               'email_id' => '4',
               'api.contact.getvalue' => 'Mr. Includer Person II',
               'api.email.getvalue' => 'include.me@example.org',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b7f02cbc766fe86f46df736d2e35094a55d3100c..b2df37d02a208f9537bd6a542feabae0f1e44072 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mailing_delete_example() {
-  $params = array(
+  $params = [
     'id' => 20,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mailing', 'delete', $params);
@@ -18,12 +18,12 @@ function mailing_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function mailing_delete_example() {
  */
 function mailing_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 61923485965e8a268663ef3d9be9428ba23f028a..856e27952707b582bc06289722a1e8d4115cabc4 100644 (file)
@@ -9,12 +9,12 @@
  *   API result array
  */
 function mailing_gettokens_example() {
-  $params = array(
-    'entity' => array(
+  $params = [
+    'entity' => [
       '0' => 'Contact',
       '1' => 'Mailing',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Mailing', 'gettokens', $params);
@@ -24,12 +24,12 @@ function mailing_gettokens_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,11 +43,11 @@ function mailing_gettokens_example() {
  */
 function mailing_gettokens_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 82,
-    'values' => array(
+    'values' => [
       '{action.unsubscribe}' => 'Unsubscribe via email',
       '{action.unsubscribeUrl}' => 'Unsubscribe via web page',
       '{action.resubscribe}' => 'Resubscribe via email',
@@ -131,8 +131,8 @@ function mailing_gettokens_expectedresult() {
       '{contact.url}' => 'Website',
       '{contact.checksum}' => 'Checksum',
       '{contact.contact_id}' => 'Internal Contact ID',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index ffaae8983dd93e0a0ea4cf2672a862a206b9fdd7..d2971de198c3fbb7b87c5aedc267fbfc7a9194a5 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function mailing_submit_example() {
-  $params = array(
+  $params = [
     'scheduled_date' => '2014-12-13 10:00:00',
     'approval_date' => '2014-12-13 00:00:00',
     'id' => 18,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mailing', 'submit', $params);
@@ -20,12 +20,12 @@ function mailing_submit_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function mailing_submit_example() {
  */
 function mailing_submit_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 18,
-    'values' => array(
-      '18' => array(
+    'values' => [
+      '18' => [
         'id' => '18',
         'domain_id' => '1',
         'header_id' => '',
@@ -90,9 +90,9 @@ https://civicrm.org
         'location_type_id' => '',
         'email_selection_method' => 'automatic',
         'language' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c7ac42c59d77475b87d84c9a2ca9ce0a92536df1..735ad9ca37efb6ceae2eb840e0f75d4813f4658b 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function mailing_a_b_create_example() {
-  $params = array(
+  $params = [
     'mailing_id_a' => 1,
     'mailing_id_b' => 2,
     'mailing_id_c' => 3,
@@ -14,7 +14,7 @@ function mailing_a_b_create_example() {
     'winner_criteria' => 'open',
     'declare_winning_time' => '+2 days',
     'group_percentage' => 10,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailingAB', 'create', $params);
@@ -24,12 +24,12 @@ function mailing_a_b_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function mailing_a_b_create_example() {
  */
 function mailing_a_b_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => '',
         'status' => '',
@@ -64,9 +64,9 @@ function mailing_a_b_create_expectedresult() {
         'group_percentage' => '10',
         'created_id' => '3',
         'created_date' => '2013-07-28 08:49:19',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0af6130cd2696c3c8cb7f00334417131b0993150..a36db91cb57234e722ac178df8c4dc47b2723446 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function mailing_event_subscribe_create_example() {
-  $params = array(
+  $params = [
     'email' => 'test@test.test',
     'group_id' => 2,
     'contact_id' => 3,
     'hash' => 'b15de8b64e2cec34',
     'time_stamp' => '20101212121212',
-  );
+  ];
 
   try{
     $result = civicrm_api3('MailingEventSubscribe', 'create', $params);
@@ -22,12 +22,12 @@ function mailing_event_subscribe_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,19 +41,19 @@ function mailing_event_subscribe_create_example() {
  */
 function mailing_event_subscribe_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '3',
         'subscribe_id' => '1',
         'hash' => '67eac7789eaee00',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 4903a339ccb90015916093f28e0ded4c7fd5d268..50c0a7ab9cf74c65e91d66e5c76542c62a29580c 100644 (file)
@@ -7,13 +7,13 @@
  *   API result array
  */
 function mailing_group_subscribe_example() {
-  $params = array(
+  $params = [
     'email' => 'test@test.test',
     'group_id' => 2,
     'contact_id' => 3,
     'hash' => 'b15de8b64e2cec34',
     'time_stamp' => '20101212121212',
-  );
+  ];
 
   try{
     $result = civicrm_api3('mailing_group', 'subscribe', $params);
@@ -23,11 +23,11 @@ function mailing_group_subscribe_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,19 +41,19 @@ function mailing_group_subscribe_example() {
  */
 function mailing_group_subscribe_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '3',
         'subscribe_id' => '1',
         'hash' => '67eac7789eaee00',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 50459e16fd124d188c4f0ffb16dd4d5877ec3727..cfeb6060a5a006723b4ecc70b26255327d288707 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function mapping_create_example() {
-  $params = array(
+  $params = [
     'name' => 'Mapping name',
     'description' => 'Mapping description',
     'mapping_type_id' => 7,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mapping', 'create', $params);
@@ -20,12 +20,12 @@ function mapping_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function mapping_create_example() {
  */
 function mapping_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'Mapping name',
         'description' => 'Mapping description',
         'mapping_type_id' => '7',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index cf598f7072eca02dbaa9118f74476d855ec1ddec..41b355bb331e92a66d4b6397d8997238bb5240e1 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mapping_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mapping', 'delete', $params);
@@ -18,12 +18,12 @@ function mapping_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function mapping_delete_example() {
  */
 function mapping_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index f33882268987abe7f1b88445b641a38a7116f470..2235f5075edaebb7353ec71e78206c8b8903480d 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function mapping_get_example() {
-  $params = array(
+  $params = [
     'name' => 'Mapping name',
     'description' => 'Mapping description',
     'mapping_type_id' => 7,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Mapping', 'get', $params);
@@ -20,12 +20,12 @@ function mapping_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function mapping_get_example() {
  */
 function mapping_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'name' => 'Mapping name',
         'description' => 'Mapping description',
         'mapping_type_id' => '7',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9b80b2722f8240c63214c402ac5006b35883f694..093863a69b9fa78365a536681a7ebb31afa34035 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function mapping_field_create_example() {
-  $params = array(
+  $params = [
     'mapping_id' => 1,
     'name' => 'last_name',
     'contact_type' => 'Individual',
     'column_number' => 2,
     'grouping' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MappingField', 'create', $params);
@@ -22,12 +22,12 @@ function mapping_field_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function mapping_field_create_example() {
  */
 function mapping_field_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'mapping_id' => '1',
         'name' => 'last_name',
@@ -62,9 +62,9 @@ function mapping_field_create_expectedresult() {
         'grouping' => '1',
         'operator' => '',
         'value' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ef27c0f18efbf211aaf4c2a9055de6097487d15b..ddc050529d257f7b1142cf17f2db36386bf671d6 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function mapping_field_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MappingField', 'delete', $params);
@@ -18,12 +18,12 @@ function mapping_field_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function mapping_field_delete_example() {
  */
 function mapping_field_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 09d1f7df7b885b3f413ef001aa5074df3c88ad77..8fac202097cdd2cfb93e7d094e3512d22e7eda81 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function mapping_field_get_example() {
-  $params = array(
+  $params = [
     'mapping_id' => 2,
     'name' => 'last_name',
     'contact_type' => 'Individual',
     'column_number' => 2,
     'grouping' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MappingField', 'get', $params);
@@ -22,12 +22,12 @@ function mapping_field_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,22 +41,22 @@ function mapping_field_get_example() {
  */
 function mapping_field_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'mapping_id' => '2',
         'name' => 'last_name',
         'contact_type' => 'Individual',
         'column_number' => '2',
         'grouping' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 107c3cc7c3ce7d2ffbbac1ff990b0dd3ba5d32dd..7285304133fc900728ccdbd344d457df502b18d8 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function membership_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 79,
     'membership_type_id' => 47,
     'join_date' => '2006-01-21',
@@ -15,7 +15,7 @@ function membership_create_example() {
     'source' => 'Payment',
     'is_override' => 1,
     'status_id' => 30,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'create', $params);
@@ -25,12 +25,12 @@ function membership_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function membership_create_example() {
  */
 function membership_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '79',
         'membership_type_id' => '47',
@@ -66,9 +66,9 @@ function membership_create_expectedresult() {
         'is_pay_later' => '',
         'contribution_recur_id' => '',
         'campaign_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 42fa4d5b8b3fc803cde284146c969756da945a46..13651a3c9522b5c0068198626031d3e9683ab017 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function membership_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 91,
     'membership_type_id' => 55,
     'join_date' => '2009-01-21',
@@ -16,7 +16,7 @@ function membership_create_example() {
     'is_override' => 1,
     'status_id' => 34,
     'custom_1' => 'custom string',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'create', $params);
@@ -26,12 +26,12 @@ function membership_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,13 +45,13 @@ function membership_create_example() {
  */
 function membership_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '91',
         'membership_type_id' => '55',
@@ -67,9 +67,9 @@ function membership_create_expectedresult() {
         'is_pay_later' => '',
         'contribution_recur_id' => '',
         'campaign_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 953ecbffe636c4feee633297eb049cd212b13233..75e906612257d08ead69fefbc37c42312bf4f3ff 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function membership_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
     'preserve_contribution' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'delete', $params);
@@ -19,12 +19,12 @@ function membership_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,12 +38,12 @@ function membership_delete_example() {
  */
 function membership_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => TRUE,
-  );
+  ];
 
   return $expectedResult;
 }
index 92109b857af7d24e0f6adf31678378234ce5c8ef..6ab53bdccfdc71d9a1d39b3c35cb856078fdfc9c 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function membership_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 47,
-    'filters' => array(
+    'filters' => [
       'is_current' => 1,
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'get', $params);
@@ -23,12 +23,12 @@ function membership_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function membership_get_example() {
  */
 function membership_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '47',
         'membership_type_id' => '29',
@@ -62,9 +62,9 @@ function membership_get_expectedresult() {
         'is_pay_later' => 0,
         'membership_name' => 'General',
         'relationship_name' => 'Child of',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 8c4fb2aed6cee0b268c69fd7e9da06b0c138e4cf..cb6c5aa4bbb82ec4e57cfd9c985f60fce43edf28 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function membership_get_example() {
-  $params = array(
+  $params = [
     'membership_type_id' => 23,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'get', $params);
@@ -18,12 +18,12 @@ function membership_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function membership_get_example() {
  */
 function membership_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '38',
         'membership_type_id' => '23',
@@ -59,9 +59,9 @@ function membership_get_expectedresult() {
         'membership_name' => 'General',
         'relationship_name' => 'Child of',
         'custom_1_1' => 'custom string',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 79ebb5a9c29aadafce53a5ed0aed21233ad1bbff..be147d722d3c707345dedab2ed3bcfbf1d536972 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function membership_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 94,
     'membership_type_id' => 57,
     'join_date' => '2009-01-21',
@@ -15,7 +15,7 @@ function membership_create_example() {
     'source' => 'Payment',
     'is_override' => 1,
     'status_id' => 35,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'create', $params);
@@ -25,12 +25,12 @@ function membership_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function membership_create_example() {
  */
 function membership_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '94',
         'membership_type_id' => '57',
@@ -66,9 +66,9 @@ function membership_create_expectedresult() {
         'is_pay_later' => '',
         'contribution_recur_id' => '',
         'campaign_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f93f9d1bcdd0c72875b4987ab1e92a4acf2eef32..2a10b8e713a1c6a6ddd888a72e6fdaf492b2589c 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function membership_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 112,
     'membership_type_id' => 69,
     'join_date' => '2009-01-21',
@@ -16,7 +16,7 @@ function membership_create_example() {
     'is_override' => 1,
     'status_id' => 41,
     'custom_1' => 'custom string',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Membership', 'create', $params);
@@ -26,12 +26,12 @@ function membership_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,13 +45,13 @@ function membership_create_example() {
  */
 function membership_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '112',
         'membership_type_id' => '69',
@@ -67,9 +67,9 @@ function membership_create_expectedresult() {
         'is_pay_later' => '',
         'contribution_recur_id' => '',
         'campaign_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 15f17ed82d2532d2cd1cab4f04df93a10bf03314..1df477999ae84a50112a78a1526d3db484c1de65 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function membership_payment_create_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 2,
     'membership_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipPayment', 'create', $params);
@@ -19,12 +19,12 @@ function membership_payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,19 +38,19 @@ function membership_payment_create_example() {
  */
 function membership_payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'membership_id' => '1',
         'contribution_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b93156fd3d77ba42ea8cb117179e568e34642b3a..86dfa26b05e9f689c8d84c2354a9d0dd595e7fe4 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function membership_payment_get_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 4,
     'membership_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipPayment', 'get', $params);
@@ -19,12 +19,12 @@ function membership_payment_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,19 +38,19 @@ function membership_payment_get_example() {
  */
 function membership_payment_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'membership_id' => '2',
         'contribution_id' => '4',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1bfd08c1e71aaa6b7cde3a4039c293f61b5223fd..614c84415c0d9e4982869cec549de05fc6e46e08 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function membership_status_create_example() {
-  $params = array(
+  $params = [
     'name' => 'test membership status',
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipStatus', 'create', $params);
@@ -18,12 +18,12 @@ function membership_status_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function membership_status_create_example() {
  */
 function membership_status_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 15,
-    'values' => array(
-      '15' => array(
+    'values' => [
+      '15' => [
         'id' => '15',
         'name' => 'test membership status',
         'label' => 'test membership status',
@@ -59,9 +59,9 @@ function membership_status_create_expectedresult() {
         'is_default' => '',
         'is_active' => '',
         'is_reserved' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 0291fdb620c2bcfbe6eeb00db3b6abc4af99f406..396a9a68ca2a42fd9b8ebbae7c4513f415057f55 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function membership_status_get_example() {
-  $params = array(
+  $params = [
     'name' => 'test status',
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipStatus', 'get', $params);
@@ -18,12 +18,12 @@ function membership_status_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function membership_status_get_example() {
  */
 function membership_status_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 9,
-    'values' => array(
-      '9' => array(
+    'values' => [
+      '9' => [
         'id' => '9',
         'name' => 'test status',
         'label' => 'test status',
@@ -54,9 +54,9 @@ function membership_status_get_expectedresult() {
         'is_default' => 0,
         'is_active' => '1',
         'is_reserved' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1a01818506bb79707de9e384d1e411ecb580ea93..f78351a9008d6fdbeacea40083b7eac91447d9fc 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function membership_type_create_example() {
-  $params = array(
+  $params = [
     'name' => '40+ Membership',
     'description' => 'people above 40 are given health instructions',
     'member_of_contact_id' => 7,
@@ -17,7 +17,7 @@ function membership_type_create_example() {
     'duration_interval' => '10',
     'period_type' => 'rolling',
     'visibility' => 'public',
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipType', 'create', $params);
@@ -27,12 +27,12 @@ function membership_type_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function membership_type_create_example() {
  */
 function membership_type_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'domain_id' => '1',
         'name' => '40+ Membership',
@@ -75,9 +75,9 @@ function membership_type_create_expectedresult() {
         'auto_renew' => '',
         'is_active' => '1',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 2c08431368b02b849f6c284d3c43349006fba56a..59200470d94b3e93e8107a01515b073dce506c00 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function membership_type_delete_example() {
-  $params = array(
+  $params = [
     'id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipType', 'delete', $params);
@@ -18,12 +18,12 @@ function membership_type_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function membership_type_delete_example() {
  */
 function membership_type_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index e9904be80405085112b41b8f0fdf7a99e93f5d3e..232ad99518fb9fd328e91ea1afa69dfd8cfcf2d0 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function membership_type_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MembershipType', 'get', $params);
@@ -18,12 +18,12 @@ function membership_type_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function membership_type_get_example() {
  */
 function membership_type_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'domain_id' => '1',
         'name' => 'General',
@@ -57,9 +57,9 @@ function membership_type_get_expectedresult() {
         'auto_renew' => 0,
         'is_active' => '1',
         'contribution_type_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 7f2f51393bdd056401db885df59b36fa77e988d7..16a8b53f259bcdaed0e875193f04b03b7d7961c3 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function message_template_create_example() {
-  $params = array(
+  $params = [
     'msg_title' => 'msg_title_284',
     'msg_subject' => 'msg_subject_284',
     'msg_text' => 'msg_text_284',
@@ -14,7 +14,7 @@ function message_template_create_example() {
     'workflow_id' => 284,
     'is_default' => '1',
     'is_reserved' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MessageTemplate', 'create', $params);
@@ -24,12 +24,12 @@ function message_template_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function message_template_create_example() {
  */
 function message_template_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 69,
-    'values' => array(
-      '69' => array(
+    'values' => [
+      '69' => [
         'id' => '69',
         'msg_title' => 'msg_title_284',
         'msg_subject' => 'msg_subject_284',
@@ -61,9 +61,9 @@ function message_template_create_expectedresult() {
         'is_reserved' => '1',
         'is_sms' => '',
         'pdf_format_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 388e12c2ae0633d642b93fd69bb6f0a97755b991..70f769ff0dda02135219e28ae1c9a822274bb331 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function message_template_delete_example() {
-  $params = array(
+  $params = [
     'id' => 72,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MessageTemplate', 'delete', $params);
@@ -18,12 +18,12 @@ function message_template_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function message_template_delete_example() {
  */
 function message_template_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 318d8aada33c7eccc6622c6919dbe2422fd26214..d29e2073f7ec6a0a1bfff9fd2023ec5d78b65362 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function message_template_get_example() {
-  $params = array(
+  $params = [
     'msg_title' => 'msg_title_285',
     'msg_subject' => 'msg_subject_285',
     'msg_text' => 'msg_text_285',
@@ -14,7 +14,7 @@ function message_template_get_example() {
     'workflow_id' => 285,
     'is_default' => '1',
     'is_reserved' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('MessageTemplate', 'get', $params);
@@ -24,12 +24,12 @@ function message_template_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function message_template_get_example() {
  */
 function message_template_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 70,
-    'values' => array(
-      '70' => array(
+    'values' => [
+      '70' => [
         'id' => '70',
         'msg_title' => 'msg_title_285',
         'msg_subject' => 'msg_subject_285',
@@ -61,9 +61,9 @@ function message_template_get_expectedresult() {
         'is_reserved' => '1',
         'is_sms' => '1',
         'pdf_format_id' => '285',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 949de282481db2eda70a8ced2fd7e08ce800115e..89166d5ee3107c468c93469685f5107c55defeb2 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function note_create_example() {
-  $params = array(
+  $params = [
     'entity_table' => 'civicrm_contact',
     'entity_id' => 9,
     'note' => 'Hello!!! m testing Note',
     'contact_id' => 9,
     'modified_date' => '2011-01-31',
     'subject' => 'Test Note',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Note', 'create', $params);
@@ -23,12 +23,12 @@ function note_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function note_create_example() {
  */
 function note_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 8,
-    'values' => array(
-      '8' => array(
+    'values' => [
+      '8' => [
         'id' => '8',
         'entity_table' => 'civicrm_contact',
         'entity_id' => '9',
@@ -57,9 +57,9 @@ function note_create_expectedresult() {
         'modified_date' => '2012-11-14 16:02:35',
         'subject' => 'Test Note',
         'privacy' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 43d8b4f7f1e00ea6a301f77dcee4a391f1f4da1d..7fdca70af565b0614b7cbbb7ee5bd06165ff9f55 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function note_delete_example() {
-  $params = array(
+  $params = [
     'id' => 19,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Note', 'delete', $params);
@@ -18,12 +18,12 @@ function note_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function note_delete_example() {
  */
 function note_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 8fea36b90b536f88f4271cf7bdf8b770808d6038..f045d610abd8a3cc89eb5f700cfd18c8bb37daff 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function note_get_example() {
-  $params = array(
+  $params = [
     'entity_table' => 'civicrm_contact',
     'entity_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Note', 'get', $params);
@@ -19,12 +19,12 @@ function note_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,12 +38,12 @@ function note_get_example() {
  */
 function note_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
-    'values' => array(),
-  );
+    'values' => [],
+  ];
 
   return $expectedResult;
 }
index aeba330a1fd2cdddaefd547a324f675e75a7fbe8..39cfeb016187e662abd4ec739db7787974a88cf8 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function open_i_d_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'openid' => 'My OpenID handle',
     'location_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('OpenID', 'create', $params);
@@ -20,12 +20,12 @@ function open_i_d_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,22 +39,22 @@ function open_i_d_create_example() {
  */
 function open_i_d_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'location_type_id' => '1',
         'openid' => 'My OpenID handle',
         'allowed_to_login' => '',
         'is_primary' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9f6d1cebd3f9271121fec33053d25eb28e732410..291dbbc592b3a07d17a89a895d86e75d09d14429 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function open_i_d_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('OpenID', 'delete', $params);
@@ -18,12 +18,12 @@ function open_i_d_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function open_i_d_delete_example() {
  */
 function open_i_d_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index ec8eb8c42549c502d362a1ec6fda1ff03442d97a..4ebf7f556dba3e349aafbd7066e4c416394e4be2 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function open_i_d_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 4,
     'openid' => 'My OpenID handle',
     'location_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('OpenID', 'get', $params);
@@ -20,12 +20,12 @@ function open_i_d_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,22 +39,22 @@ function open_i_d_get_example() {
  */
 function open_i_d_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '4',
         'location_type_id' => '1',
         'openid' => 'My OpenID handle',
         'allowed_to_login' => 0,
         'is_primary' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index cee25ba50b24470a8f7671d72e4beca408c4e074..b44190696a358959413f28352c483823ff18f370 100644 (file)
@@ -6,19 +6,19 @@
  *   API result array
  */
 function option_group_create_example() {
-  $params = array(
+  $params = [
     'sequential' => 1,
     'name' => 'civicrm_event.amount.560',
     'is_reserved' => 1,
     'is_active' => 1,
-    'api.OptionValue.create' => array(
+    'api.OptionValue.create' => [
       'label' => 'workshop',
       'value' => 35,
       'is_default' => 1,
       'is_active' => 1,
       'format.only_id' => 1,
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('OptionGroup', 'create', $params);
@@ -28,12 +28,12 @@ function option_group_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -47,13 +47,13 @@ function option_group_create_example() {
  */
 function option_group_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 92,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '92',
         'name' => 'civicrm_event.amount.560',
         'title' => '',
@@ -63,9 +63,9 @@ function option_group_create_expectedresult() {
         'is_active' => '1',
         'is_locked' => '',
         'api.OptionValue.create' => 849,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 20839505b8fad0e44a7de4703ec559312732472c..953f4eb76053216ecffc726ca655fd4ff2d91789 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function option_group_delete_example() {
-  $params = array(
+  $params = [
     'id' => 97,
-  );
+  ];
 
   try{
     $result = civicrm_api3('OptionGroup', 'delete', $params);
@@ -18,12 +18,12 @@ function option_group_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function option_group_delete_example() {
  */
 function option_group_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 0b24c9013e596b742141abfdf97e2ed4a1cb8fc5..396906a3fcdeb9ee3b94bb452b9c72cceabaab7c 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function option_group_get_example() {
-  $params = array(
+  $params = [
     'name' => 'preferred_communication_method',
-  );
+  ];
 
   try{
     $result = civicrm_api3('OptionGroup', 'get', $params);
@@ -18,12 +18,12 @@ function option_group_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,22 +37,22 @@ function option_group_get_example() {
  */
 function option_group_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'preferred_communication_method',
         'title' => 'Preferred Communication Method',
         'is_reserved' => '1',
         'is_active' => '1',
         'is_locked' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 964c41ffdc82f961e356c5b98bd94e404c497198..9fc467248ece490d33e9586654b60b08dfae6ad8 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function option_value_get_example() {
-  $params = array(
+  $params = [
     'option_group_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('OptionValue', 'get', $params);
@@ -18,12 +18,12 @@ function option_value_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function option_value_get_example() {
  */
 function option_value_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'option_group_id' => '1',
         'label' => 'Phone',
@@ -53,8 +53,8 @@ function option_value_get_expectedresult() {
         'is_optgroup' => 0,
         'is_reserved' => 0,
         'is_active' => '1',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'id' => '2',
         'option_group_id' => '1',
         'label' => 'Email',
@@ -65,8 +65,8 @@ function option_value_get_expectedresult() {
         'is_optgroup' => 0,
         'is_reserved' => 0,
         'is_active' => '1',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'id' => '3',
         'option_group_id' => '1',
         'label' => 'Postal Mail',
@@ -77,8 +77,8 @@ function option_value_get_expectedresult() {
         'is_optgroup' => 0,
         'is_reserved' => 0,
         'is_active' => '1',
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'id' => '4',
         'option_group_id' => '1',
         'label' => 'SMS',
@@ -89,8 +89,8 @@ function option_value_get_expectedresult() {
         'is_optgroup' => 0,
         'is_reserved' => 0,
         'is_active' => '1',
-      ),
-      '5' => array(
+      ],
+      '5' => [
         'id' => '5',
         'option_group_id' => '1',
         'label' => 'Fax',
@@ -101,9 +101,9 @@ function option_value_get_expectedresult() {
         'is_optgroup' => 0,
         'is_reserved' => 0,
         'is_active' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b7253c8ef48f76442844ff8d94b220732ae4a94c..bc4bbcd61b4b3a40d1e8d745a0fdbfd99248da7b 100644 (file)
@@ -8,13 +8,13 @@
  *   API result array
  */
 function option_value_getsingle_example() {
-  $params = array(
+  $params = [
     'option_group_id' => 1,
-    'options' => array(
+    'options' => [
       'sort' => 'label DESC',
       'limit' => 1,
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('OptionValue', 'getsingle', $params);
@@ -24,12 +24,12 @@ function option_value_getsingle_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,7 +43,7 @@ function option_value_getsingle_example() {
  */
 function option_value_getsingle_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'id' => '4',
     'option_group_id' => '1',
     'label' => 'SMS',
@@ -54,7 +54,7 @@ function option_value_getsingle_expectedresult() {
     'is_optgroup' => 0,
     'is_reserved' => 0,
     'is_active' => '1',
-  );
+  ];
 
   return $expectedResult;
 }
index 2e6ea262cac1069bc363038a2875641227ceb659..eef34ecfae5b3c6a4181562cab6b6bcd660e68d7 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function order_cancel_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Order', 'cancel', $params);
@@ -18,12 +18,12 @@ function order_cancel_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function order_cancel_example() {
  */
 function order_cancel_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '16',
         'financial_type_id' => '1',
@@ -74,9 +74,9 @@ function order_cancel_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 264b1493bd41f5df1f351577c415b93e9481dc3c..8ab83214d14655d6d19f591060473d60cb819187 100644 (file)
@@ -6,16 +6,16 @@
  *   API result array
  */
 function order_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 8,
     'receive_date' => '2010-01-20',
     'total_amount' => 200,
     'financial_type_id' => 1,
     'contribution_status_id' => 1,
-    'line_items' => array(
-      '0' => array(
-        'line_item' => array(
-          '0' => array(
+    'line_items' => [
+      '0' => [
+        'line_item' => [
+          '0' => [
             'price_field_id' => '4',
             'price_field_value_id' => '5',
             'label' => 'Price Field 2',
@@ -26,9 +26,9 @@ function order_create_example() {
             'financial_type_id' => '4',
             'entity_table' => 'civicrm_membership',
             'membership_type_id' => 1,
-          ),
-        ),
-        'params' => array(
+          ],
+        ],
+        'params' => [
           'contact_id' => 8,
           'membership_type_id' => 2,
           'join_date' => '2006-01-21',
@@ -37,10 +37,10 @@ function order_create_example() {
           'source' => 'Payment',
           'is_override' => 1,
           'status_id' => 1,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Order', 'create', $params);
@@ -50,12 +50,12 @@ function order_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -69,13 +69,13 @@ function order_create_example() {
  */
 function order_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '8',
         'financial_type_id' => '1',
@@ -106,9 +106,9 @@ function order_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index b1a8a1040119fe0f6099e38192e0cadade97eede..6baee2a7293f98532a2c09bfcabc0ce6bc21e0e3 100644 (file)
@@ -8,16 +8,16 @@
  *   API result array
  */
 function order_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 11,
     'receive_date' => '2010-01-20',
     'total_amount' => 300,
     'financial_type_id' => 1,
     'contribution_status_id' => 1,
-    'line_items' => array(
-      '0' => array(
-        'line_item' => array(
-          '2' => array(
+    'line_items' => [
+      '0' => [
+        'line_item' => [
+          '2' => [
             'price_field_id' => '2',
             'price_field_value_id' => '2',
             'label' => 'Price Field 1',
@@ -27,8 +27,8 @@ function order_create_example() {
             'line_total' => '100',
             'financial_type_id' => '4',
             'entity_table' => 'civicrm_participant',
-          ),
-          '3' => array(
+          ],
+          '3' => [
             'price_field_id' => '2',
             'price_field_value_id' => '3',
             'label' => 'Price Field 2',
@@ -38,19 +38,19 @@ function order_create_example() {
             'line_total' => '200',
             'financial_type_id' => '4',
             'entity_table' => 'civicrm_participant',
-          ),
-        ),
-        'params' => array(
+          ],
+        ],
+        'params' => [
           'contact_id' => 11,
           'event_id' => 1,
           'status_id' => 1,
           'role_id' => 1,
           'register_date' => '2007-07-21 00:00:00',
           'source' => 'Online Event Registration: API Testing',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Order', 'create', $params);
@@ -60,12 +60,12 @@ function order_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -79,13 +79,13 @@ function order_create_example() {
  */
 function order_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '11',
         'financial_type_id' => '1',
@@ -116,9 +116,9 @@ function order_create_expectedresult() {
         'tax_amount' => '',
         'revenue_recognition_date' => '',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9021a479a806fea5a7e0bdd4e0a50c40b6169aab..a1ba94375e71947f026623b036ec805c324919b8 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function order_delete_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Order', 'delete', $params);
@@ -18,12 +18,12 @@ function order_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,15 +37,15 @@ function order_delete_example() {
  */
 function order_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
+    'values' => [
       '1' => 1,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 720596c3d716f9d0b6b6bd3303c80961cf2660e4..32ef1a23b76d727bbf5713d5a5e12ca6f19477ad 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function order_get_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Order', 'get', $params);
@@ -18,12 +18,12 @@ function order_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function order_get_example() {
  */
 function order_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -93,8 +93,8 @@ function order_get_expectedresult() {
         'check_number' => '',
         'id' => '1',
         'contribution_type_id' => '1',
-        'line_items' => array(
-          '0' => array(
+        'line_items' => [
+          '0' => [
             'id' => '1',
             'entity_table' => 'civicrm_contribution',
             'entity_id' => '1',
@@ -108,11 +108,11 @@ function order_get_expectedresult() {
             'financial_type_id' => '1',
             'non_deductible_amount' => '0.00',
             'contribution_type_id' => '1',
-          ),
-        ),
-      ),
-    ),
-  );
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 15aa07367eb16d639b97a40559e9ef68f921b359..a6a714208d33a3dcb188895a95cd7be637260780 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function participant_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 2,
     'event_id' => 2,
     'status_id' => 1,
@@ -14,7 +14,7 @@ function participant_create_example() {
     'register_date' => '2007-07-21 00:00:00',
     'source' => 'Online Event Registration: API Testing',
     'custom_1' => 'custom string',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Participant', 'create', $params);
@@ -24,12 +24,12 @@ function participant_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function participant_create_example() {
  */
 function participant_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'contact_id' => '2',
         'event_id' => '2',
@@ -69,9 +69,9 @@ function participant_create_expectedresult() {
         'cart_id' => '',
         'must_wait' => '',
         'transferred_to_contact_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 52ad6116ac95bca0c43be926b76694198468fd10..0734b19708a4288bbbdf02b386566f0947bd84e7 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function participant_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Participant', 'get', $params);
@@ -18,12 +18,12 @@ function participant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function participant_get_example() {
  */
 function participant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '2',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -71,9 +71,9 @@ function participant_get_expectedresult() {
         'participant_discount_name' => '',
         'participant_campaign_id' => '',
         'id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 37555e4bebf134476d806b95266ca85b6d9bfc20..8f098e52c344170e0f072a090f921fdd13605b16 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function participant_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 4,
     'api.participant.delete' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Participant', 'get', $params);
@@ -21,12 +21,12 @@ function participant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,12 +40,12 @@ function participant_get_example() {
  */
 function participant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'contact_id' => '4',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -73,14 +73,14 @@ function participant_get_expectedresult() {
         'participant_discount_name' => '',
         'participant_campaign_id' => '',
         'id' => '2',
-        'api.participant.delete' => array(
+        'api.participant.delete' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'values' => 1,
-        ),
-      ),
-      '3' => array(
+        ],
+      ],
+      '3' => [
         'contact_id' => '4',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -108,15 +108,15 @@ function participant_get_expectedresult() {
         'participant_discount_name' => '',
         'participant_campaign_id' => '',
         'id' => '3',
-        'api.participant.delete' => array(
+        'api.participant.delete' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'values' => 1,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c6b335e63d25fc8c5d5694b46c74b97506a61373..75bd573d5e4661624abcfd29b7b064aafce521dd 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function participant_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
     'api.event.get' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Participant', 'get', $params);
@@ -21,12 +21,12 @@ function participant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function participant_get_example() {
  */
 function participant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '2',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -74,13 +74,13 @@ function participant_get_expectedresult() {
         'participant_discount_name' => '',
         'participant_campaign_id' => '',
         'id' => '1',
-        'api.event.get' => array(
+        'api.event.get' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 7,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '7',
               'title' => 'Annual CiviCRM meet',
               'event_title' => 'Annual CiviCRM meet',
@@ -117,12 +117,12 @@ function participant_get_expectedresult() {
               'is_share' => '1',
               'is_confirm_enabled' => '1',
               'is_billing_required' => 0,
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 5dca9fe9f3263a1000c3fcbc9deb1b77693dc07e..9374697c0265e0c6f5dad05ea0a523224501c91d 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function participant_payment_create_example() {
-  $params = array(
+  $params = [
     'participant_id' => 13,
     'contribution_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantPayment', 'create', $params);
@@ -19,12 +19,12 @@ function participant_payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,19 +38,19 @@ function participant_payment_create_example() {
  */
 function participant_payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'participant_id' => '13',
         'contribution_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c7e48e4eef9f62da5f2123d5e5682f719d3475b1..4bf80353acefc5721a56f3b6eb0d29814a61e9f2 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function participant_payment_delete_example() {
-  $params = array(
+  $params = [
     'id' => 5,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantPayment', 'delete', $params);
@@ -18,12 +18,12 @@ function participant_payment_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function participant_payment_delete_example() {
  */
 function participant_payment_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index eaf18755b83e3af0c7efe31188ec55c339db379e..be2f52c535a932845802c659acdd8d286512d6fb 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function participant_payment_get_example() {
-  $params = array(
+  $params = [
     'participant_id' => 64,
     'contribution_id' => 6,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantPayment', 'get', $params);
@@ -19,12 +19,12 @@ function participant_payment_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,19 +38,19 @@ function participant_payment_get_example() {
  */
 function participant_payment_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 6,
-    'values' => array(
-      '6' => array(
+    'values' => [
+      '6' => [
         'id' => '6',
         'participant_id' => '64',
         'contribution_id' => '6',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9059a8b3225bcc6fb9c6298beaeb74d669ec5f8b..44a13f74183f1638e4e94b207dff1a1308574c27 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function participant_status_type_create_example() {
-  $params = array(
+  $params = [
     'name' => 'test status',
     'label' => 'I am a test',
     'class' => 'Positive',
@@ -15,7 +15,7 @@ function participant_status_type_create_example() {
     'is_counted' => 1,
     'visibility_id' => 1,
     'weight' => 10,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantStatusType', 'create', $params);
@@ -25,12 +25,12 @@ function participant_status_type_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function participant_status_type_create_example() {
  */
 function participant_status_type_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 18,
-    'values' => array(
-      '18' => array(
+    'values' => [
+      '18' => [
         'id' => '18',
         'name' => 'test status',
         'label' => 'I am a test',
@@ -60,9 +60,9 @@ function participant_status_type_create_expectedresult() {
         'is_counted' => '1',
         'weight' => '10',
         'visibility_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ae4fa45657092458eca5bcc4c71fb03d3bca93ef..4c1567d175f659095a09c73c192a08dcde0c69f6 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function participant_status_type_delete_example() {
-  $params = array(
+  $params = [
     'id' => 19,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantStatusType', 'delete', $params);
@@ -18,12 +18,12 @@ function participant_status_type_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function participant_status_type_delete_example() {
  */
 function participant_status_type_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => TRUE,
-  );
+  ];
 
   return $expectedResult;
 }
index 7eb41e6d0f06ef7f713ae90e2e51abcd234b0881..70bd8a9d244f72326c216facb647c643c0bbd561 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function participant_status_type_get_example() {
-  $params = array(
+  $params = [
     'name' => 'test status',
     'label' => 'I am a test',
     'class' => 'Positive',
@@ -15,7 +15,7 @@ function participant_status_type_get_example() {
     'is_counted' => 1,
     'visibility_id' => 1,
     'weight' => 10,
-  );
+  ];
 
   try{
     $result = civicrm_api3('ParticipantStatusType', 'get', $params);
@@ -25,12 +25,12 @@ function participant_status_type_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function participant_status_type_get_example() {
  */
 function participant_status_type_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 18,
-    'values' => array(
-      '18' => array(
+    'values' => [
+      '18' => [
         'id' => '18',
         'name' => 'test status',
         'label' => 'I am a test',
@@ -60,9 +60,9 @@ function participant_status_type_get_expectedresult() {
         'is_counted' => '1',
         'weight' => '10',
         'visibility_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 84e18f440781f0fc9b0e5cc50a610492e5d22423..c9232203237f52ac527ca2947c0e335d3ed233ae 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function payment_cancel_example() {
-  $params = array(
+  $params = [
     'id' => 2,
     'check_permissions' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'cancel', $params);
@@ -19,12 +19,12 @@ function payment_cancel_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function payment_cancel_example() {
  */
 function payment_cancel_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => 3,
         'from_financial_account_id' => '7',
         'to_financial_account_id' => '6',
@@ -58,9 +58,9 @@ function payment_cancel_expectedresult() {
         'trxn_result_code' => '',
         'status_id' => '7',
         'payment_processor_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 6ece14b33acd50ffc679c8cdd53aafa5d367f884..335945660b5e0987cd8a35ba1b3e78e9aae83734 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function payment_create_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
     'total_amount' => 50,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'create', $params);
@@ -19,12 +19,12 @@ function payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function payment_create_example() {
  */
 function payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'from_financial_account_id' => '7',
         'to_financial_account_id' => '6',
@@ -58,9 +58,9 @@ function payment_create_expectedresult() {
         'trxn_result_code' => '',
         'status_id' => '1',
         'payment_processor_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index f2b1613a61a4feb76304c0910ade14194cadc631..7d2c3fdb154745f1ba27740b92290e48e6577790 100644 (file)
@@ -8,18 +8,18 @@
  *   API result array
  */
 function payment_create_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
     'total_amount' => 50,
-    'line_item' => array(
-      '0' => array(
+    'line_item' => [
+      '0' => [
         '1' => 10,
-      ),
-      '1' => array(
+      ],
+      '1' => [
         '2' => 40,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'create', $params);
@@ -29,12 +29,12 @@ function payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -48,13 +48,13 @@ function payment_create_example() {
  */
 function payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'from_financial_account_id' => '7',
         'to_financial_account_id' => '6',
@@ -68,9 +68,9 @@ function payment_create_expectedresult() {
         'trxn_result_code' => '',
         'status_id' => '1',
         'payment_processor_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 51bc8727f919d06702a455d7e6ae2f2c2f164790..99c75f8b2ca525a84a914a27ec56ce6562098ece 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function payment_delete_example() {
-  $params = array(
+  $params = [
     'id' => 2,
     'check_permissions' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'delete', $params);
@@ -19,12 +19,12 @@ function payment_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,12 +38,12 @@ function payment_delete_example() {
  */
 function payment_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index ac1263d504c3b8d011b736f7f42336b5bd9fa5e2..d21df61552dd8e06844bbe1d9250c7827908e230 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function payment_get_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
     'check_permissions' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'get', $params);
@@ -19,12 +19,12 @@ function payment_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function payment_get_example() {
  */
 function payment_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'to_financial_account_id' => '6',
         'trxn_date' => '2010-01-20 00:00:00',
@@ -57,9 +57,9 @@ function payment_get_expectedresult() {
         'status_id' => '1',
         'payment_instrument_id' => '4',
         'contribution_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 81e017e22305fd9be504ec1ad2c03907fa4c5c27..38b15474bf53a40acd9f44867e32034f1c8801ce 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function payment_create_example() {
-  $params = array(
+  $params = [
     'contribution_id' => 1,
     'total_amount' => 100,
     'id' => 3,
     'check_permissions' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Payment', 'create', $params);
@@ -23,12 +23,12 @@ function payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function payment_create_example() {
  */
 function payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 5,
-    'values' => array(
-      '5' => array(
+    'values' => [
+      '5' => [
         'id' => '5',
         'from_financial_account_id' => '7',
         'to_financial_account_id' => '6',
@@ -62,9 +62,9 @@ function payment_create_expectedresult() {
         'trxn_result_code' => '',
         'status_id' => '1',
         'payment_processor_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index aa481f9fbcd397362314549aac5ea192cb1b4835..cb1794f201f9b08f52f280d16399a7eca14daa3f 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function payment_processor_create_example() {
-  $params = array(
+  $params = [
     'name' => 'API Test PP',
     'payment_processor_type_id' => 1,
     'class_name' => 'CRM_Core_Payment_APITest',
     'is_recur' => 0,
     'domain_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentProcessor', 'create', $params);
@@ -22,12 +22,12 @@ function payment_processor_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function payment_processor_create_example() {
  */
 function payment_processor_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'domain_id' => '1',
         'name' => 'API Test PP',
@@ -70,9 +70,9 @@ function payment_processor_create_expectedresult() {
         'payment_type' => '1',
         'payment_instrument_id' => '1',
         'accepted_credit_cards' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a633f4c4bf006f43c06e16eabb55167f6ed84304..4ee4993aa159c78bedc5d32ac9f79cec2974880b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function payment_processor_delete_example() {
-  $params = array(
+  $params = [
     'id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentProcessor', 'delete', $params);
@@ -18,12 +18,12 @@ function payment_processor_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function payment_processor_delete_example() {
  */
 function payment_processor_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index d6fc4c1e14323a5e968d814ff5d4953df61fa799..80acce733057a1088831e785af407dec66d58254 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function payment_processor_type_create_example() {
-  $params = array(
+  $params = [
     'sequential' => 1,
     'name' => 'API_Test_PP',
     'title' => 'API Test Payment Processor',
     'class_name' => 'CRM_Core_Payment_APITest',
     'billing_mode' => 'form',
     'is_recur' => 0,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentProcessorType', 'create', $params);
@@ -23,12 +23,12 @@ function payment_processor_type_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function payment_processor_type_create_example() {
  */
 function payment_processor_type_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 13,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '13',
         'name' => 'API_Test_PP',
         'title' => 'API Test Payment Processor',
@@ -72,9 +72,9 @@ function payment_processor_type_create_expectedresult() {
         'is_recur' => 0,
         'payment_type' => '',
         'payment_instrument_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d5a6c6d5b088ba18b2d62b670669ad737e61a194..3126ca7a3dc691ec13125447bd7a147f6b7f128b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function payment_processor_type_delete_example() {
-  $params = array(
+  $params = [
     'id' => 15,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentProcessorType', 'delete', $params);
@@ -18,12 +18,12 @@ function payment_processor_type_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function payment_processor_type_delete_example() {
  */
 function payment_processor_type_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => TRUE,
-  );
+  ];
 
   return $expectedResult;
 }
index 854c185c462d619c7f28ebc25fff1876999ec06d..5df14cd19e0666f3b907db4b9f4e187386c468a5 100644 (file)
@@ -9,12 +9,12 @@
  *   API result array
  */
 function payment_token_create_example() {
-  $params = array(
+  $params = [
     'token' => 'fancy-token-xxxx',
     'contact_id' => 3,
     'created_id' => 3,
     'payment_processor_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentToken', 'create', $params);
@@ -24,12 +24,12 @@ function payment_token_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function payment_token_create_example() {
  */
 function payment_token_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'payment_processor_id' => '1',
@@ -63,9 +63,9 @@ function payment_token_create_expectedresult() {
         'billing_last_name' => '',
         'masked_account_number' => '',
         'ip_address' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 460d6ad1368d221aca25048c23140fae4d2b7769..c7f368838fb4d45ab2c5870987435eb6bdb1195b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function payment_token_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentToken', 'delete', $params);
@@ -18,12 +18,12 @@ function payment_token_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function payment_token_delete_example() {
  */
 function payment_token_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 101c847b4080c0c72544ffabd1df6b69f8584c15..43ae1e720242740f25d7094e7d99bb5899d0875a 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function payment_token_get_example() {
-  $params = array(
+  $params = [
     'token' => 'fancy-token-xxxx',
     'contact_id' => 4,
     'created_id' => 4,
     'payment_processor_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PaymentToken', 'get', $params);
@@ -21,12 +21,12 @@ function payment_token_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,22 +40,22 @@ function payment_token_get_example() {
  */
 function payment_token_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '4',
         'payment_processor_id' => '2',
         'token' => 'fancy-token-xxxx',
         'created_date' => '2013-07-28 08:49:19',
         'created_id' => '4',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d3481c70a9236137e56ed99c67f89e6272b87d0a..dc659cce382c0c455cdf220962b44e34929c6dd6 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function pcp_create_example() {
-  $params = array(
+  $params = [
     'title' => 'Pcp title',
     'contact_id' => 1,
     'page_id' => 1,
     'pcp_block_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Pcp', 'create', $params);
@@ -21,12 +21,12 @@ function pcp_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function pcp_create_example() {
  */
 function pcp_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '1',
         'status_id' => 0,
@@ -63,9 +63,9 @@ function pcp_create_expectedresult() {
         'currency' => 'USD',
         'is_active' => '',
         'is_notify' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 384cf28e1f37defa64bd7fb4e93b3cf7754441e2..8f2a0c217839f32431f5ba7d4184b1b973812084 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function phone_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'location_type_id' => 6,
     'phone' => '(123) 456-7890',
     'is_primary' => 1,
     'phone_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Phone', 'create', $params);
@@ -22,12 +22,12 @@ function phone_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function phone_create_example() {
  */
 function phone_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '3',
         'location_type_id' => '6',
@@ -58,9 +58,9 @@ function phone_create_expectedresult() {
         'phone_ext' => '',
         'phone_numeric' => '',
         'phone_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 6f4b97e22a1d4f9a0a9074e018c0c8107cf1f7c7..07bb8a2353489dd5f7854b6a14cd3e7f81a08d89 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function phone_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Phone', 'delete', $params);
@@ -18,12 +18,12 @@ function phone_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function phone_delete_example() {
  */
 function phone_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index ef1a0794c99ec2cf00eab81a3431ff1b55bf0cb7..40571916fc0118cca51263c0872149f3f60204b9 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function phone_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 7,
     'phone' => '(123) 456-7890',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Phone', 'get', $params);
@@ -19,12 +19,12 @@ function phone_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function phone_get_example() {
  */
 function phone_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'contact_id' => '7',
         'location_type_id' => '10',
@@ -53,9 +53,9 @@ function phone_get_expectedresult() {
         'phone' => '(123) 456-7890',
         'phone_numeric' => '1234567890',
         'phone_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 777f4a7ada90aef5f7b24ee54f4eb471729f66b7..1b7cd959b9dd3e628dc62959643933bff9213c99 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function phone_getoptions_example() {
-  $params = array(
+  $params = [
     'field' => 'phone_type_id',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Phone', 'getoptions', $params);
@@ -18,12 +18,12 @@ function phone_getoptions_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,18 +37,18 @@ function phone_getoptions_example() {
  */
 function phone_getoptions_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
-    'values' => array(
+    'values' => [
       '1' => 'Phone',
       '2' => 'Mobile',
       '3' => 'Fax',
       '4' => 'Pager',
       '5' => 'Voicemail',
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index c138d72251f16e01095c8a799c782919ce9c314c..e524f20c89be2d22d2fde036c41179f27248c7ab 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function pledge_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 11,
     'pledge_create_date' => '20170207',
     'start_date' => '20170207',
@@ -20,7 +20,7 @@ function pledge_create_example() {
     'frequency_day' => 15,
     'installments' => 5,
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Pledge', 'create', $params);
@@ -30,12 +30,12 @@ function pledge_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -49,13 +49,13 @@ function pledge_create_example() {
  */
 function pledge_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'contact_id' => '11',
         'financial_type_id' => '1',
@@ -79,9 +79,9 @@ function pledge_create_expectedresult() {
         'status_id' => '2',
         'is_test' => '',
         'campaign_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 17e4780458af390a30fb4581df9818b3236ae4a0..7b6e86458f41d774657c51b9a5c72189a298c509 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function pledge_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Pledge', 'delete', $params);
@@ -18,12 +18,12 @@ function pledge_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,15 +37,15 @@ function pledge_delete_example() {
  */
 function pledge_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 'id',
-    'values' => array(
+    'values' => [
       'id' => 1,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 541ca67466de09e863d195f6d3e7474cb21f2e09..7f75449bd05f3e2f481cc2de836b146ff7251d44 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function pledge_get_example() {
-  $params = array(
+  $params = [
     'pledge_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Pledge', 'get', $params);
@@ -18,12 +18,12 @@ function pledge_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function pledge_get_example() {
  */
 function pledge_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '5',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -66,9 +66,9 @@ function pledge_get_expectedresult() {
         'pledge_campaign_id' => '',
         'pledge_currency' => 'USD',
         'id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 64b6b3ce57cb3622a6b47d183c8616405e4cdcf9..c567d852e9bb82d5432cdd2b5f62468245112446 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function pledge_get_example() {
-  $params = array(
+  $params = [
     'pledge_start_date_high' => '20170205024740',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Pledge', 'get', $params);
@@ -20,12 +20,12 @@ function pledge_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function pledge_get_example() {
  */
 function pledge_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'contact_id' => '8',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -68,9 +68,9 @@ function pledge_get_expectedresult() {
         'pledge_campaign_id' => '',
         'pledge_currency' => 'USD',
         'id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index bfbe8f64fae1d27527871097958389d6516da0b8..07070f6a61e7f7626f29d4695fec4910fb80a408 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function pledge_payment_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'pledge_id' => 1,
     'contribution_id' => 1,
     'status_id' => 1,
     'actual_amount' => 20,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PledgePayment', 'create', $params);
@@ -22,12 +22,12 @@ function pledge_payment_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function pledge_payment_create_example() {
  */
 function pledge_payment_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'pledge_id' => '1',
         'contribution_id' => '1',
@@ -58,9 +58,9 @@ function pledge_payment_create_expectedresult() {
         'reminder_date' => '',
         'reminder_count' => '',
         'status_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3a0faa1372ca119e23133559131bd162cc206eca..ce498be4ef1cd6bd0c52193ba54d8d2af30f2827 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function pledge_payment_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PledgePayment', 'delete', $params);
@@ -18,12 +18,12 @@ function pledge_payment_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,15 +37,15 @@ function pledge_payment_delete_example() {
  */
 function pledge_payment_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 'id',
-    'values' => array(
+    'values' => [
       'id' => 1,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 20018f0088111dc0855e63abf7832b404da7bea4..3d42d7ba845f03db8e354416bc43396f93e915ca 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function pledge_payment_get_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('PledgePayment', 'get', $params);
@@ -16,12 +16,12 @@ function pledge_payment_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -35,12 +35,12 @@ function pledge_payment_get_example() {
  */
 function pledge_payment_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'pledge_id' => '1',
         'scheduled_amount' => '20.00',
@@ -48,8 +48,8 @@ function pledge_payment_get_expectedresult() {
         'scheduled_date' => '20130728085413',
         'reminder_count' => 0,
         'status_id' => '2',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'id' => '2',
         'pledge_id' => '1',
         'scheduled_amount' => '20.00',
@@ -57,8 +57,8 @@ function pledge_payment_get_expectedresult() {
         'scheduled_date' => '20130728085413',
         'reminder_count' => 0,
         'status_id' => '2',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'id' => '3',
         'pledge_id' => '1',
         'scheduled_amount' => '20.00',
@@ -66,8 +66,8 @@ function pledge_payment_get_expectedresult() {
         'scheduled_date' => '20130728085413',
         'reminder_count' => 0,
         'status_id' => '2',
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'id' => '4',
         'pledge_id' => '1',
         'scheduled_amount' => '20.00',
@@ -75,8 +75,8 @@ function pledge_payment_get_expectedresult() {
         'scheduled_date' => '20130728085413',
         'reminder_count' => 0,
         'status_id' => '2',
-      ),
-      '5' => array(
+      ],
+      '5' => [
         'id' => '5',
         'pledge_id' => '1',
         'scheduled_amount' => '20.00',
@@ -84,9 +84,9 @@ function pledge_payment_get_expectedresult() {
         'scheduled_date' => '20130728085413',
         'reminder_count' => 0,
         'status_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 202ba48ac89dbc8270998c51c9d9c97e9dcfdbd2..b9dc6999d758b38d4e175c4aa98b67dbf3ce0e6b 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function pledge_payment_update_example() {
-  $params = array(
+  $params = [
     'id' => 1,
     'status_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PledgePayment', 'update', $params);
@@ -19,12 +19,12 @@ function pledge_payment_update_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function pledge_payment_update_example() {
  */
 function pledge_payment_update_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'pledge_id' => '1',
         'contribution_id' => '1',
@@ -55,9 +55,9 @@ function pledge_payment_update_expectedresult() {
         'reminder_date' => '',
         'reminder_count' => 0,
         'status_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 054a7a65fb87eebe78a52d768eac2ac6015da35b..c25152293b452a18825bec83d7cd007d0d9ee037 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function price_field_create_example() {
-  $params = array(
+  $params = [
     'price_set_id' => 3,
     'name' => 'grassvariety',
     'label' => 'Grass Variety',
     'html_type' => 'Text',
     'is_enter_qty' => 1,
     'is_active' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceField', 'create', $params);
@@ -23,12 +23,12 @@ function price_field_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,13 +42,13 @@ function price_field_create_example() {
  */
 function price_field_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'price_set_id' => '3',
         'name' => 'grassvariety',
@@ -66,9 +66,9 @@ function price_field_create_expectedresult() {
         'expire_on' => '',
         'javascript' => '',
         'visibility_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 2e1f037fffde7bb85841ff27105a2a3f127d5049..51213fe012801775990ae0ea06e4c211df4202b5 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_field_delete_example() {
-  $params = array(
+  $params = [
     'id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceField', 'delete', $params);
@@ -18,12 +18,12 @@ function price_field_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function price_field_delete_example() {
  */
 function price_field_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index c3da7002da476e75372af93c4c339f012efec66c..5ea6fe86b808c89b7c8bc6608d50278a2f2b66bb 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_field_get_example() {
-  $params = array(
+  $params = [
     'name' => 'contribution_amount',
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceField', 'get', $params);
@@ -18,12 +18,12 @@ function price_field_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function price_field_get_example() {
  */
 function price_field_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'price_set_id' => '1',
         'name' => 'contribution_amount',
@@ -56,9 +56,9 @@ function price_field_get_expectedresult() {
         'is_active' => '1',
         'is_required' => '1',
         'visibility_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a833aa785e7c5354a7e643947016fa37ced3426e..e6332aa8a05f7626b192cdeea60ecfe80e63469b 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function price_field_value_create_example() {
-  $params = array(
+  $params = [
     'price_field_id' => 13,
     'membership_type_id' => 5,
     'name' => 'memType1',
@@ -15,7 +15,7 @@ function price_field_value_create_example() {
     'membership_num_terms' => 2,
     'is_active' => 1,
     'financial_type_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceFieldValue', 'create', $params);
@@ -25,12 +25,12 @@ function price_field_value_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function price_field_value_create_example() {
  */
 function price_field_value_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 10,
-    'values' => array(
-      '10' => array(
+    'values' => [
+      '10' => [
         'id' => '10',
         'price_field_id' => '13',
         'name' => 'memType1',
@@ -69,9 +69,9 @@ function price_field_value_create_expectedresult() {
         'financial_type_id' => '2',
         'non_deductible_amount' => '',
         'contribution_type_id' => '2',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 084aac721b9d33705fba005d38b7272bb3500fe4..b258473c78cb6783b768041dfc06178efe4be352 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_field_value_delete_example() {
-  $params = array(
+  $params = [
     'id' => 7,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceFieldValue', 'delete', $params);
@@ -18,12 +18,12 @@ function price_field_value_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function price_field_value_delete_example() {
  */
 function price_field_value_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 9443533d1c075653b9fd551ad9ab05869f908723..6a949c384e9e88fdc43c144bc64a368aab4af7e4 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_field_value_get_example() {
-  $params = array(
+  $params = [
     'name' => 'contribution_amount',
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceFieldValue', 'get', $params);
@@ -18,12 +18,12 @@ function price_field_value_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function price_field_value_get_example() {
  */
 function price_field_value_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'price_field_id' => '1',
         'name' => 'contribution_amount',
@@ -55,9 +55,9 @@ function price_field_value_get_expectedresult() {
         'financial_type_id' => '1',
         'non_deductible_amount' => '0.00',
         'contribution_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index bf801c3eac02522d8d03b1a16bcda4e5ebf50264..be4f7fd9bcf9c963edc4dd73de11e64a230e8c1f 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function price_set_create_example() {
-  $params = array(
+  $params = [
     'entity_table' => 'civicrm_event',
     'entity_id' => 1,
     'name' => 'event price',
     'title' => 'event price',
     'extends' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceSet', 'create', $params);
@@ -22,12 +22,12 @@ function price_set_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function price_set_create_example() {
  */
 function price_set_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 18,
-    'values' => array(
-      '18' => array(
+    'values' => [
+      '18' => [
         'id' => '18',
         'domain_id' => '',
         'name' => 'event price',
@@ -61,9 +61,9 @@ function price_set_create_expectedresult() {
         'is_quick_config' => '',
         'is_reserved' => '',
         'min_amount' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3929b96906d51f9f119b094d45ca1ccf0f658af8..e4f96909d3b3c21e7c9991279f5a958309f14b38 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_set_delete_example() {
-  $params = array(
+  $params = [
     'id' => 19,
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceSet', 'delete', $params);
@@ -18,12 +18,12 @@ function price_set_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function price_set_delete_example() {
  */
 function price_set_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 7be052caa0e62fb15a2b904cd49c82608fea3abb..be0f4fd52e74b5e66f353ee2346a84dc65ffa331 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function price_set_get_example() {
-  $params = array(
+  $params = [
     'name' => 'default_contribution_amount',
-  );
+  ];
 
   try{
     $result = civicrm_api3('PriceSet', 'get', $params);
@@ -18,12 +18,12 @@ function price_set_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function price_set_get_example() {
  */
 function price_set_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'name' => 'default_contribution_amount',
         'title' => 'Contribution Amount',
@@ -52,10 +52,10 @@ function price_set_get_expectedresult() {
         'is_quick_config' => '1',
         'is_reserved' => '1',
         'min_amount' => 0,
-        'entity' => array(),
-      ),
-    ),
-  );
+        'entity' => [],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 57b867c4d3334dd4f238178107e1de1512d08c1d..c3d881b4b83a3d1ffa2413063b504bbd8b5efa2c 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function profile_apply_example() {
-  $params = array(
+  $params = [
     'profile_id' => 31,
     'contact_id' => 3,
     'first_name' => 'abc2',
@@ -15,7 +15,7 @@ function profile_apply_example() {
     'phone-1-1' => '022 321 826',
     'country-1' => '1013',
     'state_province-1' => '1000',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Profile', 'apply', $params);
@@ -25,12 +25,12 @@ function profile_apply_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,11 +44,11 @@ function profile_apply_example() {
  */
 function profile_apply_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 11,
-    'values' => array(
+    'values' => [
       'contact_type' => 'Individual',
       'contact_sub_type' => '',
       'contact_id' => 3,
@@ -57,31 +57,31 @@ function profile_apply_expectedresult() {
       'profile_id' => 31,
       'first_name' => 'abc2',
       'last_name' => 'xyz2',
-      'email' => array(
-        '1' => array(
+      'email' => [
+        '1' => [
           'location_type_id' => '1',
           'is_primary' => 1,
           'email' => 'abc2.xyz2@gmail.com',
-        ),
-      ),
-      'phone' => array(
-        '2' => array(
+        ],
+      ],
+      'phone' => [
+        '2' => [
           'location_type_id' => '1',
           'is_primary' => 1,
           'phone_type_id' => '1',
           'phone' => '022 321 826',
-        ),
-      ),
-      'address' => array(
-        '1' => array(
+        ],
+      ],
+      'address' => [
+        '1' => [
           'location_type_id' => '1',
           'is_primary' => 1,
           'country_id' => '1013',
           'state_province_id' => '1000',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 9a34012a834765680ba3f7c8322eef3a1158837c..0e9e07c7019b058b6822042a1937f3c6892f819a 100644 (file)
@@ -6,14 +6,14 @@
  *   API result array
  */
 function profile_get_example() {
-  $params = array(
-    'profile_id' => array(
+  $params = [
+    'profile_id' => [
       '0' => 15,
       '1' => 1,
       '2' => 'Billing',
-    ),
+    ],
     'contact_id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Profile', 'get', $params);
@@ -23,12 +23,12 @@ function profile_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,12 +42,12 @@ function profile_get_example() {
  */
 function profile_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
-    'values' => array(
-      '15' => array(
+    'values' => [
+      '15' => [
         'postal_code-1' => '90210',
         'state_province-1' => '1021',
         'country-1' => '1228',
@@ -56,8 +56,8 @@ function profile_get_expectedresult() {
         'last_name' => 'xyz1',
         'first_name' => 'abc1',
         'email-primary' => 'abc1.xyz1@yahoo.com',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'first_name' => 'abc1',
         'last_name' => 'xyz1',
         'street_address-1' => '5 Saint Helier St',
@@ -65,8 +65,8 @@ function profile_get_expectedresult() {
         'postal_code-1' => '90210',
         'country-1' => '1228',
         'state_province-1' => '1021',
-      ),
-      'Billing' => array(
+      ],
+      'Billing' => [
         'billing_first_name' => 'abc1',
         'billing_middle_name' => 'J.',
         'billing_last_name' => 'xyz1',
@@ -77,9 +77,9 @@ function profile_get_expectedresult() {
         'billing_postal_code-5' => '90210',
         'billing-email-5' => 'abc1.xyz1@yahoo.com',
         'email-5' => 'abc1.xyz1@yahoo.com',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 48b62cee421c8b890b37e51421dec723af0bcb2c..588e90a21ae1e7667b25555ae69e8b92e2187abc 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function profile_getfields_example() {
-  $params = array(
+  $params = [
     'action' => 'submit',
     'profile_id' => 27,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Profile', 'getfields', $params);
@@ -21,12 +21,12 @@ function profile_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,12 +40,12 @@ function profile_getfields_example() {
  */
 function profile_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 9,
-    'values' => array(
-      'custom_1' => array(
+    'values' => [
+      'custom_1' => [
         'label' => '_addCustomFieldToProfile',
         'groupTitle' => '_addCustomFie',
         'data_type' => 'String',
@@ -74,9 +74,9 @@ function profile_getfields_expectedresult() {
         'help_post' => '',
         'entity' => 'contact',
         'weight' => '1',
-        'api.aliases' => array(),
-      ),
-      'postal_code-1' => array(
+        'api.aliases' => [],
+      ],
+      'postal_code-1' => [
         'name' => 'postal_code',
         'type' => 2,
         'title' => 'State Province',
@@ -91,18 +91,18 @@ function profile_getfields_expectedresult() {
         'table_name' => 'civicrm_address',
         'entity' => 'address',
         'bao' => 'CRM_Core_BAO_Address',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 6,
-        ),
+        ],
         'api.required' => 0,
         'help_pre' => '',
         'help_post' => '',
         'weight' => '2',
-        'api.aliases' => array(),
-      ),
-      'state_province-1' => array(
+        'api.aliases' => [],
+      ],
+      'state_province-1' => [
         'name' => 'state_province_id',
         'type' => 1,
         'title' => 'State Province',
@@ -111,24 +111,24 @@ function profile_getfields_expectedresult() {
         'entity' => 'address',
         'bao' => 'CRM_Core_BAO_Address',
         'FKClassName' => 'CRM_Core_DAO_StateProvince',
-        'html' => array(
+        'html' => [
           'type' => 'ChainSelect',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'table' => 'civicrm_state_province',
           'keyColumn' => 'id',
           'labelColumn' => 'name',
-        ),
+        ],
         'FKApiName' => 'StateProvince',
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '3',
-        'api.aliases' => array(),
-      ),
-      'country-1' => array(
+        'api.aliases' => [],
+      ],
+      'country-1' => [
         'name' => 'country_id',
         'type' => 1,
         'title' => 'Country',
@@ -137,25 +137,25 @@ function profile_getfields_expectedresult() {
         'entity' => 'address',
         'bao' => 'CRM_Core_BAO_Address',
         'FKClassName' => 'CRM_Core_DAO_Country',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'table' => 'civicrm_country',
           'keyColumn' => 'id',
           'labelColumn' => 'name',
           'nameColumn' => 'iso_code',
-        ),
+        ],
         'FKApiName' => 'Country',
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '4',
-        'api.aliases' => array(),
-      ),
-      'phone-1-1' => array(
+        'api.aliases' => [],
+      ],
+      'phone-1-1' => [
         'name' => 'phone',
         'type' => 2,
         'title' => 'Phone',
@@ -170,18 +170,18 @@ function profile_getfields_expectedresult() {
         'table_name' => 'civicrm_phone',
         'entity' => 'phone',
         'bao' => 'CRM_Core_BAO_Phone',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 32,
           'size' => 20,
-        ),
+        ],
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '5',
-        'api.aliases' => array(),
-      ),
-      'email-primary' => array(
+        'api.aliases' => [],
+      ],
+      'email-primary' => [
         'name' => 'email',
         'type' => 2,
         'title' => 'Email',
@@ -197,20 +197,20 @@ function profile_getfields_expectedresult() {
         'table_name' => 'civicrm_email',
         'entity' => 'email',
         'bao' => 'CRM_Core_BAO_Email',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 254,
           'size' => 30,
-        ),
+        ],
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '6',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'email-Primary',
-        ),
-      ),
-      'last_name' => array(
+        ],
+      ],
+      'last_name' => [
         'name' => 'last_name',
         'type' => 2,
         'title' => 'Last Name',
@@ -225,18 +225,18 @@ function profile_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
+        ],
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '7',
-        'api.aliases' => array(),
-      ),
-      'first_name' => array(
+        'api.aliases' => [],
+      ],
+      'first_name' => [
         'name' => 'first_name',
         'type' => 2,
         'title' => 'First Name',
@@ -251,24 +251,24 @@ function profile_getfields_expectedresult() {
         'table_name' => 'civicrm_contact',
         'entity' => 'contact',
         'bao' => 'CRM_Contact_BAO_Contact',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 64,
           'size' => 30,
-        ),
+        ],
         'api.required' => '1',
         'help_pre' => '',
         'help_post' => '',
         'weight' => '8',
-        'api.aliases' => array(),
-      ),
-      'profile_id' => array(
+        'api.aliases' => [],
+      ],
+      'profile_id' => [
         'api.required' => TRUE,
         'title' => 'Profile ID',
         'name' => 'profile_id',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a8b26e325c92ab743a0c4e343a55c140edb2d7ad..35f3b2f770d5e7902f3fb078991fca708f6fea06 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function profile_submit_example() {
-  $params = array(
+  $params = [
     'profile_id' => 29,
     'contact_id' => 3,
     'first_name' => 'abc2',
@@ -15,7 +15,7 @@ function profile_submit_example() {
     'phone-1-1' => '022 321 826',
     'country-1' => '1013',
     'state_province-1' => '1000',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Profile', 'submit', $params);
@@ -25,12 +25,12 @@ function profile_submit_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function profile_submit_example() {
  */
 function profile_submit_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'contact_type' => 'Individual',
         'contact_sub_type' => '',
@@ -100,9 +100,9 @@ function profile_submit_expectedresult() {
         'user_unique_id' => '',
         'created_date' => '2013-07-28 08:49:19',
         'modified_date' => '2012-11-14 16:02:35',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d7dfa39ddd96d86b634df63f2c4e75b87370170a..949b9765b3d8a737cf8a5861262c5ff847fc9485 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
-    'relationship_type_id' => array(
-      'BETWEEN' => array(
+  $params = [
+    'relationship_type_id' => [
+      'BETWEEN' => [
         '0' => 36,
         '1' => 38,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -25,12 +25,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,12 +44,12 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -58,8 +58,8 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'id' => '3',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -68,8 +68,8 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'id' => '4',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -78,9 +78,9 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1978de2bde515f2de131aac8e25aa3c7fb295c42..7f8db5c433f4af0536b83f3c5862757a2fe80391 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function relationship_create_example() {
-  $params = array(
+  $params = [
     'contact_id_a' => 31,
     'contact_id_b' => 33,
     'relationship_type_id' => 18,
@@ -14,7 +14,7 @@ function relationship_create_example() {
     'end_date' => '2010-12-30',
     'is_active' => 1,
     'note' => 'note',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'create', $params);
@@ -24,12 +24,12 @@ function relationship_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function relationship_create_example() {
  */
 function relationship_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id_a' => '31',
         'contact_id_b' => '33',
@@ -61,9 +61,9 @@ function relationship_create_expectedresult() {
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
         'case_id' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 74e4ffc30211eb479fa5d9553adff115f2ed3ec3..081973a3048b89d028ffbb75ee233774f04e6a54 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function relationship_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'delete', $params);
@@ -18,12 +18,12 @@ function relationship_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function relationship_delete_example() {
  */
 function relationship_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 'Deleted relationship successfully',
-  );
+  ];
 
   return $expectedResult;
 }
index 9d21e1f7812408479a8596e3c0eaa6183199a110..b533076a165769f2ad5da72556193bed753ed881 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -18,12 +18,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id_a' => '47',
         'contact_id_b' => '49',
@@ -54,9 +54,9 @@ function relationship_get_expectedresult() {
         'is_permission_b_a' => 0,
         'custom_1' => 'custom string',
         'custom_1_1' => 'custom string',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3a907c0f1a27ba4575a28d3ca72e563f28cfd5de..4a323b43a3210123008d9cd820599156c7084486 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
-    'relationship_type_id' => array(
-      'IN' => array(
+  $params = [
+    'relationship_type_id' => [
+      'IN' => [
         '0' => 36,
         '1' => 37,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -25,12 +25,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,12 +44,12 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -58,8 +58,8 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'id' => '3',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -68,9 +68,9 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 31a8a7345443d2c6d1e77244897b1e26874b2871..06ae19f46a10383f92af58322f7e34d5a0af10dc 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
-    'relationship_type_id' => array(
-      'NOT BETWEEN' => array(
+  $params = [
+    'relationship_type_id' => [
+      'NOT BETWEEN' => [
         '0' => 36,
         '1' => 38,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -25,12 +25,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -59,9 +59,9 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 5e77fe8b30c0f6d7629aa45bf261f611aaa545f1..42cad00cec94fba9abb66da40fb612d7185003df 100644 (file)
@@ -8,14 +8,14 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
-    'relationship_type_id' => array(
-      'NOT IN' => array(
+  $params = [
+    'relationship_type_id' => [
+      'NOT IN' => [
         '0' => 36,
         '1' => 37,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -25,12 +25,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,12 +44,12 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -58,8 +58,8 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-      '4' => array(
+      ],
+      '4' => [
         'id' => '4',
         'contact_id_a' => '99',
         'contact_id_b' => '101',
@@ -68,9 +68,9 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c4aee7a37ae389b2a81181e3745ba9a70d6324f9..a1275167f6372e2620d42fae56bbb704d2368362 100644 (file)
@@ -8,11 +8,11 @@
  *   API result array
  */
 function relationship_get_example() {
-  $params = array(
-    'filters' => array(
+  $params = [
+    'filters' => [
       'is_current' => 1,
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Relationship', 'get', $params);
@@ -22,12 +22,12 @@ function relationship_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function relationship_get_example() {
  */
 function relationship_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id_a' => '95',
         'contact_id_b' => '97',
@@ -56,9 +56,9 @@ function relationship_get_expectedresult() {
         'is_active' => '1',
         'is_permission_a_b' => 0,
         'is_permission_b_a' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 42826f114c59de16ff01686fe3dfdd8fdc774470..d2e71aa285c11bfbc47fd556d2324c0262606e9b 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function relationship_type_create_example() {
-  $params = array(
+  $params = [
     'name_a_b' => 'Relation 1 for relationship type create',
     'name_b_a' => 'Relation 2 for relationship type create',
     'contact_type_a' => 'Individual',
@@ -14,7 +14,7 @@ function relationship_type_create_example() {
     'is_reserved' => 1,
     'is_active' => 1,
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('RelationshipType', 'create', $params);
@@ -24,12 +24,12 @@ function relationship_type_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function relationship_type_create_example() {
  */
 function relationship_type_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'name_a_b' => 'Relation 1 for relationship type create',
         'label_a_b' => 'Relation 1 for relationship type create',
@@ -62,9 +62,9 @@ function relationship_type_create_expectedresult() {
         'contact_sub_type_b' => '',
         'is_reserved' => '1',
         'is_active' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d331378cdc9f95633737dad61686ff581a444e37..ec8c1aad7d8ac8f0a0deb5f8cd9ad1269dc70a8b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function relationship_type_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('RelationshipType', 'delete', $params);
@@ -18,12 +18,12 @@ function relationship_type_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function relationship_type_delete_example() {
  */
 function relationship_type_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 25dc1d5fc6b40a18c9ad89e0dd0581833e09fb97..48804cb7a504ee8d144e0fc45dc947a28417e1a8 100644 (file)
@@ -8,15 +8,15 @@
  *   API result array
  */
 function report_template_getrows_example() {
-  $params = array(
+  $params = [
     'report_id' => 'contact/summary',
-    'options' => array(
-      'metadata' => array(
+    'options' => [
+      'metadata' => [
         '0' => 'labels',
         '1' => 'title',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('ReportTemplate', 'getrows', $params);
@@ -26,12 +26,12 @@ function report_template_getrows_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,31 +45,31 @@ function report_template_getrows_example() {
  */
 function report_template_getrows_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'civicrm_contact_sort_name' => 'Second Domain',
         'civicrm_contact_id' => '2',
         'civicrm_contact_sort_name_link' => '/index.php?q=civicrm/report/contact/detail&amp;reset=1&amp;force=1&amp;id_op=eq&amp;id_value=2',
         'civicrm_contact_sort_name_hover' => 'View Contact Detail Report for this contact',
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'civicrm_contact_sort_name' => 'Unit Test Organization',
         'civicrm_contact_id' => '1',
         'civicrm_contact_sort_name_link' => '/index.php?q=civicrm/report/contact/detail&amp;reset=1&amp;force=1&amp;id_op=eq&amp;id_value=1',
         'civicrm_contact_sort_name_hover' => 'View Contact Detail Report for this contact',
-      ),
-    ),
-    'metadata' => array(
+      ],
+    ],
+    'metadata' => [
       'title' => 'ERROR: Title is not Set',
-      'labels' => array(
+      'labels' => [
         'civicrm_contact_sort_name' => 'Contact Name',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d9c9dc340c8941dfd0dc4075e7aec36069967153..cfb3de58223d82dbefbb64642d16f08932ca3ca0 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function report_template_getstatistics_example() {
-  $params = array(
+  $params = [
     'report_id' => 'contribute/deferredrevenue',
-  );
+  ];
 
   try{
     $result = civicrm_api3('ReportTemplate', 'getstatistics', $params);
@@ -20,12 +20,12 @@ function report_template_getstatistics_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,12 +39,12 @@ function report_template_getstatistics_example() {
  */
 function report_template_getstatistics_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
     'values' => '',
-  );
+  ];
 
   return $expectedResult;
 }
index 31d677d93a26ce2cc8bfce0308b5bea55afe0a47..149e9f6b032b1d62f7064a0233bc9a9543e517c0 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function saved_search_create_example() {
-  $params = array(
-    'form_values' => array(
+  $params = [
+    'form_values' => [
       'relation_type_id' => '6_a_b',
       'relation_target_name' => 'Default Organization',
-    ),
-    'api.Group.create' => array(
+    ],
+    'api.Group.create' => [
       'name' => 'my_smartgroup',
       'title' => 'my smartgroup',
       'description' => 'Volunteers for the default organization',
@@ -20,8 +20,8 @@ function saved_search_create_example() {
       'visibility' => 'User and User Admin Only',
       'is_hidden' => 0,
       'is_reserved' => 0,
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('SavedSearch', 'create', $params);
@@ -31,12 +31,12 @@ function saved_search_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -50,30 +50,30 @@ function saved_search_create_example() {
  */
 function saved_search_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
-        'form_values' => array(
+        'form_values' => [
           'relation_type_id' => '6_a_b',
           'relation_target_name' => 'Default Organization',
-        ),
+        ],
         'mapping_id' => '',
         'search_custom_id' => '',
         'where_clause' => '',
         'select_tables' => '',
         'where_tables' => '',
-        'api.Group.create' => array(
+        'api.Group.create' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'id' => 1,
-          'values' => array(
-            '0' => array(
+          'values' => [
+            '0' => [
               'id' => '1',
               'name' => 'my_smartgroup',
               'title' => 'my smartgroup',
@@ -94,12 +94,12 @@ function saved_search_create_expectedresult() {
               'is_reserved' => 0,
               'created_id' => '',
               'modified_id' => '',
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3d0052b6b9a83944cd339366144943dc509848d8..e2ed2a0ad274468ff6db73bc95dc4c94969336cc 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function saved_search_delete_example() {
-  $params = array(
+  $params = [
     'id' => 4,
-  );
+  ];
 
   try{
     $result = civicrm_api3('SavedSearch', 'delete', $params);
@@ -18,12 +18,12 @@ function saved_search_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function saved_search_delete_example() {
  */
 function saved_search_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 14adb3a11b2a04907b73efbe63e67a19430a6000..cb8f5c3f3e344dd22064bd7efc16365f1b7c572c 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function saved_search_get_example() {
-  $params = array(
+  $params = [
     'id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('SavedSearch', 'get', $params);
@@ -18,12 +18,12 @@ function saved_search_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,21 +37,21 @@ function saved_search_get_example() {
  */
 function saved_search_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
-        'form_values' => array(
+        'form_values' => [
           'relation_type_id' => '6_a_b',
           'relation_target_name' => 'Default Organization',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3f92f961375dac70c2befd52751274a93682f82b..88a1afc59d947f45b8503852720a49817692c79c 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function setting_create_example() {
-  $params = array(
+  $params = [
     'domain_id' => 2,
     'uniq_email_per_site' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'create', $params);
@@ -19,12 +19,12 @@ function setting_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,17 +38,17 @@ function setting_create_example() {
  */
 function setting_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 37a4d5efc4b86e3a81666bcc3a935a3b7800d80f..7cfef55b75779acf1a88c1147b63fae97c3341f0 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function setting_create_example() {
-  $params = array(
+  $params = [
     'domain_id' => 'all',
     'uniq_email_per_site' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'create', $params);
@@ -21,12 +21,12 @@ function setting_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,22 +40,22 @@ function setting_create_example() {
  */
 function setting_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => '1',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'uniq_email_per_site' => '1',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c0e189dcb2fa1c02e4459b203a22292892b72762..d600ec4c8009c694e4d6d1f63f88d62c773896c8 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function setting_create_example() {
-  $params = array(
+  $params = [
     'uniq_email_per_site' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'create', $params);
@@ -20,12 +20,12 @@ function setting_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,17 +39,17 @@ function setting_create_example() {
  */
 function setting_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index a54f24ab94976f8d2debb7adba08be2454b1328e..c7167e9131913c3f3c4098d2a6a01e1c390ec0e0 100644 (file)
@@ -8,13 +8,13 @@
  *   API result array
  */
 function setting_create_example() {
-  $params = array(
-    'domain_id' => array(
+  $params = [
+    'domain_id' => [
       '0' => 1,
       '1' => 3,
-    ),
+    ],
     'uniq_email_per_site' => 0,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'create', $params);
@@ -24,12 +24,12 @@ function setting_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,19 +43,19 @@ function setting_create_example() {
  */
 function setting_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => 0,
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'uniq_email_per_site' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 522fb14a8e2b157d8bc3a9236b32d3f9f4fed311..74d9c9a03b85e45ebab003580be1469a2a497db1 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function setting_get_example() {
-  $params = array(
+  $params = [
     'domain_id' => 2,
     'return' => 'uniq_email_per_site',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'get', $params);
@@ -19,12 +19,12 @@ function setting_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,17 +38,17 @@ function setting_get_example() {
  */
 function setting_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3a446f13d893419432be26df0852df762b3c234e..185f51b869acc83da15c09f91be4bca92f39965c 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function setting_get_example() {
-  $params = array(
+  $params = [
     'domain_id' => 'all',
     'return' => 'uniq_email_per_site',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'get', $params);
@@ -21,12 +21,12 @@ function setting_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,22 +40,22 @@ function setting_get_example() {
  */
 function setting_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => '1',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'uniq_email_per_site' => '1',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1de4b30912b1744649070d084bbaf00ef452379c..6b50ddf06943f79435983040a4976ffb751554b0 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function setting_getdefaults_example() {
-  $params = array(
+  $params = [
     'name' => 'address_format',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'getdefaults', $params);
@@ -20,12 +20,12 @@ function setting_getdefaults_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function setting_getdefaults_example() {
  */
 function setting_getdefaults_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'address_format' => '{contact.address_name}
 {contact.street_address}
 {contact.supplemental_address_1}
@@ -53,9 +53,9 @@ function setting_getdefaults_expectedresult() {
 {contact.supplemental_address_3}
 {contact.city}{, }{contact.state_province}{ }{contact.postal_code}
 {contact.country}',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 478c1c2c5f8c8971c65eefd9adb3fe8847afbc2a..e41b514ec5f5b20f12f54ea68b9be2f11db590f6 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function setting_getfields_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('Setting', 'getfields', $params);
@@ -18,12 +18,12 @@ function setting_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function setting_getfields_example() {
  */
 function setting_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 157,
-    'values' => array(
-      'address_standardization_provider' => array(
+    'values' => [
+      'address_standardization_provider' => [
         'group_name' => 'Address Preferences',
         'group' => 'address',
         'name' => 'address_standardization_provider',
@@ -55,8 +55,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => 'CiviCRM includes an optional plugin for interfacing with the United States Postal Services (USPS) Address Standardization web service. You must register to use the USPS service at https://www.usps.com/business/web-tools-apis/address-information.htm. If you are approved, they will provide you with a User ID and the URL for the service. Plugins for other address standardization services may be available from 3rd party developers. If installed, they will be included in the drop-down below. ',
-      ),
-      'address_standardization_userid' => array(
+      ],
+      'address_standardization_userid' => [
         'group_name' => 'Address Preferences',
         'group' => 'address',
         'name' => 'address_standardization_userid',
@@ -69,8 +69,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'address_standardization_url' => array(
+      ],
+      'address_standardization_url' => [
         'group_name' => 'Address Preferences',
         'group' => 'address',
         'name' => 'address_standardization_url',
@@ -84,8 +84,8 @@ function setting_getfields_expectedresult() {
         'description' => '',
         'help_text' => 'Web Service URL',
         'validate_callback' => 'CRM_Utils_Rule::url',
-      ),
-      'hideCountryMailingLabels' => array(
+      ],
+      'hideCountryMailingLabels' => [
         'group_name' => 'Address Preferences',
         'group' => 'address',
         'name' => 'hideCountryMailingLabels',
@@ -98,8 +98,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Do not display the country field in mailing labels when the country is the same as that of the domain',
         'help_text' => '',
-      ),
-      'tag_unconfirmed' => array(
+      ],
+      'tag_unconfirmed' => [
         'group_name' => 'Campaign Preferences',
         'group' => 'campaign',
         'name' => 'tag_unconfirmed',
@@ -112,8 +112,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
-      ),
-      'petition_contacts' => array(
+      ],
+      'petition_contacts' => [
         'group_name' => 'Campaign Preferences',
         'group' => 'campaign',
         'name' => 'petition_contacts',
@@ -126,65 +126,65 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => 'If set, new contacts that are created when signing a petition are assigned a tag of this name.',
-      ),
-      'civicaseRedactActivityEmail' => array(
+      ],
+      'civicaseRedactActivityEmail' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'civicaseRedactActivityEmail',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(),
+        'html_attributes' => [],
         'default' => 'default',
         'add' => '4.7',
         'title' => 'Redact Activity Email',
         'is_domain' => 1,
         'is_contact' => 0,
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Case_Info::getRedactOptions',
-        ),
+        ],
         'description' => 'Should activity emails be redacted? (Set \"Default\" to load setting from the legacy \"Settings.xml\" file.)',
         'help_text' => '',
-      ),
-      'civicaseAllowMultipleClients' => array(
+      ],
+      'civicaseAllowMultipleClients' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'civicaseAllowMultipleClients',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(),
+        'html_attributes' => [],
         'default' => 'default',
         'add' => '4.7',
         'title' => 'Allow Multiple Case Clients',
         'is_domain' => 1,
         'is_contact' => 0,
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Case_Info::getMultiClientOptions',
-        ),
+        ],
         'description' => 'How many clients may be associated with a given case? (Set \"Default\" to load setting from the legacy \"Settings.xml\" file.)',
         'help_text' => '',
-      ),
-      'civicaseNaturalActivityTypeSort' => array(
+      ],
+      'civicaseNaturalActivityTypeSort' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'civicaseNaturalActivityTypeSort',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(),
+        'html_attributes' => [],
         'default' => 'default',
         'add' => '4.7',
         'title' => 'Activity Type Sorting',
         'is_domain' => 1,
         'is_contact' => 0,
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Case_Info::getSortOptions',
-        ),
+        ],
         'description' => 'How to sort activity-types on the \"Manage Case\" screen? (Set \"Default\" to load setting from the legacy \"Settings.xml\" file.)',
         'help_text' => '',
-      ),
-      'cvv_backoffice_required' => array(
+      ],
+      'cvv_backoffice_required' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'cvv_backoffice_required',
@@ -197,13 +197,13 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Is the CVV code required for back office credit card transactions',
         'help_text' => 'If set it back-office credit card transactions will required a cvv code. Leave as required unless you have a very strong reason to change',
-      ),
-      'contribution_invoice_settings' => array(
+      ],
+      'contribution_invoice_settings' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'contribution_invoice_settings',
         'type' => 'Array',
-        'default' => array(
+        'default' => [
           'invoice_prefix' => 'INV_',
           'credit_notes_prefix' => 'CN_',
           'due_date' => '10',
@@ -211,15 +211,15 @@ function setting_getfields_expectedresult() {
           'notes' => '',
           'tax_term' => 'Sales Tax',
           'tax_display_settings' => 'Inclusive',
-        ),
+        ],
         'add' => '4.7',
         'title' => 'Contribution Invoice Settings',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'invoicing' => array(
+      ],
+      'invoicing' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'invoicing',
@@ -233,8 +233,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'acl_financial_type' => array(
+      ],
+      'acl_financial_type' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'acl_financial_type',
@@ -248,8 +248,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'deferred_revenue_enabled' => array(
+      ],
+      'deferred_revenue_enabled' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'deferred_revenue_enabled',
@@ -263,17 +263,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'default_invoice_page' => array(
+      ],
+      'default_invoice_page' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'default_invoice_page',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'default' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'name' => 'contributionPage',
-        ),
+        ],
         'html_type' => 'select',
         'add' => '4.7',
         'title' => 'Default invoice payment page',
@@ -281,8 +281,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'always_post_to_accounts_receivable' => array(
+      ],
+      'always_post_to_accounts_receivable' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'always_post_to_accounts_receivable',
@@ -296,8 +296,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'update_contribution_on_membership_type_change' => array(
+      ],
+      'update_contribution_on_membership_type_change' => [
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
         'name' => 'update_contribution_on_membership_type_change',
@@ -311,16 +311,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Enabling this setting will update related contribution of membership(s) except if the membership is paid for with a recurring contribution.',
         'help_text' => '',
-      ),
-      'contact_view_options' => array(
+      ],
+      'contact_view_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_view_options',
         'type' => 'String',
         'html_type' => 'checkboxes',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'contact_view_options',
-        ),
+        ],
         'default' => '\ 11\ 12\ 13\ 14\ 15\ 16\ 17\ 18\ 19\ 110\ 111\ 113\ 1',
         'add' => '4.1',
         'title' => 'Viewing Contacts',
@@ -328,16 +328,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'contact_edit_options' => array(
+      ],
+      'contact_edit_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_edit_options',
         'type' => 'String',
         'html_type' => 'checkboxes',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'contact_edit_options',
-        ),
+        ],
         'default' => '\ 11\ 12\ 13\ 14\ 15\ 16\ 17\ 18\ 19\ 111\ 112\ 114\ 115\ 116\ 117\ 1',
         'add' => '4.1',
         'title' => 'Editing Contacts',
@@ -345,15 +345,15 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'advanced_search_options' => array(
+      ],
+      'advanced_search_options' => [
         'group_name' => 'CiviCRM Preferences',
         'name' => 'advanced_search_options',
         'type' => 'String',
         'html_type' => 'checkboxes',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'advanced_search_options',
-        ),
+        ],
         'default' => '\ 11\ 12\ 13\ 14\ 15\ 16\ 17\ 18\ 19\ 110\ 111\ 112\ 113\ 115\ 116\ 117\ 118\ 119\ 1',
         'add' => '4.1',
         'title' => 'Contact Search',
@@ -361,16 +361,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'user_dashboard_options' => array(
+      ],
+      'user_dashboard_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'user_dashboard_options',
         'type' => 'String',
         'html_type' => 'checkboxes',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'user_dashboard_options',
-        ),
+        ],
         'default' => '\ 11\ 12\ 13\ 14\ 15\ 17\ 18\ 1',
         'add' => '4.1',
         'title' => 'Contact Dashboard',
@@ -378,16 +378,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'address_options' => array(
+      ],
+      'address_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'address_options',
         'type' => 'String',
         'html_type' => 'Text',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'optionGroupName' => 'address_options',
-        ),
+        ],
         'default' => '\ 11\ 12\ 13\ 14\ 15\ 16\ 18\ 19\ 110\ 111\ 1',
         'add' => '4.1',
         'title' => 'Addressing Options',
@@ -395,8 +395,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'address_format' => array(
+      ],
+      'address_format' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'address_format',
@@ -415,8 +415,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'mailing_format' => array(
+      ],
+      'mailing_format' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'mailing_format',
@@ -435,8 +435,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'display_name_format' => array(
+      ],
+      'display_name_format' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'display_name_format',
@@ -449,8 +449,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'sort_name_format' => array(
+      ],
+      'sort_name_format' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'sort_name_format',
@@ -463,8 +463,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'remote_profile_submissions' => array(
+      ],
+      'remote_profile_submissions' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'remote_profile_submissions',
@@ -478,8 +478,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, CiviCRM will permit submissions from external sites to profiles. This is disabled by default to limit abuse.',
         'help_text' => '',
-      ),
-      'allow_alert_autodismissal' => array(
+      ],
+      'allow_alert_autodismissal' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'allow_alert_autodismissal',
@@ -493,8 +493,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If disabled, alert messages in CiviCRM will never be automatically dismissed after 10 seconds.',
         'help_text' => '',
-      ),
-      'editor_id' => array(
+      ],
+      'editor_id' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'editor_id',
@@ -507,8 +507,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'contact_ajax_check_similar' => array(
+      ],
+      'contact_ajax_check_similar' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_ajax_check_similar',
@@ -521,8 +521,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'ajaxPopupsEnabled' => array(
+      ],
+      'ajaxPopupsEnabled' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'ajaxPopupsEnabled',
@@ -535,8 +535,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'activity_assignee_notification' => array(
+      ],
+      'activity_assignee_notification' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'activity_assignee_notification',
@@ -549,8 +549,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'activity_assignee_notification_ics' => array(
+      ],
+      'activity_assignee_notification_ics' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'activity_assignee_notification_ics',
@@ -563,16 +563,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'contact_autocomplete_options' => array(
+      ],
+      'contact_autocomplete_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_autocomplete_options',
         'type' => 'String',
         'quick_form_type' => 'CheckBox',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Search::getContactAutocompleteOptions',
-        ),
+        ],
         'default' => '\ 11\ 12\ 1',
         'add' => '4.1',
         'title' => 'Autocomplete Contact Search',
@@ -580,16 +580,16 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Selected fields will be displayed in back-office autocomplete dropdown search results (Quick Search, etc.). Contact Name is always included.',
         'help_text' => '',
-      ),
-      'contact_reference_options' => array(
+      ],
+      'contact_reference_options' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_reference_options',
         'type' => 'String',
         'quick_form_type' => 'CheckBox',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Search::getContactReferenceOptions',
-        ),
+        ],
         'default' => '\ 11\ 12\ 1',
         'add' => '4.1',
         'title' => 'Contact Reference Options',
@@ -597,8 +597,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Selected fields will be displayed in autocomplete dropdown search results for \'Contact Reference\' custom fields. Contact Name is always included. NOTE: You must assign \'access contact reference fields\' permission to the anonymous role if you want to use custom contact reference fields in profiles on public pages. For most situations, you should use the \'Limit List to Group\' setting when configuring a contact reference field which will be used in public forms to prevent exposing your entire contact list.',
         'help_text' => '',
-      ),
-      'contact_smart_group_display' => array(
+      ],
+      'contact_smart_group_display' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_smart_group_display',
@@ -611,8 +611,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'smart_group_cache_refresh_mode' => array(
+      ],
+      'smart_group_cache_refresh_mode' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'smart_group_cache_refresh_mode',
@@ -623,13 +623,13 @@ function setting_getfields_expectedresult() {
         'title' => 'Smart Group Refresh Mode',
         'is_domain' => 1,
         'is_contact' => 0,
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Contact_BAO_GroupContactCache::getModes',
-        ),
+        ],
         'description' => 'Should the smart groups be by cron jobs or user actions',
         'help_text' => 'In \"Opportunistic Flush\" mode, caches are flushed in response to user actions; this mode is broadly compatible but may add latency during form-submissions. In \"Cron Flush\" mode, you should schedule a cron job to flush caches; this can improve latency on form-submissions but requires more setup.',
-      ),
-      'installed' => array(
+      ],
+      'installed' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
@@ -643,8 +643,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'A flag indicating whether this system has run a post-installation routine',
         'help_text' => '',
-      ),
-      'max_attachments' => array(
+      ],
+      'max_attachments' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'max_attachments',
@@ -652,10 +652,10 @@ function setting_getfields_expectedresult() {
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 3,
         'add' => '4.3',
         'title' => 'Maximum Attachments',
@@ -663,18 +663,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Maximum number of files (documents, images, etc.) which can attached to emails or activities.',
         'help_text' => '',
-      ),
-      'maxFileSize' => array(
+      ],
+      'maxFileSize' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'maxFileSize',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 3,
         'add' => '4.3',
         'title' => 'Maximum File Size (in MB)',
@@ -682,8 +682,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Maximum Size of file (documents, images, etc.) which can attached to emails or activities.<br />Note: php.ini should support this file size.',
         'help_text' => '',
-      ),
-      'contact_undelete' => array(
+      ],
+      'contact_undelete' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'contact_undelete',
@@ -696,8 +696,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, deleted contacts will be moved to trash (instead of being destroyed). Users with the proper permission are able to search for the deleted contacts and restore them (or delete permanently).',
         'help_text' => '',
-      ),
-      'allowPermDeleteFinancial' => array(
+      ],
+      'allowPermDeleteFinancial' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'allowPermDeleteFinancial',
@@ -710,8 +710,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Allow Permanent Delete for contacts who are linked to live financial transactions',
         'help_text' => '',
-      ),
-      'securityAlert' => array(
+      ],
+      'securityAlert' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'securityAlert',
@@ -724,8 +724,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, CiviCRM will display pop-up notifications (no more than once per day) for security and misconfiguration issues identified in the system check.',
         'help_text' => '',
-      ),
-      'doNotAttachPDFReceipt' => array(
+      ],
+      'doNotAttachPDFReceipt' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'doNotAttachPDFReceipt',
@@ -738,17 +738,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, CiviCRM sends PDF receipt as an attachment during event signup or online contribution.',
         'help_text' => '',
-      ),
-      'recordGeneratedLetters' => array(
+      ],
+      'recordGeneratedLetters' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recordGeneratedLetters',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
+        ],
         'default' => 'multiple',
         'add' => '4.7',
         'title' => 'Record generated letters',
@@ -756,20 +756,20 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When generating a letter (PDF/Word) via mail-merge, how should the letter be recorded?',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Contact_Form_Task_PDFLetterCommon::getLoggingOptions',
-        ),
-      ),
-      'wkhtmltopdfPath' => array(
+        ],
+      ],
+      'wkhtmltopdfPath' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'wkhtmltopdfPath',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 256,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
@@ -778,17 +778,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'recaptchaOptions' => array(
+      ],
+      'recaptchaOptions' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recaptchaOptions',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 64,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
@@ -797,17 +797,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'You can specify the reCAPTCHA theme options as comma separated data.(eg: theme:\'blackglass\', lang : \'fr\' ). Check the available options at <a href=\"https://developers.google.com/recaptcha/docs/display#config\">Customizing the Look and Feel of reCAPTCHA</a>.',
         'help_text' => '',
-      ),
-      'recaptchaPublicKey' => array(
+      ],
+      'recaptchaPublicKey' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recaptchaPublicKey',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 64,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
@@ -816,17 +816,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'recaptchaPrivateKey' => array(
+      ],
+      'recaptchaPrivateKey' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recaptchaPrivateKey',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 64,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '',
         'add' => '4.3',
@@ -835,17 +835,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'checksum_timeout' => array(
+      ],
+      'checksum_timeout' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'checksum_timeout',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 8,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => 7,
         'add' => '4.3',
@@ -854,17 +854,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'blogUrl' => array(
+      ],
+      'blogUrl' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'blogUrl',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 128,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '*default*',
         'add' => '4.3',
@@ -873,17 +873,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Blog feed URL used by the blog dashlet',
         'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
-      ),
-      'communityMessagesUrl' => array(
+      ],
+      'communityMessagesUrl' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'communityMessagesUrl',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 128,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '*default*',
         'add' => '4.3',
@@ -892,17 +892,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Service providing CiviCRM community messages',
         'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
-      ),
-      'gettingStartedUrl' => array(
+      ],
+      'gettingStartedUrl' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'gettingStartedUrl',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 128,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => '*default*',
         'add' => '4.3',
@@ -911,8 +911,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Service providing the Getting Started data',
         'help_text' => 'Use \"*default*\" for the system default or override with a custom URL',
-      ),
-      'resCacheCode' => array(
+      ],
+      'resCacheCode' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'resCacheCode',
@@ -926,8 +926,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Code appended to resource URLs (JS/CSS) to coerce HTTP caching',
         'help_text' => '',
-      ),
-      'verifySSL' => array(
+      ],
+      'verifySSL' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'verifySSL',
@@ -940,8 +940,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If disabled, outbound web-service requests will allow unverified, insecure HTTPS connections',
         'help_text' => 'Unless you are absolutely unable to configure your server to check the SSL certificate of the remote server you should leave this set to Yes',
-      ),
-      'enableSSL' => array(
+      ],
+      'enableSSL' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'enableSSL',
@@ -954,8 +954,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, inbound HTTP requests for sensitive pages will be redirected to HTTPS.',
         'help_text' => 'If enabled, inbound HTTP requests for sensitive pages will be redirected to HTTPS.',
-      ),
-      'wpBasePage' => array(
+      ],
+      'wpBasePage' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'wpBasePage',
@@ -969,8 +969,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If set, CiviCRM will use this setting as the base url.',
         'help_text' => 'By default, CiviCRM will generate front-facing pages using the home page at http://wp/ as its base. If you want to use a different template for CiviCRM pages, set the path here.',
-      ),
-      'secondDegRelPermissions' => array(
+      ],
+      'secondDegRelPermissions' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'secondDegRelPermissions',
@@ -983,8 +983,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, contacts with the permission to edit a related contact will inherit that contact\'s permission to edit other related contacts',
         'help_text' => '',
-      ),
-      'enable_components' => array(
+      ],
+      'enable_components' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
@@ -992,11 +992,11 @@ function setting_getfields_expectedresult() {
         'type' => 'Array',
         'quick_form_type' => 'Element',
         'html_type' => 'advmultiselect',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 5,
           'style' => 'width:150px',
           'class' => 'advmultiselect',
-        ),
+        ],
         'default' => '',
         'add' => '4.4',
         'title' => 'Enable Components',
@@ -1004,13 +1004,13 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-        'on_change' => array(
+        'on_change' => [
           '0' => 'CRM_Case_Info::onToggleComponents',
           '1' => 'CRM_Core_Component::flushEnabledComponents',
           '2' => 'call://resources/resetCacheCode',
-        ),
-      ),
-      'disable_core_css' => array(
+        ],
+      ],
+      'disable_core_css' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'disable_core_css',
@@ -1023,8 +1023,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Prevent the stylesheet \"civicrm.css\" from being loaded.',
         'help_text' => '',
-      ),
-      'empoweredBy' => array(
+      ],
+      'empoweredBy' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'empoweredBy',
@@ -1037,8 +1037,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When enabled, \"empowered by CiviCRM\" is displayed at the bottom of public forms.',
         'help_text' => '',
-      ),
-      'logging_no_trigger_permission' => array(
+      ],
+      'logging_no_trigger_permission' => [
         'add' => '4.7',
         'is_domain' => 1,
         'is_contact' => 0,
@@ -1052,8 +1052,8 @@ function setting_getfields_expectedresult() {
         'default' => 0,
         'title' => '(EXPERIMENTAL) MySQL user does not have trigger permissions',
         'description' => 'Set this when you intend to manage trigger creation outside of CiviCRM',
-      ),
-      'logging' => array(
+      ],
+      'logging' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1068,11 +1068,11 @@ function setting_getfields_expectedresult() {
         'title' => 'Logging',
         'description' => 'If enabled, all actions will be logged with a complete record of changes.',
         'validate_callback' => 'CRM_Logging_Schema::checkLoggingSupport',
-        'on_change' => array(
+        'on_change' => [
           '0' => 'CRM_Logging_Schema::onToggle',
-        ),
-      ),
-      'logging_uniqueid_date' => array(
+        ],
+      ],
+      'logging_uniqueid_date' => [
         'add' => '4.7',
         'help_text' => 'This is the date when CRM-18193 was implemented',
         'is_domain' => 1,
@@ -1086,8 +1086,8 @@ function setting_getfields_expectedresult() {
         'default' => '',
         'title' => 'Logging Unique ID not recorded before',
         'description' => 'This is the date when CRM-18193 was implemented',
-      ),
-      'logging_all_tables_uniquid' => array(
+      ],
+      'logging_all_tables_uniquid' => [
         'add' => '4.7',
         'help_text' => 'This indicates there are no tables holdng pre-uniqid log_conn_id values (CRM-18193)',
         'is_domain' => 1,
@@ -1101,8 +1101,8 @@ function setting_getfields_expectedresult() {
         'default' => 0,
         'title' => 'All tables use Unique Connection ID',
         'description' => 'Do some tables pre-date CRM-18193?',
-      ),
-      'userFrameworkUsersTableName' => array(
+      ],
+      'userFrameworkUsersTableName' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1113,15 +1113,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '32',
           'maxlength' => '64',
-        ),
+        ],
         'default' => '',
         'title' => 'CMS Users Table Name',
         'description' => '',
-      ),
-      'wpLoadPhp' => array(
+      ],
+      'wpLoadPhp' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'wpLoadPhp',
@@ -1135,18 +1135,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'CiviCRM will use this setting as path to bootstrap WP.',
         'help_text' => '',
-      ),
-      'secure_cache_timeout_minutes' => array(
+      ],
+      'secure_cache_timeout_minutes' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'secure_cache_timeout_minutes',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 20,
         'add' => '4.7',
         'title' => 'Secure Cache Timeout',
@@ -1154,8 +1154,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Maximum number of minutes that secure form data should linger',
         'help_text' => '',
-      ),
-      'site_id' => array(
+      ],
+      'site_id' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'site_id',
@@ -1169,18 +1169,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'recentItemsMaxCount' => array(
+      ],
+      'recentItemsMaxCount' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recentItemsMaxCount',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 3,
-        ),
+        ],
         'default' => 20,
         'add' => '4.7',
         'title' => 'Size of \"Recent Items\" stack',
@@ -1188,18 +1188,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'How many items should CiviCRM store in it\'s \"Recently viewed\" list.',
         'help_text' => '',
-      ),
-      'recentItemsProviders' => array(
+      ],
+      'recentItemsProviders' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'recentItemsProviders',
         'type' => 'Array',
         'html_type' => 'Select',
         'quick_form_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'multiple' => 1,
           'class' => 'crm-select2',
-        ),
+        ],
         'default' => '',
         'add' => '4.7',
         'title' => 'Recent Items Providers',
@@ -1207,11 +1207,11 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'What providers may save views in CiviCRM\'s \"Recently viewed\" list. If empty, all are in.',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Utils_Recent::getProviders',
-        ),
-      ),
-      'dedupe_default_limit' => array(
+        ],
+      ],
+      'dedupe_default_limit' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'dedupe_default_limit',
@@ -1225,8 +1225,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Default to only loading matches against this number of contacts',
         'help_text' => 'Deduping larger databases can crash the server. By configuring a limit other than 0 here the dedupe query will only search for matches against a limited number of contacts.',
-      ),
-      'syncCMSEmail' => array(
+      ],
+      'syncCMSEmail' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'syncCMSEmail',
@@ -1239,8 +1239,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, then CMS email id will be syncronised with CiviCRM contacts\'s primary email.',
         'help_text' => '',
-      ),
-      'preserve_activity_tab_filter' => array(
+      ],
+      'preserve_activity_tab_filter' => [
         'group_name' => 'CiviCRM Preferences',
         'group' => 'core',
         'name' => 'preserve_activity_tab_filter',
@@ -1253,15 +1253,15 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When enabled, any filter settings a user selects on the contact\'s Activity tab will be remembered as they visit other contacts',
         'help_text' => '',
-      ),
-      'assetCache' => array(
+      ],
+      'assetCache' => [
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
         'name' => 'assetCache',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(),
+        'html_attributes' => [],
         'default' => 'auto',
         'add' => '4.7',
         'title' => 'Asset Caching',
@@ -1269,11 +1269,11 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Store computed JS/CSS content in cache files? (Note: In \"Auto\" mode, the \"Debug\" setting will determine whether to activate the cache.)',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => '\Civi\Core\AssetBuilder::getCacheModes',
-        ),
-      ),
-      'userFrameworkLogging' => array(
+        ],
+      ],
+      'userFrameworkLogging' => [
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
         'name' => 'userFrameworkLogging',
@@ -1286,8 +1286,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Set this value to Yes if you want CiviCRM error/debugging messages to appear in the Drupal error logs',
         'help_text' => 'Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS\' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal\'s watchdog enabled)',
-      ),
-      'debug_enabled' => array(
+      ],
+      'debug_enabled' => [
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
         'name' => 'debug_enabled',
@@ -1301,8 +1301,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Set this value to Yes if you want to use one of CiviCRM\'s debugging tools. This feature should NOT be enabled for production sites',
         'help_text' => 'Do not turn this on on production sites',
-      ),
-      'backtrace' => array(
+      ],
+      'backtrace' => [
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
         'name' => 'backtrace',
@@ -1314,8 +1314,8 @@ function setting_getfields_expectedresult() {
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => 'Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites',
-      ),
-      'fatalErrorHandler' => array(
+      ],
+      'fatalErrorHandler' => [
         'group_name' => 'Developer Preferences',
         'group' => 'developer',
         'name' => 'fatalErrorHandler',
@@ -1328,8 +1328,8 @@ function setting_getfields_expectedresult() {
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => 'Enter the path and class for a custom PHP error-handling function if you want to override built-in CiviCRM error handling for your site.',
-      ),
-      'uploadDir' => array(
+      ],
+      'uploadDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1344,8 +1344,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => 'File system path where temporary CiviCRM files - such as import data files - are uploaded.',
-      ),
-      'imageUploadDir' => array(
+      ],
+      'imageUploadDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1360,8 +1360,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'File system path where image files are uploaded. Currently, this path is used for images associated with premiums (CiviContribute thank-you gifts).',
         'help_text' => '',
-      ),
-      'customFileUploadDir' => array(
+      ],
+      'customFileUploadDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1376,8 +1376,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Path where documents and images which are attachments to contact records are stored (e.g. contact photos, resumes, contracts, etc.). These attachments are defined using \'file\' type custom fields.',
         'help_text' => '',
-      ),
-      'customTemplateDir' => array(
+      ],
+      'customTemplateDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1392,8 +1392,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Path where site specific templates are stored if any. This directory is searched first if set. Custom JavaScript code can be added to templates by creating files named templateFile.extra.tpl. (learn more...)',
         'help_text' => '',
-      ),
-      'customPHPPathDir' => array(
+      ],
+      'customPHPPathDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1408,8 +1408,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Path where site specific PHP code files are stored if any. This directory is searched first if set.',
         'help_text' => '',
-      ),
-      'extensionsDir' => array(
+      ],
+      'extensionsDir' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group_name' => 'Directory Preferences',
         'group' => 'directory',
@@ -1424,8 +1424,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Path where CiviCRM extensions are stored.',
         'help_text' => '',
-      ),
-      'enable_cart' => array(
+      ],
+      'enable_cart' => [
         'name' => 'enable_cart',
         'group_name' => 'Event Preferences',
         'group' => 'event',
@@ -1438,8 +1438,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'WRITE ME',
         'help_text' => 'WRITE ME',
-      ),
-      'show_events' => array(
+      ],
+      'show_events' => [
         'name' => 'show_events',
         'group_name' => 'Event Preferences',
         'group' => 'event',
@@ -1453,17 +1453,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Configure how many events should be shown on the dashboard. This overrides the default value of 10 entries.',
         'help_text' => '',
-      ),
-      'ext_repo_url' => array(
+      ],
+      'ext_repo_url' => [
         'group_name' => 'Extension Preferences',
         'group' => 'ext',
         'name' => 'ext_repo_url',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 128,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => 'https://civicrm.org/extdir/ver={ver}|cms={uf}',
         'add' => '4.3',
@@ -1472,8 +1472,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'customTranslateFunction' => array(
+      ],
+      'customTranslateFunction' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1484,24 +1484,24 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '30',
           'maxlength' => '100',
-        ),
+        ],
         'default' => '',
         'title' => 'Custom Translate Function',
         'description' => '',
-      ),
-      'monetaryThousandSeparator' => array(
+      ],
+      'monetaryThousandSeparator' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'monetaryThousandSeparator',
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
-        ),
+        ],
         'default' => ',',
         'add' => '4.3',
         'title' => 'Thousands Separator',
@@ -1509,17 +1509,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'monetaryDecimalPoint' => array(
+      ],
+      'monetaryDecimalPoint' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'monetaryDecimalPoint',
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
-        ),
+        ],
         'default' => '.',
         'add' => '4.3',
         'title' => 'Decimal Delimiter',
@@ -1527,8 +1527,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'moneyformat' => array(
+      ],
+      'moneyformat' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'moneyformat',
@@ -1542,8 +1542,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'moneyvalueformat' => array(
+      ],
+      'moneyvalueformat' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'moneyvalueformat',
@@ -1557,17 +1557,17 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'defaultCurrency' => array(
+      ],
+      'defaultCurrency' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'defaultCurrency',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
+        ],
         'default' => 'USD',
         'add' => '4.3',
         'title' => 'Default Currency',
@@ -1575,21 +1575,21 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Default currency assigned to contributions and other monetary transactions.',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getCurrencySymbols',
-        ),
-        'on_change' => array(
+        ],
+        'on_change' => [
           '0' => 'CRM_Admin_Form_Setting_Localization::onChangeDefaultCurrency',
-        ),
-      ),
-      'defaultContactCountry' => array(
+        ],
+      ],
+      'defaultContactCountry' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'defaultContactCountry',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(),
+        'html_attributes' => [],
         'default' => '1228',
         'add' => '4.4',
         'title' => 'Default Country',
@@ -1597,11 +1597,11 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'This value is selected by default when adding a new contact address.',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getAvailableCountries',
-        ),
-      ),
-      'defaultContactStateProvince' => array(
+        ],
+      ],
+      'defaultContactStateProvince' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1615,54 +1615,54 @@ function setting_getfields_expectedresult() {
         'default' => '',
         'title' => 'Default State/Province',
         'description' => 'This value is selected by default when adding a new contact address.',
-      ),
-      'countryLimit' => array(
+      ],
+      'countryLimit' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'countryLimit',
         'type' => 'Array',
         'quick_form_type' => 'Element',
         'html_type' => 'advmultiselect',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 5,
           'style' => 'width:150px',
           'class' => 'advmultiselect',
-        ),
-        'default' => array(),
+        ],
+        'default' => [],
         'add' => '4.3',
         'title' => 'Available Countries',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getAvailableCountries',
-        ),
-      ),
-      'provinceLimit' => array(
+        ],
+      ],
+      'provinceLimit' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'provinceLimit',
         'type' => 'Array',
         'quick_form_type' => 'Element',
         'html_type' => 'advmultiselect',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 5,
           'style' => 'width:150px',
           'class' => 'advmultiselect',
-        ),
-        'default' => array(),
+        ],
+        'default' => [],
         'add' => '4.3',
         'title' => 'Available States and Provinces (by Country)',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getAvailableCountries',
-        ),
-      ),
-      'inheritLocale' => array(
+        ],
+      ],
+      'inheritLocale' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'inheritLocale',
@@ -1675,8 +1675,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'dateformatDatetime' => array(
+      ],
+      'dateformatDatetime' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'dateformatDatetime',
@@ -1690,8 +1690,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'dateformatFull' => array(
+      ],
+      'dateformatFull' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'dateformatFull',
@@ -1705,8 +1705,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'dateformatPartial' => array(
+      ],
+      'dateformatPartial' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'dateformatPartial',
@@ -1720,8 +1720,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'dateformatTime' => array(
+      ],
+      'dateformatTime' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1732,15 +1732,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '12',
           'maxlength' => '60',
-        ),
+        ],
         'default' => '%l:%M %P',
         'title' => 'Date Format: Time Only',
         'description' => '',
-      ),
-      'dateformatYear' => array(
+      ],
+      'dateformatYear' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1751,15 +1751,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '12',
           'maxlength' => '60',
-        ),
+        ],
         'default' => '%Y',
         'title' => 'Date Format: Year Only',
         'description' => '',
-      ),
-      'dateformatFinancialBatch' => array(
+      ],
+      'dateformatFinancialBatch' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1770,15 +1770,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '12',
           'maxlength' => '60',
-        ),
+        ],
         'default' => '%m/%d/%Y',
         'title' => 'Date Format: Financial Batch',
         'description' => '',
-      ),
-      'dateformatshortdate' => array(
+      ],
+      'dateformatshortdate' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1789,15 +1789,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '12',
           'maxlength' => '60',
-        ),
+        ],
         'default' => '%m/%d/%Y',
         'title' => 'Date Format: Short date Month Day Year',
         'description' => '',
-      ),
-      'dateInputFormat' => array(
+      ],
+      'dateInputFormat' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1808,14 +1808,14 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::getDatePluginInputFormats',
-        ),
+        ],
         'default' => 'mm/dd/yy',
         'title' => 'Date Input Format',
         'description' => '',
-      ),
-      'fieldSeparator' => array(
+      ],
+      'fieldSeparator' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1826,15 +1826,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '2',
           'maxlength' => '8',
-        ),
+        ],
         'default' => ',',
         'title' => 'Import / Export Field Separator',
         'description' => 'Global CSV separator character. Modify this setting to enable import and export of different kinds of CSV files (for example: \',\' \';\' \':\' \'|\' ).',
-      ),
-      'fiscalYearStart' => array(
+      ],
+      'fiscalYearStart' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1845,24 +1845,24 @@ function setting_getfields_expectedresult() {
         'type' => 'Array',
         'quick_form_type' => 'MonthDay',
         'html_type' => 'MonthDay',
-        'default' => array(
+        'default' => [
           'M' => 1,
           'd' => 1,
-        ),
+        ],
         'title' => 'Fiscal Year Start',
         'description' => '',
-      ),
-      'languageLimit' => array(
+      ],
+      'languageLimit' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'languageLimit',
         'type' => 'Array',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'multiple' => 1,
           'class' => 'crm-select2',
-        ),
+        ],
         'default' => '',
         'add' => '4.3',
         'title' => 'Available Languages (Multi-lingual)',
@@ -1870,20 +1870,20 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_I18n::languages',
-        ),
-      ),
-      'lcMessages' => array(
+        ],
+      ],
+      'lcMessages' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'lcMessages',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
+        ],
         'default' => 'en_US',
         'add' => '4.3',
         'title' => 'Default Language',
@@ -1891,14 +1891,14 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getDefaultLocaleOptions',
-        ),
-        'on_change' => array(
+        ],
+        'on_change' => [
           '0' => 'CRM_Admin_Form_Setting_Localization::onChangeLcMessages',
-        ),
-      ),
-      'legacyEncoding' => array(
+        ],
+      ],
+      'legacyEncoding' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1909,15 +1909,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '12',
           'maxlength' => '30',
-        ),
+        ],
         'default' => 'Windows-1252',
         'title' => 'Legacy Encoding',
         'description' => 'If import files are NOT encoded as UTF-8, specify an alternate character encoding for these files. The default of Windows-1252 will work for Excel-created .CSV files on many computers.',
-      ),
-      'timeInputFormat' => array(
+      ],
+      'timeInputFormat' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -1928,26 +1928,26 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::getTimeFormats',
-        ),
+        ],
         'default' => '1',
         'title' => 'Time Input Format',
         'description' => '',
-        'on_change' => array(
+        'on_change' => [
           '0' => 'CRM_Core_BAO_PreferencesDate::onChangeSetting',
-        ),
-      ),
-      'weekBegins' => array(
+        ],
+      ],
+      'weekBegins' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'weekBegins',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'callback' => 'CRM_Utils_Date::getFullWeekdayNames',
-        ),
+        ],
         'default' => 0,
         'add' => '4.7',
         'title' => 'Week begins on',
@@ -1955,20 +1955,20 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'contact_default_language' => array(
+      ],
+      'contact_default_language' => [
         'group_name' => 'Localization Preferences',
         'group' => 'localization',
         'name' => 'contact_default_language',
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Localization::getDefaultLanguageOptions',
-        ),
+        ],
         'default' => '*default*',
         'add' => '4.7',
         'title' => 'Default Language for contacts',
@@ -1976,8 +1976,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Default language (if any) for contact records',
         'help_text' => 'If a contact is created with no language this setting will determine the language data (if any) to save.You may or may not wish to make an assumption here about whether it matches the site language',
-      ),
-      'profile_double_optin' => array(
+      ],
+      'profile_double_optin' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'profile_double_optin',
@@ -1990,8 +1990,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
         'help_text' => '',
-      ),
-      'track_civimail_replies' => array(
+      ],
+      'track_civimail_replies' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'track_civimail_replies',
@@ -2005,8 +2005,8 @@ function setting_getfields_expectedresult() {
         'description' => 'If checked, mailings will default to tracking replies using VERP-ed Reply-To. ',
         'help_text' => '',
         'validate_callback' => 'CRM_Core_BAO_Setting::validateBoolSetting',
-      ),
-      'civimail_workflow' => array(
+      ],
+      'civimail_workflow' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'civimail_workflow',
@@ -2019,8 +2019,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
         'help_text' => '',
-      ),
-      'civimail_server_wide_lock' => array(
+      ],
+      'civimail_server_wide_lock' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'civimail_server_wide_lock',
@@ -2033,8 +2033,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'replyTo' => array(
+      ],
+      'replyTo' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'replyTo',
@@ -2047,24 +2047,24 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Allow CiviMail users to send mailings with a custom Reply-To header',
         'help_text' => '',
-      ),
-      'mailing_backend' => array(
+      ],
+      'mailing_backend' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'mailing_backend',
         'type' => 'Array',
         'html_type' => 'checkbox',
-        'default' => array(
+        'default' => [
           'outBound_option' => '3',
-        ),
+        ],
         'add' => '4.1',
         'title' => 'Mailing Backend',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'profile_add_to_group_double_optin' => array(
+      ],
+      'profile_add_to_group_double_optin' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'profile_add_to_group_double_optin',
@@ -2077,8 +2077,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'When CiviMail is enabled, users who \"subscribe\" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.',
         'help_text' => '',
-      ),
-      'disable_mandatory_tokens_check' => array(
+      ],
+      'disable_mandatory_tokens_check' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'disable_mandatory_tokens_check',
@@ -2091,8 +2091,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Don\'t check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.',
         'help_text' => '',
-      ),
-      'dedupe_email_default' => array(
+      ],
+      'dedupe_email_default' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'dedupe_email_default',
@@ -2105,8 +2105,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Set the \"dedupe e-mail\" option when sending a new mailing to \"true\" by default.',
         'help_text' => '',
-      ),
-      'hash_mailing_url' => array(
+      ],
+      'hash_mailing_url' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'hash_mailing_url',
@@ -2119,8 +2119,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID',
         'help_text' => '',
-      ),
-      'civimail_multiple_bulk_emails' => array(
+      ],
+      'civimail_multiple_bulk_emails' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'civimail_multiple_bulk_emails',
@@ -2133,8 +2133,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, CiviMail will deliver a copy of the email to each bulk email listed for the contact.',
         'help_text' => '',
-      ),
-      'include_message_id' => array(
+      ],
+      'include_message_id' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'include_message_id',
@@ -2147,18 +2147,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'mailerBatchLimit' => array(
+      ],
+      'mailerBatchLimit' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'mailerBatchLimit',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 0,
         'add' => '4.7',
         'title' => 'Mailer Batch Limit',
@@ -2166,18 +2166,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Throttle email delivery by setting the maximum number of emails sent during each CiviMail run (0 = unlimited).',
         'help_text' => '',
-      ),
-      'mailerJobSize' => array(
+      ],
+      'mailerJobSize' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'mailerJobSize',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 0,
         'add' => '4.7',
         'title' => 'Mailer Job Size',
@@ -2185,18 +2185,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If you want to utilize multi-threading enter the size you want your sub jobs to be split into. Recommended values are between 1,000 and 10,000. Use a lower value if your server has multiple cron jobs running simultaneously, but do not use values smaller than 1,000. Enter \"0\" to disable multi-threading and process mail as one single job - batch limits still apply.',
         'help_text' => '',
-      ),
-      'mailerJobsMax' => array(
+      ],
+      'mailerJobsMax' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'mailerJobsMax',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 0,
         'add' => '4.7',
         'title' => 'Mailer Cron Job Limit',
@@ -2204,18 +2204,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'The maximum number of mailer delivery jobs executing simultaneously (0 = allow as many processes to execute as started by cron)',
         'help_text' => '',
-      ),
-      'mailThrottleTime' => array(
+      ],
+      'mailThrottleTime' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'mailThrottleTime',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 0,
         'add' => '4.7',
         'title' => 'Mailer Throttle Time',
@@ -2223,18 +2223,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'The time to sleep in between each e-mail in micro seconds. Setting this above 0 allows you to control the rate at which e-mail messages are sent to the mail server, avoiding filling up the mail queue very quickly. Set to 0 to disable.',
         'help_text' => '',
-      ),
-      'verpSeparator' => array(
+      ],
+      'verpSeparator' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'verpSeparator',
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 32,
-        ),
+        ],
         'default' => '.',
         'add' => '4.7',
         'title' => 'VERP Separator',
@@ -2242,8 +2242,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Separator character used when CiviMail generates VERP (variable envelope return path) Mail-From addresses.',
         'help_text' => '',
-      ),
-      'write_activity_record' => array(
+      ],
+      'write_activity_record' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'write_activity_record',
@@ -2256,26 +2256,26 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'simple_mail_limit' => array(
+      ],
+      'simple_mail_limit' => [
         'group_name' => 'Mailing Preferences',
         'group' => 'mailing',
         'name' => 'simple_mail_limit',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 4,
           'maxlength' => 8,
-        ),
+        ],
         'default' => 50,
         'title' => 'Simple mail limit',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => 'The number of emails sendable via simple mail. Make sure you understand the implications for your spam reputation and legal requirements for bulk emails before editing. As there is some risk both to your spam reputation and the products if this is misused it is a hidden setting',
         'help_text' => 'CiviCRM forces users sending more than this number of mails to use CiviMails. CiviMails have additional precautions: not sending to contacts who do not want bulk mail, adding domain name and opt out links. You should familiarise yourself with the law relevant to you on bulk mailings if changing this setting. For the US https://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003 is a good place to start.',
-      ),
-      'geoAPIKey' => array(
+      ],
+      'geoAPIKey' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -2286,15 +2286,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '32',
           'maxlength' => '64',
-        ),
+        ],
         'default' => '',
         'title' => 'Geo Provider Key',
         'description' => 'Enter the API key or Application ID associated with your geocoding provider (not required for Yahoo).',
-      ),
-      'geoProvider' => array(
+      ],
+      'geoProvider' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -2305,17 +2305,17 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::geoProvider',
-        ),
+        ],
         'default' => '',
         'title' => 'Geocoding Provider',
         'description' => 'This can be the same or different from the mapping provider selected.',
-      ),
-      'mapAPIKey' => array(
+      ],
+      'mapAPIKey' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -2326,15 +2326,15 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => '32',
           'maxlength' => '64',
-        ),
+        ],
         'default' => '',
         'title' => 'Map Provider Key',
         'description' => 'Enter your API Key or Application ID. An API Key is required for the Google Maps API. Refer to developers.google.com for the latest information.',
-      ),
-      'mapProvider' => array(
+      ],
+      'mapProvider' => [
         'add' => '4.7',
         'help_text' => '',
         'is_domain' => 1,
@@ -2345,34 +2345,34 @@ function setting_getfields_expectedresult() {
         'type' => 'String',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Core_SelectValues::mapProvider',
-        ),
+        ],
         'default' => '',
         'title' => 'Mapping Provider',
         'description' => 'Choose the mapping provider that has the best coverage for the majority of your contact addresses.',
-      ),
-      'default_renewal_contribution_page' => array(
+      ],
+      'default_renewal_contribution_page' => [
         'group_name' => 'Member Preferences',
         'group' => 'member',
         'name' => 'default_renewal_contribution_page',
         'type' => 'Integer',
         'html_type' => 'Select',
         'default' => '',
-        'pseudoconstant' => array(
+        'pseudoconstant' => [
           'name' => 'contributionPage',
-        ),
+        ],
         'add' => '4.1',
         'title' => 'Default online membership renewal page',
         'is_domain' => 1,
         'is_contact' => 0,
         'description' => 'If you select a default online contribution page for self-service membership renewals, a \"renew\" link pointing to that page will be displayed on the Contact Dashboard for memberships which were entered offline. You will need to ensure that the membership block for the selected online contribution page includes any currently available memberships.',
         'help_text' => '',
-      ),
-      'is_enabled' => array(
+      ],
+      'is_enabled' => [
         'group_name' => 'Multi Site Preferences',
         'group' => 'multisite',
         'name' => 'is_enabled',
@@ -2384,8 +2384,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Multisite is enabled',
         'help_text' => '',
-      ),
-      'domain_group_id' => array(
+      ],
+      'domain_group_id' => [
         'group_name' => 'Multi Site Preferences',
         'group' => 'multisite',
         'name' => 'domain_group_id',
@@ -2397,8 +2397,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'event_price_set_domain_id' => array(
+      ],
+      'event_price_set_domain_id' => [
         'group_name' => 'Multi Site Preferences',
         'group' => 'multisite',
         'name' => 'event_price_set_domain_id',
@@ -2410,8 +2410,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'uniq_email_per_site' => array(
+      ],
+      'uniq_email_per_site' => [
         'group_name' => 'Multi Site Preferences',
         'group' => 'multisite',
         'name' => 'uniq_email_per_site',
@@ -2423,18 +2423,18 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'search_autocomplete_count' => array(
+      ],
+      'search_autocomplete_count' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'search_autocomplete_count',
         'type' => 'Integer',
         'quick_form_type' => 'Element',
         'html_type' => 'text',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 2,
           'maxlength' => 2,
-        ),
+        ],
         'default' => 10,
         'add' => '4.3',
         'title' => 'Autocomplete Results',
@@ -2442,8 +2442,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'The maximum number of contacts to show at a time when typing in an autocomplete field.',
         'help_text' => '',
-      ),
-      'enable_innodb_fts' => array(
+      ],
+      'enable_innodb_fts' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'enable_innodb_fts',
@@ -2456,23 +2456,23 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'Enable InnoDB full-text search optimizations. (Requires MySQL 5.6+)',
         'help_text' => '',
-        'on_change' => array(
-          '0' => array(
+        'on_change' => [
+          '0' => [
             '0' => 'CRM_Core_InnoDBIndexer',
             '1' => 'onToggleFts',
-          ),
-        ),
-      ),
-      'fts_query_mode' => array(
+          ],
+        ],
+      ],
+      'fts_query_mode' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'fts_query_mode',
         'type' => 'String',
         'quick_form_type' => 'Element',
-        'html_attributes' => array(
+        'html_attributes' => [
           'size' => 64,
           'maxlength' => 64,
-        ),
+        ],
         'html_type' => 'Text',
         'default' => 'simple',
         'add' => '4.5',
@@ -2481,8 +2481,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => '',
         'help_text' => '',
-      ),
-      'includeOrderByClause' => array(
+      ],
+      'includeOrderByClause' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'includeOrderByClause',
@@ -2495,8 +2495,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If disabled, the search results will not be ordered. This may improve response time on search results on large datasets',
         'help_text' => '',
-      ),
-      'includeWildCardInName' => array(
+      ],
+      'includeWildCardInName' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'includeWildCardInName',
@@ -2509,8 +2509,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, wildcards are automatically added to the beginning AND end of the search term when users search for contacts by Name. EXAMPLE: Searching for \'ada\' will return any contact whose name includes those letters - e.g. \'Adams, Janet\', \'Nadal, Jorge\', etc. If disabled, a wildcard is added to the end of the search term only. EXAMPLE: Searching for \'ada\' will return any contact whose last name begins with those letters - e.g. \'Adams, Janet\' but NOT \'Nadal, Jorge\'. Disabling this feature will speed up search significantly for larger databases, but users must manually enter wildcards (\'%\' or \'_\') to the beginning of the search term if they want to find all records which contain those letters. EXAMPLE: \'%ada\' will return \'Nadal, Jorge\'.',
         'help_text' => '',
-      ),
-      'includeEmailInName' => array(
+      ],
+      'includeEmailInName' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'includeEmailInName',
@@ -2523,8 +2523,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, email addresses are automatically included when users search by Name. Disabling this feature will speed up search significantly for larger databases, but users will need to use the Email search fields (from Advanced Search, Search Builder, or Profiles) to find contacts by email address.',
         'help_text' => '',
-      ),
-      'includeNickNameInName' => array(
+      ],
+      'includeNickNameInName' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'includeNickNameInName',
@@ -2537,8 +2537,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, nicknames are automatically included when users search by Name.',
         'help_text' => '',
-      ),
-      'includeAlphabeticalPager' => array(
+      ],
+      'includeAlphabeticalPager' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'includeAlphabeticalPager',
@@ -2551,8 +2551,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If disabled, the alphabetical pager will not be displayed on the search screens. This will improve response time on search results on large datasets.',
         'help_text' => '',
-      ),
-      'smartGroupCacheTimeout' => array(
+      ],
+      'smartGroupCacheTimeout' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'smartGroupCacheTimeout',
@@ -2566,20 +2566,20 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'The number of minutes to cache smart group contacts. We strongly recommend that this value be greater than zero, since a value of zero means no caching at all. If your contact data changes frequently, you should set this value to at least 5 minutes.',
         'help_text' => '',
-      ),
-      'defaultSearchProfileID' => array(
+      ],
+      'defaultSearchProfileID' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'defaultSearchProfileID',
         'type' => 'Integer',
         'quick_form_type' => 'Select',
         'html_type' => 'Select',
-        'html_attributes' => array(
+        'html_attributes' => [
           'class' => 'crm-select2',
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'callback' => 'CRM_Admin_Form_Setting_Search::getAvailableProfiles',
-        ),
+        ],
         'default' => '',
         'add' => '4.6',
         'title' => 'Default Contact Search Profile',
@@ -2587,8 +2587,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If set, this will be the default profile used for contact search.',
         'help_text' => '',
-      ),
-      'searchPrimaryDetailsOnly' => array(
+      ],
+      'searchPrimaryDetailsOnly' => [
         'group_name' => 'Search Preferences',
         'group' => 'Search Preferences',
         'name' => 'searchPrimaryDetailsOnly',
@@ -2601,8 +2601,8 @@ function setting_getfields_expectedresult() {
         'is_contact' => 0,
         'description' => 'If enabled, only primary details (eg contact\'s primary email, phone, etc) will be included in Basic and Advanced Search results. Disabling this feature will allow users to match contacts using any email, phone etc detail.',
         'help_text' => '',
-      ),
-      'userFrameworkResourceURL' => array(
+      ],
+      'userFrameworkResourceURL' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group' => 'url',
         'group_name' => 'URL Preferences',
@@ -2618,8 +2618,8 @@ function setting_getfields_expectedresult() {
         'description' => 'Absolute URL of the location where the civicrm module or component has been installed.',
         'help_text' => '',
         'validate_callback' => 'CRM_Utils_Rule::urlish',
-      ),
-      'imageUploadURL' => array(
+      ],
+      'imageUploadURL' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group' => 'url',
         'group_name' => 'URL Preferences',
@@ -2635,8 +2635,8 @@ function setting_getfields_expectedresult() {
         'description' => 'URL of the location for uploaded image files.',
         'help_text' => '',
         'validate_callback' => 'CRM_Utils_Rule::urlish',
-      ),
-      'customCSSURL' => array(
+      ],
+      'customCSSURL' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group' => 'url',
         'group_name' => 'URL Preferences',
@@ -2652,8 +2652,8 @@ function setting_getfields_expectedresult() {
         'description' => 'You can modify the look and feel of CiviCRM by adding your own stylesheet. For small to medium sized modifications, use your css file to override some of the styles in civicrm.css. Or if you need to make drastic changes, you can choose to disable civicrm.css completely.',
         'help_text' => '',
         'validate_callback' => 'CRM_Utils_Rule::urlish',
-      ),
-      'extensionsURL' => array(
+      ],
+      'extensionsURL' => [
         'bootstrap_comment' => 'This is a boot setting which may be loaded during bootstrap. Defaults are loaded via SettingsBag::getSystemDefaults().',
         'group' => 'url',
         'group_name' => 'URL Preferences',
@@ -2669,9 +2669,9 @@ function setting_getfields_expectedresult() {
         'description' => 'Base URL for extension resources (images, stylesheets, etc). This should match extensionsDir.',
         'help_text' => '',
         'validate_callback' => 'CRM_Utils_Rule::urlish',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 3b465448174d8bd9cc79610a92d880534e6c6443..de514afdc27f6bda70f3fcfbcb52dfb123df0e01 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function setting_get_example() {
-  $params = array(
+  $params = [
     'return' => 'uniq_email_per_site',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'get', $params);
@@ -20,12 +20,12 @@ function setting_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,17 +39,17 @@ function setting_get_example() {
  */
 function setting_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ef6db54e00254e97ee5ee87f84b604f205e5dd8f..9de1adaef0f5859f7957ac5892c44ad98dbd530f 100644 (file)
@@ -8,15 +8,15 @@
  *   API result array
  */
 function setting_get_example() {
-  $params = array(
-    'domain_id' => array(
+  $params = [
+    'domain_id' => [
       '0' => 1,
       '1' => 2,
-    ),
-    'return' => array(
+    ],
+    'return' => [
       '0' => 'uniq_email_per_site',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'get', $params);
@@ -26,12 +26,12 @@ function setting_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -45,19 +45,19 @@ function setting_get_example() {
  */
 function setting_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 2,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'uniq_email_per_site' => 0,
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'uniq_email_per_site' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 10991cc435bb1d8fb872dd673e90a1251e32c90a..a5534bcac960f65713222109b3d557f678bbe8be 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function setting_getvalue_example() {
-  $params = array(
+  $params = [
     'name' => 'petition_contacts',
     'group' => 'Campaign Preferences',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'getvalue', $params);
@@ -21,12 +21,12 @@ function setting_getvalue_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
index 413da3e4ec28604604694abc706fb20dfdefd806..de5aa88ffa35363c4bd3e1f6989d5ed4317e4974 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function setting_revert_example() {
-  $params = array(
+  $params = [
     'name' => 'address_format',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Setting', 'revert', $params);
@@ -20,12 +20,12 @@ function setting_revert_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,18 +39,18 @@ function setting_revert_example() {
  */
 function setting_revert_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 5,
     'id' => 1,
-    'values' => array(
+    'values' => [
       'is_error' => 0,
       'version' => 3,
       'count' => 1,
       'id' => 1,
-      'values' => array(
-        '1' => array(
+      'values' => [
+        '1' => [
           'address_format' => '{contact.address_name}
 {contact.street_address}
 {contact.supplemental_address_1}
@@ -58,10 +58,10 @@ function setting_revert_expectedresult() {
 {contact.supplemental_address_3}
 {contact.city}{, }{contact.state_province}{ }{contact.postal_code}
 {contact.country}',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index d8e8e56d0c43ecbe3b61c10cf56948c0ff0f2aa8..f84cd70bf28a4bacf6e60ba9bc5f845784bbf2a7 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function state_province_create_example() {
-  $params = array(
+  $params = [
     'name' => 'Wessex',
     'abbreviation' => 'WEX',
     'country_id' => 1226,
-  );
+  ];
 
   try{
     $result = civicrm_api3('StateProvince', 'create', $params);
@@ -20,12 +20,12 @@ function state_province_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function state_province_create_example() {
  */
 function state_province_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 13947,
-    'values' => array(
-      '13947' => array(
+    'values' => [
+      '13947' => [
         'id' => '13947',
         'name' => 'Wessex',
         'abbreviation' => 'WEX',
         'country_id' => '1226',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 6d3d142420326659764cc1a3bad7fb2dcfc4469f..38863c43c8c4a4cbc9b71ad385f27bea88cb5df6 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function state_province_delete_example() {
-  $params = array(
+  $params = [
     'id' => 13948,
-  );
+  ];
 
   try{
     $result = civicrm_api3('StateProvince', 'delete', $params);
@@ -18,12 +18,12 @@ function state_province_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function state_province_delete_example() {
  */
 function state_province_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index c4f1ace0fb38afca00cb49b1e62932454da6ae18..7cdf17e9cabdb5437c0a76c93fab52c578ec8f34 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function state_province_get_example() {
-  $params = array(
+  $params = [
     'name' => 'Wessex',
-  );
+  ];
 
   try{
     $result = civicrm_api3('StateProvince', 'get', $params);
@@ -18,12 +18,12 @@ function state_province_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,20 +37,20 @@ function state_province_get_example() {
  */
 function state_province_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 13949,
-    'values' => array(
-      '13949' => array(
+    'values' => [
+      '13949' => [
         'id' => '13949',
         'name' => 'Wessex',
         'abbreviation' => 'WEX',
         'country_id' => '1226',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 01ae882c12d3f711936ded4f18f70cde3e87452b..d217d25a1572b6db09b0945546dad9fb2474a3b5 100644 (file)
@@ -6,13 +6,13 @@
  *   API result array
  */
 function status_preference_create_example() {
-  $params = array(
+  $params = [
     'name' => 'test_check',
     'domain_id' => 1,
     'hush_until' => '20151212',
     'ignore_severity' => 'cRItical',
     'check_info' => '',
-  );
+  ];
 
   try{
     $result = civicrm_api3('StatusPreference', 'create', $params);
@@ -22,12 +22,12 @@ function status_preference_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function status_preference_create_example() {
  */
 function status_preference_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'domain_id' => '1',
         'name' => 'test_check',
@@ -55,9 +55,9 @@ function status_preference_create_expectedresult() {
         'ignore_severity' => '5',
         'prefs' => '',
         'check_info' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 8c3d75f6770066bfc624a1578075c00a16aa48a0..14afaefcda88f229ea7472f388569f5eef4daeea 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function status_preference_delete_example() {
-  $params = array(
+  $params = [
     'id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('StatusPreference', 'delete', $params);
@@ -18,12 +18,12 @@ function status_preference_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function status_preference_delete_example() {
  */
 function status_preference_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index b1334a9cae359b89268ea90159777a7ed1dc8e03..8393a062f2e2423c639207986ee5082784dff9ec 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function status_preference_get_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('StatusPreference', 'get', $params);
@@ -18,12 +18,12 @@ function status_preference_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,21 +37,21 @@ function status_preference_get_example() {
  */
 function status_preference_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 3,
-    'values' => array(
-      '3' => array(
+    'values' => [
+      '3' => [
         'id' => '3',
         'domain_id' => '1',
         'name' => 'test_check',
         'hush_until' => '2015-12-12',
         'ignore_severity' => '4',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 860366008bd5dee54826408773d33e276ccd91c4..222a49d2516d38c19ef77fd65b80d2898d597bd2 100644 (file)
@@ -8,10 +8,10 @@
  *   API result array
  */
 function survey_get_example() {
-  $params = array(
+  $params = [
     'title' => 'survey title',
     'api.survey.delete' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Survey', 'get', $params);
@@ -21,12 +21,12 @@ function survey_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function survey_get_example() {
  */
 function survey_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 4,
-    'values' => array(
-      '4' => array(
+    'values' => [
+      '4' => [
         'id' => '4',
         'title' => 'survey title',
         'activity_type_id' => '30',
@@ -57,15 +57,15 @@ function survey_get_expectedresult() {
         'created_date' => '2013-07-28 08:49:19',
         'bypass_confirm' => 0,
         'is_share' => '1',
-        'api.survey.delete' => array(
+        'api.survey.delete' => [
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
           'values' => 1,
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 09a73872516cb1334f61e4ebf5b7a021b6fa8fbb..e4a4b55394b2d226e7e3728b4978d324eb9b1af8 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function survey_create_example() {
-  $params = array(
+  $params = [
     'title' => 'survey title',
     'activity_type_id' => '30',
     'max_number_of_contacts' => 12,
     'instructions' => 'Call people, ask for money',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Survey', 'create', $params);
@@ -21,12 +21,12 @@ function survey_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function survey_create_example() {
  */
 function survey_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'title' => 'survey title',
         'campaign_id' => '',
@@ -67,9 +67,9 @@ function survey_create_expectedresult() {
         'thankyou_title' => '',
         'thankyou_text' => '',
         'is_share' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 2a15ecb7be4384368ac454bad23df963be3274e9..acc86f7fa6c41fbb8871bcd9edf01f466a1a6686 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function survey_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Survey', 'delete', $params);
@@ -18,12 +18,12 @@ function survey_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function survey_delete_example() {
  */
 function survey_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index f1c14e1b4416759245ddb047407e15dd3aff580e..ca7cbdd56c88db7b41915fbec6d65f7a84b80d0e 100644 (file)
@@ -6,12 +6,12 @@
  *   API result array
  */
 function survey_get_example() {
-  $params = array(
+  $params = [
     'title' => 'survey title',
     'activity_type_id' => '30',
     'max_number_of_contacts' => 12,
     'instructions' => 'Call people, ask for money',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Survey', 'get', $params);
@@ -21,12 +21,12 @@ function survey_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -40,13 +40,13 @@ function survey_get_example() {
  */
 function survey_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'title' => 'survey title',
         'activity_type_id' => '30',
@@ -57,9 +57,9 @@ function survey_get_expectedresult() {
         'created_date' => '2013-07-28 08:49:19',
         'bypass_confirm' => 0,
         'is_share' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 93614aacf45ed2bc28235edce61e65c97754fd9b..5fc87be96a592a9ee1a7a096fd4912d3ab8e230e 100644 (file)
@@ -9,10 +9,10 @@
  *   API result array
  */
 function survey_respondant_get_example() {
-  $params = array(
+  $params = [
     'sequential' => '1',
     'survey_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('SurveyRespondant', 'get', $params);
@@ -22,12 +22,12 @@ function survey_respondant_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -41,13 +41,13 @@ function survey_respondant_get_example() {
  */
 function survey_respondant_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
-    'values' => array(),
+    'values' => [],
     'deprecated' => 'The SurveyRespondant api is not currently supported.',
-  );
+  ];
 
   return $expectedResult;
 }
index dab2f325a42a780b08ffbc2a4361d4f86cf674cc..e702ee259b137707024a2c32dcb8c92d61f5ff0b 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function system_flush_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('System', 'flush', $params);
@@ -18,12 +18,12 @@ function system_flush_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function system_flush_example() {
  */
 function system_flush_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 3add021f743f166f4ff4ad47b2f4299b781aea32..fbdc03fb9e1ae024e42aebafffb2729371411841 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function tag_create_example() {
-  $params = array(
+  $params = [
     'name' => 'Super Heros',
     'description' => 'Outside undie-wearers',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'create', $params);
@@ -19,12 +19,12 @@ function tag_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function tag_create_example() {
  */
 function tag_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 12,
-    'values' => array(
-      '12' => array(
+    'values' => [
+      '12' => [
         'id' => '12',
         'name' => 'Super Heros',
         'description' => 'Outside undie-wearers',
@@ -56,9 +56,9 @@ function tag_create_expectedresult() {
         'created_id' => '',
         'color' => '',
         'created_date' => '2013-07-28 08:49:19',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 75f072716aa16e9cc1dd61b9885f074a692bc459..cd6dd09b6a10ff49d7ea4281e79aae5f85da3b5b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function tag_delete_example() {
-  $params = array(
+  $params = [
     'id' => '17',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'delete', $params);
@@ -18,12 +18,12 @@ function tag_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function tag_delete_example() {
  */
 function tag_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index a39d5c6a8e57ac4ec11c6fbb94963d4850eaad98..4c4ac2faf0c1186c0aa128737ac82673392a5a7b 100644 (file)
@@ -6,10 +6,10 @@
  *   API result array
  */
 function tag_get_example() {
-  $params = array(
+  $params = [
     'id' => '7',
     'name' => 'New Tag3',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'get', $params);
@@ -19,12 +19,12 @@ function tag_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -38,13 +38,13 @@ function tag_get_example() {
  */
 function tag_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 7,
-    'values' => array(
-      '7' => array(
+    'values' => [
+      '7' => [
         'id' => '7',
         'name' => 'New Tag3',
         'description' => 'This is description for Our New Tag ',
@@ -53,9 +53,9 @@ function tag_get_expectedresult() {
         'is_tagset' => 0,
         'used_for' => 'civicrm_contact',
         'created_date' => '2013-07-28 08:49:19',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index c00491e909f6e7c57d99dc3feed04b7abcb69af7..8636fb926de5706f568f27908a1e4fa55952e642 100644 (file)
@@ -8,9 +8,9 @@
  *   API result array
  */
 function tag_getfields_example() {
-  $params = array(
+  $params = [
     'action' => 'create',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'getfields', $params);
@@ -20,12 +20,12 @@ function tag_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,12 +39,12 @@ function tag_getfields_example() {
  */
 function tag_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 11,
-    'values' => array(
-      'id' => array(
+    'values' => [
+      'id' => [
         'name' => 'id',
         'type' => 1,
         'title' => 'Tag ID',
@@ -53,11 +53,11 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'tag',
-        ),
-      ),
-      'name' => array(
+        ],
+      ],
+      'name' => [
         'name' => 'name',
         'type' => 2,
         'title' => 'Tag Name',
@@ -69,8 +69,8 @@ function tag_getfields_expectedresult() {
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
         'api.required' => 1,
-      ),
-      'description' => array(
+      ],
+      'description' => [
         'name' => 'description',
         'type' => 2,
         'title' => 'Description',
@@ -80,8 +80,8 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-      'parent_id' => array(
+      ],
+      'parent_id' => [
         'name' => 'parent_id',
         'type' => 1,
         'title' => 'Parent Tag',
@@ -92,8 +92,8 @@ function tag_getfields_expectedresult() {
         'bao' => 'CRM_Core_BAO_Tag',
         'FKClassName' => 'CRM_Core_DAO_Tag',
         'FKApiName' => 'Tag',
-      ),
-      'is_selectable' => array(
+      ],
+      'is_selectable' => [
         'name' => 'is_selectable',
         'type' => 16,
         'title' => 'Display Tag?',
@@ -102,24 +102,24 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-      'is_reserved' => array(
+      ],
+      'is_reserved' => [
         'name' => 'is_reserved',
         'type' => 16,
         'title' => 'Reserved',
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-      'is_tagset' => array(
+      ],
+      'is_tagset' => [
         'name' => 'is_tagset',
         'type' => 16,
         'title' => 'Tagset',
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-      'used_for' => array(
+      ],
+      'used_for' => [
         'name' => 'used_for',
         'type' => 2,
         'title' => 'Used For',
@@ -129,18 +129,18 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'maxlength' => 64,
           'size' => 30,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'tag_used_for',
           'optionEditPath' => 'civicrm/admin/options/tag_used_for',
-        ),
+        ],
         'api.default' => 'civicrm_contact',
-      ),
-      'created_id' => array(
+      ],
+      'created_id' => [
         'name' => 'created_id',
         'type' => 1,
         'title' => 'Tag Created By',
@@ -150,8 +150,8 @@ function tag_getfields_expectedresult() {
         'bao' => 'CRM_Core_BAO_Tag',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-      'color' => array(
+      ],
+      'color' => [
         'name' => 'color',
         'type' => 2,
         'title' => 'Color',
@@ -162,8 +162,8 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-      'created_date' => array(
+      ],
+      'created_date' => [
         'name' => 'created_date',
         'type' => 12,
         'title' => 'Tag Created Date',
@@ -171,9 +171,9 @@ function tag_getfields_expectedresult() {
         'table_name' => 'civicrm_tag',
         'entity' => 'Tag',
         'bao' => 'CRM_Core_BAO_Tag',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 08db458290490a953b1570e21c2ae0d21c37b00b..6c5b4b0394285a6a9062a11c6b0c06611d144f32 100644 (file)
@@ -8,12 +8,12 @@
  *   API result array
  */
 function tag_getlist_example() {
-  $params = array(
+  $params = [
     'input' => 'New Tag3',
-    'extra' => array(
+    'extra' => [
       '0' => 'used_for',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'getlist', $params);
@@ -23,12 +23,12 @@ function tag_getlist_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -42,26 +42,26 @@ function tag_getlist_example() {
  */
 function tag_getlist_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 0,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '19',
         'label' => 'New Tag3',
-        'description' => array(
+        'description' => [
           '0' => 'This is description for Our New Tag ',
-        ),
-        'extra' => array(
+        ],
+        'extra' => [
           'used_for' => 'civicrm_contact',
-        ),
-      ),
-    ),
+        ],
+      ],
+    ],
     'page_num' => 1,
     'more_results' => '',
-  );
+  ];
 
   return $expectedResult;
 }
index ae5465dce79c7a9d6ae40436f7e234702dbe25a0..b4c541ce664fa265e04990e68d07e0dfa8e58384 100644 (file)
@@ -8,13 +8,13 @@
  *   API result array
  */
 function tag_get_example() {
-  $params = array(
+  $params = [
     'id' => '8',
     'name' => 'New Tag3',
-    'return' => array(
+    'return' => [
       '0' => 'name',
-    ),
-  );
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Tag', 'get', $params);
@@ -24,12 +24,12 @@ function tag_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,18 +43,18 @@ function tag_get_example() {
  */
 function tag_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 8,
-    'values' => array(
-      '8' => array(
+    'values' => [
+      '8' => [
         'id' => '8',
         'name' => 'New Tag3',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index e3b7172661df5e7ddade2a0cca21dd2e03ecd0dd..850ab5799726cdd7e20cba64d0fbd924f46c63a4 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function tax_contribution_page_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -16,7 +16,7 @@ function tax_contribution_page_create_example() {
     'invoice_id' => 67890,
     'source' => 'SSF',
     'contribution_status_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('tax_contribution_page', 'create', $params);
@@ -26,11 +26,11 @@ function tax_contribution_page_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -44,13 +44,13 @@ function tax_contribution_page_create_example() {
  */
 function tax_contribution_page_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '1',
         'financial_type_id' => '11',
@@ -80,9 +80,9 @@ function tax_contribution_page_create_expectedresult() {
         'creditnote_id' => '',
         'tax_amount' => '20',
         'contribution_type_id' => '11',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 749a06df20929cc5248e2dae15010098e6175861..e6b6217e9d0a8ca8a15bd1f33905a02b9ae82317 100644 (file)
@@ -8,7 +8,7 @@
  *   API result array
  */
 function tax_contribution_page_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'receive_date' => '20120511',
     'total_amount' => '400',
@@ -18,27 +18,27 @@ function tax_contribution_page_create_example() {
     'source' => 'SSF',
     'contribution_status_id' => 1,
     'skipLineItem' => 1,
-    'api.line_item.create' => array(
-      '0' => array(
-        'price_field_id' => array(
+    'api.line_item.create' => [
+      '0' => [
+        'price_field_id' => [
           '0' => 3,
-        ),
+        ],
         'qty' => 1,
         'line_total' => '100',
         'unit_price' => '100',
         'financial_type_id' => 7,
-      ),
-      '1' => array(
-        'price_field_id' => array(
+      ],
+      '1' => [
+        'price_field_id' => [
           '0' => 3,
-        ),
+        ],
         'qty' => 1,
         'line_total' => '300',
         'unit_price' => '300',
         'financial_type_id' => 8,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('tax_contribution_page', 'create', $params);
@@ -48,11 +48,11 @@ function tax_contribution_page_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -66,13 +66,13 @@ function tax_contribution_page_create_example() {
  */
 function tax_contribution_page_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '1',
         'financial_type_id' => '7',
@@ -102,21 +102,21 @@ function tax_contribution_page_create_expectedresult() {
         'creditnote_id' => '',
         'tax_amount' => '35',
         'contribution_type_id' => '7',
-        'api.line_item.create' => array(
-          '0' => array(
+        'api.line_item.create' => [
+          '0' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 1,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '1',
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
                 'contribution_id' => '1',
-                'price_field_id' => array(
+                'price_field_id' => [
                   '0' => '3',
-                ),
+                ],
                 'label' => 'line item',
                 'qty' => '1',
                 'unit_price' => '100',
@@ -126,23 +126,23 @@ function tax_contribution_page_create_expectedresult() {
                 'financial_type_id' => '7',
                 'deductible_amount' => '',
                 'tax_amount' => '20',
-              ),
-            ),
-          ),
-          '1' => array(
+              ],
+            ],
+          ],
+          '1' => [
             'is_error' => 0,
             'version' => 3,
             'count' => 1,
             'id' => 2,
-            'values' => array(
-              '0' => array(
+            'values' => [
+              '0' => [
                 'id' => '2',
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
                 'contribution_id' => '1',
-                'price_field_id' => array(
+                'price_field_id' => [
                   '0' => '3',
-                ),
+                ],
                 'label' => 'line item',
                 'qty' => '1',
                 'unit_price' => '300',
@@ -152,13 +152,13 @@ function tax_contribution_page_create_expectedresult() {
                 'financial_type_id' => '8',
                 'deductible_amount' => '',
                 'tax_amount' => '15',
-              ),
-            ),
-          ),
-        ),
-      ),
-    ),
-  );
+              ],
+            ],
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1047ae0a97447c27365718b3127f0f57ebf6e476..5733ca2c5f345b359fc0a14c94b9b54f22671973 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function tax_contribution_page_delete_example() {
-  $params = array(
+  $params = [
     'id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('tax_contribution_page', 'delete', $params);
@@ -18,11 +18,11 @@ function tax_contribution_page_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -36,15 +36,15 @@ function tax_contribution_page_delete_example() {
  */
 function tax_contribution_page_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
+    'values' => [
       '1' => 1,
-    ),
-  );
+    ],
+  ];
 
   return $expectedResult;
 }
index 6710ce7375c817db8e448c22937e58ea6947b69e..7dfa389705d5ad7a159e0fe078d82777f60ff7a8 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function uf_field_create_example() {
-  $params = array(
+  $params = [
     'field_name' => 'phone',
     'field_type' => 'Contact',
     'visibility' => 'Public Pages and Listings',
@@ -17,7 +17,7 @@ function uf_field_create_example() {
     'location_type_id' => 1,
     'phone_type_id' => 1,
     'uf_group_id' => 11,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFField', 'create', $params);
@@ -27,12 +27,12 @@ function uf_field_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -46,13 +46,13 @@ function uf_field_create_example() {
  */
 function uf_field_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'uf_group_id' => '11',
         'field_name' => 'phone',
@@ -72,9 +72,9 @@ function uf_field_create_expectedresult() {
         'field_type' => 'Contact',
         'is_reserved' => '',
         'is_multi_summary' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 996cb148ee73721bfaee4292edc3155f43fc4ec4..c84edce6b069a3039aed6ce7f1621c52ee0a791b 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function uf_field_delete_example() {
-  $params = array(
+  $params = [
     'field_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFField', 'delete', $params);
@@ -18,12 +18,12 @@ function uf_field_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function uf_field_delete_example() {
  */
 function uf_field_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => TRUE,
-  );
+  ];
 
   return $expectedResult;
 }
index c6c1a6b2df4494ca0ccf4d61d52965be106a1916..91bfa7db7c9fecb3295b57df31f91773be278120 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function uf_field_get_example() {
-  $params = array();
+  $params = [];
 
   try{
     $result = civicrm_api3('UFField', 'get', $params);
@@ -16,12 +16,12 @@ function uf_field_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -35,13 +35,13 @@ function uf_field_get_example() {
  */
 function uf_field_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'uf_group_id' => '11',
         'field_name' => 'phone',
@@ -57,9 +57,9 @@ function uf_field_get_expectedresult() {
         'label' => 'Test Phone',
         'field_type' => 'Contact',
         'is_multi_summary' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 992d678986a662dc0e71ea79779e3c2efb385fd6..dd32472a619ae1110a38b6bc87c2e5419c72f038 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function uf_field_replace_example() {
-  $params = array(
+  $params = [
     'uf_group_id' => 11,
     'option.autoweight' => '',
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'field_name' => 'first_name',
         'field_type' => 'Contact',
         'visibility' => 'Public Pages and Listings',
@@ -18,8 +18,8 @@ function uf_field_replace_example() {
         'label' => 'Test First Name',
         'is_searchable' => 1,
         'is_active' => 1,
-      ),
-      '1' => array(
+      ],
+      '1' => [
         'field_name' => 'country',
         'field_type' => 'Contact',
         'visibility' => 'Public Pages and Listings',
@@ -28,8 +28,8 @@ function uf_field_replace_example() {
         'is_searchable' => 1,
         'is_active' => 1,
         'location_type_id' => 1,
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'field_name' => 'phone',
         'field_type' => 'Contact',
         'visibility' => 'Public Pages and Listings',
@@ -39,10 +39,10 @@ function uf_field_replace_example() {
         'is_active' => 1,
         'location_type_id' => 1,
         'phone_type_id' => 1,
-      ),
-    ),
+      ],
+    ],
     'check_permissions' => TRUE,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFField', 'replace', $params);
@@ -52,12 +52,12 @@ function uf_field_replace_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -71,12 +71,12 @@ function uf_field_replace_example() {
  */
 function uf_field_replace_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 3,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'uf_group_id' => '11',
         'field_name' => 'first_name',
@@ -96,8 +96,8 @@ function uf_field_replace_expectedresult() {
         'field_type' => 'Contact',
         'is_reserved' => '',
         'is_multi_summary' => '',
-      ),
-      '2' => array(
+      ],
+      '2' => [
         'id' => '2',
         'uf_group_id' => '11',
         'field_name' => 'country',
@@ -117,8 +117,8 @@ function uf_field_replace_expectedresult() {
         'field_type' => 'Contact',
         'is_reserved' => '',
         'is_multi_summary' => '',
-      ),
-      '3' => array(
+      ],
+      '3' => [
         'id' => '3',
         'uf_group_id' => '11',
         'field_name' => 'phone',
@@ -138,9 +138,9 @@ function uf_field_replace_expectedresult() {
         'field_type' => 'Contact',
         'is_reserved' => '',
         'is_multi_summary' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index ade13f1fbe2cad305c994de0139787cd521303c5..b514ca44c41b1f1b49b053c5fc6960acfc9c95ec 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function uf_group_create_example() {
-  $params = array(
+  $params = [
     'add_captcha' => 1,
     'add_contact_to_group' => 1,
     'group' => 1,
@@ -27,7 +27,7 @@ function uf_group_create_example() {
     'notify' => 'admin@example.org',
     'post_URL' => 'http://example.org/post',
     'title' => 'Test Group',
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFGroup', 'create', $params);
@@ -37,12 +37,12 @@ function uf_group_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -56,13 +56,13 @@ function uf_group_create_example() {
  */
 function uf_group_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'is_active' => 0,
         'group_type' => 'Individual,Contact',
@@ -86,9 +86,9 @@ function uf_group_create_expectedresult() {
         'created_id' => '1',
         'created_date' => '2013-07-28 08:49:19',
         'is_proximity_search' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 68855a931e51228f8d3b0c1d0c9048f52f0ad60d..58ee2e9cdbce819d18502680a52f3cf6f58cb077 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function uf_group_delete_example() {
-  $params = array(
+  $params = [
     'id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFGroup', 'delete', $params);
@@ -18,12 +18,12 @@ function uf_group_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function uf_group_delete_example() {
  */
 function uf_group_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 1ce438b38b975e5e1c152002b3dda4566cd1d83a..2843f27ca2e3ab776ffa2a76116ff7bfd96a94b8 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function uf_group_get_example() {
-  $params = array(
+  $params = [
     'id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFGroup', 'get', $params);
@@ -18,12 +18,12 @@ function uf_group_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,13 +37,13 @@ function uf_group_get_example() {
  */
 function uf_group_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'is_active' => 0,
         'group_type' => 'Individual,Contact',
@@ -66,9 +66,9 @@ function uf_group_get_expectedresult() {
         'created_id' => '1',
         'created_date' => '2013-07-28 08:49:19',
         'is_proximity_search' => 0,
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 45eb69fec1c9109fd3802bdbc47ad9e4e919ce64..386b09b76c2a1cea554a9ac2351d5ab7dba2e844 100644 (file)
@@ -6,7 +6,7 @@
  *   API result array
  */
 function uf_join_create_example() {
-  $params = array(
+  $params = [
     'module' => 'CiviCampaign',
     'entity_table' => 'civicrm_survey',
     'entity_id' => 1,
@@ -14,7 +14,7 @@ function uf_join_create_example() {
     'uf_group_id' => 11,
     'is_active' => 1,
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFJoin', 'create', $params);
@@ -24,12 +24,12 @@ function uf_join_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,13 +43,13 @@ function uf_join_create_example() {
  */
 function uf_join_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 0,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'is_active' => '1',
         'module' => 'CiviCampaign',
@@ -58,9 +58,9 @@ function uf_join_create_expectedresult() {
         'weight' => '1',
         'uf_group_id' => '11',
         'module_data' => '',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 6f38609a02de252ffc443cf6090afb436d49a1fe..129626b35457af49967c657fed48cf9d8c066965 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function uf_join_get_example() {
-  $params = array(
+  $params = [
     'entity_table' => 'civicrm_contribution_page',
     'entity_id' => 1,
     'sequential' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFJoin', 'get', $params);
@@ -20,12 +20,12 @@ function uf_join_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,13 +39,13 @@ function uf_join_get_example() {
  */
 function uf_join_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '0' => array(
+    'values' => [
+      '0' => [
         'id' => '1',
         'is_active' => '1',
         'module' => 'CiviContribute',
@@ -53,9 +53,9 @@ function uf_join_get_expectedresult() {
         'entity_id' => '1',
         'weight' => '1',
         'uf_group_id' => '11',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index dddd476237eb2ca74af5badcd4bbf4ddc858d126..1c77731cb6e0e6722c615fae48f8646a61f9f100 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function uf_match_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 69,
-  );
+  ];
 
   try{
     $result = civicrm_api3('UFMatch', 'get', $params);
@@ -18,12 +18,12 @@ function uf_match_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,20 +37,20 @@ function uf_match_get_example() {
  */
 function uf_match_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'domain_id' => '1',
         'uf_id' => '42',
         'contact_id' => '69',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1e1d4e10fa0ab892c3d2d191674e96be335f2e98..ca680c73394c2081f4c05159be0f6394ec89b407 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function website_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 3,
     'url' => 'website.com',
     'website_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Website', 'create', $params);
@@ -20,12 +20,12 @@ function website_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function website_create_example() {
  */
 function website_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '3',
         'url' => 'website.com',
         'website_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index e40f33ac4ba072cfbd83b3482a926b7bf69c2c91..2b99ad2c6b55b004203fc284b38ec04c71ac845f 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function website_delete_example() {
-  $params = array(
+  $params = [
     'id' => 3,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Website', 'delete', $params);
@@ -18,12 +18,12 @@ function website_delete_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function website_delete_example() {
  */
 function website_delete_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'values' => 1,
-  );
+  ];
 
   return $expectedResult;
 }
index 75474912271286714ce1d566a0d13bdfda1e5462..c4a8ee27abef8a5b11172d0b6162a21b8a3d2dfc 100644 (file)
@@ -6,11 +6,11 @@
  *   API result array
  */
 function website_get_example() {
-  $params = array(
+  $params = [
     'contact_id' => 4,
     'url' => 'website.com',
     'website_type_id' => 1,
-  );
+  ];
 
   try{
     $result = civicrm_api3('Website', 'get', $params);
@@ -20,12 +20,12 @@ function website_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -39,20 +39,20 @@ function website_get_example() {
  */
 function website_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 2,
-    'values' => array(
-      '2' => array(
+    'values' => [
+      '2' => [
         'id' => '2',
         'contact_id' => '4',
         'url' => 'website.com',
         'website_type_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 1f163d8dc5a409c51f6306e37e72fd392773fa4d..32abee5b590df7feeffd0298ffb468831e04d796 100644 (file)
@@ -6,9 +6,9 @@
  *   API result array
  */
 function website_getfields_example() {
-  $params = array(
+  $params = [
     'action' => 'get',
-  );
+  ];
 
   try{
     $result = civicrm_api3('Website', 'getfields', $params);
@@ -18,12 +18,12 @@ function website_getfields_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -37,12 +37,12 @@ function website_getfields_example() {
  */
 function website_getfields_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 4,
-    'values' => array(
-      'id' => array(
+    'values' => [
+      'id' => [
         'name' => 'id',
         'type' => 1,
         'title' => 'Website ID',
@@ -51,11 +51,11 @@ function website_getfields_expectedresult() {
         'table_name' => 'civicrm_website',
         'entity' => 'Website',
         'bao' => 'CRM_Core_BAO_Website',
-        'api.aliases' => array(
+        'api.aliases' => [
           '0' => 'website_id',
-        ),
-      ),
-      'contact_id' => array(
+        ],
+      ],
+      'contact_id' => [
         'name' => 'contact_id',
         'type' => 1,
         'title' => 'Contact',
@@ -65,8 +65,8 @@ function website_getfields_expectedresult() {
         'bao' => 'CRM_Core_BAO_Website',
         'FKClassName' => 'CRM_Contact_DAO_Contact',
         'FKApiName' => 'Contact',
-      ),
-      'url' => array(
+      ],
+      'url' => [
         'name' => 'url',
         'type' => 2,
         'title' => 'Website',
@@ -81,13 +81,13 @@ function website_getfields_expectedresult() {
         'table_name' => 'civicrm_website',
         'entity' => 'Website',
         'bao' => 'CRM_Core_BAO_Website',
-        'html' => array(
+        'html' => [
           'type' => 'Text',
           'maxlength' => 128,
           'size' => 30,
-        ),
-      ),
-      'website_type_id' => array(
+        ],
+      ],
+      'website_type_id' => [
         'name' => 'website_type_id',
         'type' => 1,
         'title' => 'Website Type',
@@ -95,18 +95,18 @@ function website_getfields_expectedresult() {
         'table_name' => 'civicrm_website',
         'entity' => 'Website',
         'bao' => 'CRM_Core_BAO_Website',
-        'html' => array(
+        'html' => [
           'type' => 'Select',
           'size' => 6,
           'maxlength' => 14,
-        ),
-        'pseudoconstant' => array(
+        ],
+        'pseudoconstant' => [
           'optionGroupName' => 'website_type',
           'optionEditPath' => 'civicrm/admin/options/website_type',
-        ),
-      ),
-    ),
-  );
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 24c4467ddd2a3dcdf5be2222243343d775730cfa..b77fac5a8bc2275da8493d8af10b3f229d60322e 100644 (file)
@@ -8,13 +8,13 @@
  *   API result array
  */
 function website_get_example() {
-  $params = array(
-    'options' => array(
-      'metadata' => array(
+  $params = [
+    'options' => [
+      'metadata' => [
         '0' => 'fields',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   try{
     $result = civicrm_api3('Website', 'get', $params);
@@ -24,12 +24,12 @@ function website_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'is_error' => 1,
       'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,14 +43,14 @@ function website_get_example() {
  */
 function website_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 0,
-    'values' => array(),
-    'metadata' => array(
-      'fields' => array(
-        'id' => array(
+    'values' => [],
+    'metadata' => [
+      'fields' => [
+        'id' => [
           'name' => 'id',
           'type' => '1',
           'title' => 'Website ID',
@@ -59,11 +59,11 @@ function website_get_expectedresult() {
           'table_name' => 'civicrm_website',
           'entity' => 'Website',
           'bao' => 'CRM_Core_BAO_Website',
-          'api.aliases' => array(
+          'api.aliases' => [
             '0' => 'website_id',
-          ),
-        ),
-        'contact_id' => array(
+          ],
+        ],
+        'contact_id' => [
           'name' => 'contact_id',
           'type' => '1',
           'title' => 'Contact',
@@ -73,8 +73,8 @@ function website_get_expectedresult() {
           'bao' => 'CRM_Core_BAO_Website',
           'FKClassName' => 'CRM_Contact_DAO_Contact',
           'FKApiName' => 'Contact',
-        ),
-        'url' => array(
+        ],
+        'url' => [
           'name' => 'url',
           'type' => '2',
           'title' => 'Website',
@@ -89,13 +89,13 @@ function website_get_expectedresult() {
           'table_name' => 'civicrm_website',
           'entity' => 'Website',
           'bao' => 'CRM_Core_BAO_Website',
-          'html' => array(
+          'html' => [
             'type' => 'Text',
             'maxlength' => '128',
             'size' => '30',
-          ),
-        ),
-        'website_type_id' => array(
+          ],
+        ],
+        'website_type_id' => [
           'name' => 'website_type_id',
           'type' => '1',
           'title' => 'Website Type',
@@ -103,19 +103,19 @@ function website_get_expectedresult() {
           'table_name' => 'civicrm_website',
           'entity' => 'Website',
           'bao' => 'CRM_Core_BAO_Website',
-          'html' => array(
+          'html' => [
             'type' => 'Select',
             'size' => '6',
             'maxlength' => '14',
-          ),
-          'pseudoconstant' => array(
+          ],
+          'pseudoconstant' => [
             'optionGroupName' => 'website_type',
             'optionEditPath' => 'civicrm/admin/options/website_type',
-          ),
-        ),
-      ),
-    ),
-  );
+          ],
+        ],
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
index 52ffaedd011576bc63c477ecc822120442caa339..b13b31aa9dccb30575e3091060eff43c9c07c98a 100644 (file)
@@ -50,8 +50,8 @@ function _civicrm_api3_initialize() {
  * @param array $keyoptions
  *   List of required fields options. One of the options is required.
  */
-function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions = array()) {
-  $keys = array(array());
+function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions = []) {
+  $keys = [[]];
   foreach ($keyoptions as $key) {
     $keys[0][] = $key;
   }
@@ -71,11 +71,11 @@ function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions
  *
  * @throws \API_Exception
  */
-function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array(), $verifyDAO = TRUE) {
-  $unmatched = array();
+function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = [], $verifyDAO = TRUE) {
+  $unmatched = [];
 
   if (!empty($params['id'])) {
-    $keys = array('version');
+    $keys = ['version'];
   }
   else {
     if (!in_array('version', $keys)) {
@@ -86,7 +86,7 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array()
   foreach ($keys as $key) {
     if (is_array($key)) {
       $match = 0;
-      $optionset = array();
+      $optionset = [];
       foreach ($key as $subkey) {
         if (!array_key_exists($subkey, $params) || empty($params[$subkey])) {
           $optionset[] = $subkey;
@@ -109,7 +109,7 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array()
     }
   }
   if (!empty($unmatched)) {
-    throw new API_Exception("Mandatory key(s) missing from params array: " . implode(", ", $unmatched), "mandatory_missing", array("fields" => $unmatched));
+    throw new API_Exception("Mandatory key(s) missing from params array: " . implode(", ", $unmatched), "mandatory_missing", ["fields" => $unmatched]);
   }
 }
 
@@ -121,7 +121,7 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array()
  *
  * @return array
  */
-function civicrm_api3_create_error($msg, $data = array()) {
+function civicrm_api3_create_error($msg, $data = []) {
   $data['is_error'] = 1;
   $data['error_message'] = $msg;
 
@@ -157,8 +157,8 @@ function civicrm_api3_create_error($msg, $data = array()) {
  *
  * @return array
  */
-function civicrm_api3_create_success($values = 1, $params = array(), $entity = NULL, $action = NULL, &$dao = NULL, $extraReturnValues = array()) {
-  $result = array();
+function civicrm_api3_create_success($values = 1, $params = [], $entity = NULL, $action = NULL, &$dao = NULL, $extraReturnValues = []) {
+  $result = [];
   $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity);
   // TODO: This shouldn't be necessary but this fn sometimes gets called with lowercase entity
   $entity = _civicrm_api_get_camel_name($entity);
@@ -182,21 +182,21 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
 
   if (is_array($params) && !empty($params['debug'])) {
     if (is_string($action) && $action != 'getfields') {
-      $apiFields = civicrm_api($entity, 'getfields', array('version' => 3, 'action' => $action) + $params);
+      $apiFields = civicrm_api($entity, 'getfields', ['version' => 3, 'action' => $action] + $params);
     }
     elseif ($action != 'getfields') {
-      $apiFields = civicrm_api($entity, 'getfields', array('version' => 3) + $params);
+      $apiFields = civicrm_api($entity, 'getfields', ['version' => 3] + $params);
     }
     else {
       $apiFields = FALSE;
     }
 
-    $allFields = array();
+    $allFields = [];
     if ($action != 'getfields' && is_array($apiFields) && is_array(CRM_Utils_Array::value('values', $apiFields))) {
       $allFields = array_keys($apiFields['values']);
     }
     $paramFields = array_keys($params);
-    $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), array(
+    $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), [
       'action',
       'entity',
       'debug',
@@ -213,7 +213,7 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
       'option_sort',
       'options',
       'prettyprint',
-      ));
+      ]);
     if ($undefined) {
       $result['undefined_fields'] = array_merge($undefined);
     }
@@ -250,9 +250,9 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
   if (!empty($params['options']['metadata'])) {
     // We've made metadata an array but only supporting 'fields' atm.
     if (in_array('fields', (array) $params['options']['metadata']) && $action !== 'getfields') {
-      $fields = civicrm_api3($entity, 'getfields', array(
+      $fields = civicrm_api3($entity, 'getfields', [
         'action' => substr($action, 0, 3) == 'get' ? 'get' : 'create',
-      ));
+      ]);
       $result['metadata']['fields'] = $fields['values'];
     }
   }
@@ -260,11 +260,11 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
   $deprecated = _civicrm_api3_deprecation_check($entity, $result);
   // Always report "setvalue" action as deprecated.
   if (!is_string($deprecated) && ($action == 'getactions' || $action == 'setvalue')) {
-    $deprecated = ((array) $deprecated) + array('setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.');
+    $deprecated = ((array) $deprecated) + ['setvalue' => 'The "setvalue" action is deprecated. Use "create" with an id instead.'];
   }
   // Always report "update" action as deprecated.
   if (!is_string($deprecated) && ($action == 'getactions' || $action == 'update')) {
-    $deprecated = ((array) $deprecated) + array('update' => 'The "update" action is deprecated. Use "create" with an id instead.');
+    $deprecated = ((array) $deprecated) + ['update' => 'The "update" action is deprecated. Use "create" with an id instead.'];
   }
   if ($deprecated) {
     // Metadata-level deprecations or wholesale entity deprecations.
@@ -428,7 +428,7 @@ function _civicrm_api3_separate_values(&$values) {
  * @param array $values
  */
 function _civicrm_api3_filter_fields_for_bao($entity, &$params, &$values) {
-  $fields = civicrm_api($entity, 'getfields', array('version' => 3, 'action' => 'create'));
+  $fields = civicrm_api($entity, 'getfields', ['version' => 3, 'action' => 'create']);
   $fields = $fields['values'];
   _civicrm_api3_store_values($fields, $params, $values);
 }
@@ -462,7 +462,7 @@ function _civicrm_api3_store_values(&$fields, &$params, &$values) {
  * @return array
  */
 function _civicrm_api3_field_names($fields) {
-  $result = array();
+  $result = [];
   foreach ($fields as $key => $value) {
     if (!empty($value['name'])) {
       $result[] = $value['name'];
@@ -500,7 +500,7 @@ function _civicrm_api3_field_names($fields) {
  * @return array
  * @throws API_Exception
  */
-function _civicrm_api3_get_using_query_object($entity, $params, $additional_options = array(), $getCount = NULL, $mode = 1, $defaultReturnProperties = NULL) {
+function _civicrm_api3_get_using_query_object($entity, $params, $additional_options = [], $getCount = NULL, $mode = 1, $defaultReturnProperties = NULL) {
   $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity);
   // Convert id to e.g. contact_id
   if (empty($params[$lowercase_entity . '_id']) && isset($params['id'])) {
@@ -511,22 +511,22 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti
   $options = _civicrm_api3_get_options_from_params($params, TRUE);
 
   $inputParams = array_merge(
-    CRM_Utils_Array::value('input_params', $options, array()),
-    CRM_Utils_Array::value('input_params', $additional_options, array())
+    CRM_Utils_Array::value('input_params', $options, []),
+    CRM_Utils_Array::value('input_params', $additional_options, [])
   );
   $returnProperties = array_merge(
-    CRM_Utils_Array::value('return', $options, array()),
-    CRM_Utils_Array::value('return', $additional_options, array())
+    CRM_Utils_Array::value('return', $options, []),
+    CRM_Utils_Array::value('return', $additional_options, [])
   );
   if (empty($returnProperties)) {
     $returnProperties = $defaultReturnProperties;
   }
   if (!empty($params['check_permissions'])) {
     // we will filter query object against getfields
-    $fields = civicrm_api($entity, 'getfields', array('version' => 3, 'action' => 'get'));
+    $fields = civicrm_api($entity, 'getfields', ['version' => 3, 'action' => 'get']);
     // we need to add this in as earlier in this function 'id' was unset in favour of $entity_id
-    $fields['values'][$lowercase_entity . '_id'] = array();
-    $varsToFilter = array('returnProperties', 'inputParams');
+    $fields['values'][$lowercase_entity . '_id'] = [];
+    $varsToFilter = ['returnProperties', 'inputParams'];
     foreach ($varsToFilter as $varToFilter) {
       if (!is_array($$varToFilter)) {
         continue;
@@ -593,7 +593,7 @@ function _civicrm_api3_get_query_object($params, $mode, $entity) {
   $sort = CRM_Utils_Array::value('sort', $options, NULL);
   $offset = CRM_Utils_Array::value('offset', $options);
   $rowCount = CRM_Utils_Array::value('limit', $options);
-  $inputParams = CRM_Utils_Array::value('input_params', $options, array());
+  $inputParams = CRM_Utils_Array::value('input_params', $options, []);
   $returnProperties = CRM_Utils_Array::value('return', $options, NULL);
   if (empty($returnProperties)) {
     $returnProperties = CRM_Contribute_BAO_Query::defaultReturnProperties($mode);
@@ -617,7 +617,7 @@ function _civicrm_api3_get_query_object($params, $mode, $entity) {
     $sql .= " LIMIT $offset, $rowCount ";
   }
   $dao = CRM_Core_DAO::executeQuery($sql);
-  return array($dao, $query);
+  return [$dao, $query];
 }
 
 /**
@@ -635,7 +635,7 @@ function _civicrm_api3_get_query_object($params, $mode, $entity) {
  * @throws API_Exception
  * @throws Exception
  */
-function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $extraSql = array()) {
+function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $extraSql = []) {
   $entity = _civicrm_api_get_entity_name_from_dao($dao);
   $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity);
   if (!empty($params[$lowercase_entity . "_id"]) && empty($params['id'])) {
@@ -666,7 +666,7 @@ function _civicrm_api3_dao_set_filter(&$dao, $params, $unique = TRUE, $extraSql
     }
   }
   if (!$fields) {
-    $fields = array();
+    $fields = [];
   }
 
   foreach ($fields as $field) {
@@ -797,7 +797,7 @@ function _civicrm_api3_get_options_from_params(&$params, $queryObject = FALSE, $
     $sort   = CRM_Utils_Array::value('sort', $params['options'], $sort);
   }
 
-  $returnProperties = array();
+  $returnProperties = [];
   // handle the format return =sort_name,display_name...
   if (array_key_exists('return', $params)) {
     if (is_array($params['return'])) {
@@ -815,14 +815,14 @@ function _civicrm_api3_get_options_from_params(&$params, $queryObject = FALSE, $
     }
   }
 
-  $options = array(
+  $options = [
     'offset' => CRM_Utils_Rule::integer($offset) ? $offset : NULL,
     'limit' => (!$is_count && CRM_Utils_Rule::integer($limit)) ? $limit : NULL,
     'is_count' => $is_count,
-    'return' => !empty($returnProperties) ? $returnProperties : array(),
-  );
+    'return' => !empty($returnProperties) ? $returnProperties : [],
+  ];
 
-  $finalSort = array();
+  $finalSort = [];
   $options['sort'] = NULL;
   if (!empty($sort)) {
     if (!is_array($sort)) {
@@ -856,12 +856,12 @@ function _civicrm_api3_get_options_from_params(&$params, $queryObject = FALSE, $
   }
   //here comes the legacy support for $returnProperties, $inputParams e.g for contat_get
   // if the query object is being used this should be used
-  $inputParams = array();
-  $legacyreturnProperties = array();
-  $otherVars = array(
+  $inputParams = [];
+  $legacyreturnProperties = [];
+  $otherVars = [
     'sort', 'offset', 'rowCount', 'options', 'return',
     'version', 'prettyprint', 'check_permissions', 'sequential',
-  );
+  ];
   foreach ($params as $n => $v) {
     if (substr($n, 0, 7) == 'return.') {
       $legacyreturnProperties[substr($n, 7)] = $v;
@@ -969,15 +969,15 @@ function _civicrm_api3_get_unique_name_array(&$bao) {
  * @return array
  */
 function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE, $entity = "", $autoFind = TRUE) {
-  $result = array();
+  $result = [];
   if (isset($params['options']) && !empty($params['options']['is_count'])) {
     return $dao->count();
   }
   if (empty($dao)) {
-    return array();
+    return [];
   }
   if ($autoFind && !$dao->find()) {
-    return array();
+    return [];
   }
 
   if (isset($dao->count)) {
@@ -986,7 +986,7 @@ function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE,
 
   $fields = array_keys(_civicrm_api3_build_fields_array($dao, FALSE));
   while ($dao->fetch()) {
-    $tmp = array();
+    $tmp = [];
     foreach ($fields as $key) {
       if (array_key_exists($key, $dao)) {
         // not sure on that one
@@ -1072,14 +1072,14 @@ function _civicrm_api3_object_to_array_unique_fields(&$dao, &$values) {
  *   ID of entity per $extends.
  */
 function _civicrm_api3_custom_format_params($params, &$values, $extends, $entityId = NULL) {
-  $values['custom'] = array();
+  $values['custom'] = [];
   $checkCheckBoxField = FALSE;
   $entity = $extends;
-  if (in_array($extends, array('Household', 'Individual', 'Organization'))) {
+  if (in_array($extends, ['Household', 'Individual', 'Organization'])) {
     $entity = 'Contact';
   }
 
-  $fields = civicrm_api($entity, 'getfields', array('version' => 3, 'action' => 'create'));
+  $fields = civicrm_api($entity, 'getfields', ['version' => 3, 'action' => 'create']);
   if (!$fields['is_error']) {
     // not sure if fields could be error - maybe change to using civicrm_api3 wrapper later - this is conservative
     $fields = $fields['values'];
@@ -1107,13 +1107,13 @@ function _civicrm_api3_custom_format_params($params, &$values, $extends, $entity
  * @param $entity
  */
 function _civicrm_api3_format_params_for_create(&$params, $entity) {
-  $nonGenericEntities = array('Contact', 'Individual', 'Household', 'Organization');
+  $nonGenericEntities = ['Contact', 'Individual', 'Household', 'Organization'];
 
   $customFieldEntities = array_diff_key(CRM_Core_SelectValues::customGroupExtends(), array_fill_keys($nonGenericEntities, 1));
   if (!array_key_exists($entity, $customFieldEntities)) {
     return;
   }
-  $values = array();
+  $values = [];
   _civicrm_api3_custom_format_params($params, $values, $entity);
   $params = array_merge($params, $values);
 }
@@ -1149,7 +1149,7 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) {
     // We can assume it's pre-formatted.
     return;
   }
-  $options = civicrm_api($entity, 'getoptions', array('field' => $customFieldLabel, 'version' => 3));
+  $options = civicrm_api($entity, 'getoptions', ['field' => $customFieldLabel, 'version' => 3]);
   if (!empty($options['is_error'])) {
     // The check is precautionary - can probably be removed later.
     return;
@@ -1239,7 +1239,7 @@ function _civicrm_api3_basic_get($bao_name, $params, $returnAsSuccess = TRUE, $e
   $query = new \Civi\API\Api3SelectQuery($entity, CRM_Utils_Array::value('check_permissions', $params, FALSE));
   $query->where = $params;
   if ($options['is_count']) {
-    $query->select = array('count_rows');
+    $query->select = ['count_rows'];
   }
   else {
     $query->select = array_keys(array_filter($options['return']));
@@ -1276,19 +1276,19 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) {
   _civicrm_api3_format_params_for_create($params, $entity);
   $args = array(&$params);
   if ($entity) {
-    $ids = array($entity => CRM_Utils_Array::value('id', $params));
+    $ids = [$entity => CRM_Utils_Array::value('id', $params)];
     $args[] = &$ids;
   }
 
   if (method_exists($bao_name, 'create')) {
     $fct = 'create';
     $fct_name = $bao_name . '::' . $fct;
-    $bao = call_user_func_array(array($bao_name, $fct), $args);
+    $bao = call_user_func_array([$bao_name, $fct], $args);
   }
   elseif (method_exists($bao_name, 'add')) {
     $fct = 'add';
     $fct_name = $bao_name . '::' . $fct;
-    $bao = call_user_func_array(array($bao_name, $fct), $args);
+    $bao = call_user_func_array([$bao_name, $fct], $args);
   }
   else {
     $fct_name = '_civicrm_api3_basic_create_fallback';
@@ -1314,7 +1314,7 @@ function _civicrm_api3_basic_create($bao_name, &$params, $entity = NULL) {
     if (isset($params['custom']) && empty(CRM_Core_BAO_CustomQuery::$extendsMap[$entity])) {
       CRM_Core_BAO_CustomValueTable::store($params['custom'], CRM_Core_DAO_AllCoreTables::getTableForClass(CRM_Core_DAO_AllCoreTables::getFullName($entity)), $bao->id);
     }
-    $values = array();
+    $values = [];
     _civicrm_api3_object_to_array($bao, $values[$bao->id]);
     return civicrm_api3_create_success($values, $params, $entity, 'create', $bao);
   }
@@ -1341,9 +1341,9 @@ function _civicrm_api3_basic_create_fallback($bao_name, &$params) {
   }
   $entityName = CRM_Core_DAO_AllCoreTables::getBriefName($dao_name);
   if (empty($entityName)) {
-    throw new API_Exception("Class \"$bao_name\" does not map to an entity name", "unmapped_class_to_entity", array(
+    throw new API_Exception("Class \"$bao_name\" does not map to an entity name", "unmapped_class_to_entity", [
       'class_name' => $bao_name,
-    ));
+    ]);
   }
   $hook = empty($params['id']) ? 'create' : 'edit';
 
@@ -1370,14 +1370,14 @@ function _civicrm_api3_basic_create_fallback($bao_name, &$params) {
  * @throws \Civi\API\Exception\UnauthorizedException
  */
 function _civicrm_api3_basic_delete($bao_name, &$params) {
-  civicrm_api3_verify_mandatory($params, NULL, array('id'));
-  _civicrm_api3_check_edit_permissions($bao_name, array('id' => $params['id']));
+  civicrm_api3_verify_mandatory($params, NULL, ['id']);
+  _civicrm_api3_check_edit_permissions($bao_name, ['id' => $params['id']]);
   $args = array(&$params['id']);
   if (method_exists($bao_name, 'del')) {
     $dao = new $bao_name();
     $dao->id = $params['id'];
     if ($dao->find()) {
-      $bao = call_user_func_array(array($bao_name, 'del'), $args);
+      $bao = call_user_func_array([$bao_name, 'del'], $args);
       if ($bao !== FALSE) {
         return civicrm_api3_create_success();
       }
@@ -1435,9 +1435,9 @@ function _civicrm_api3_custom_data_get(&$returnArray, $checkPermission, $entity,
     $checkPermission
   );
   $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1);
-  $customValues = array();
+  $customValues = [];
   CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $customValues);
-  $fieldInfo = array();
+  $fieldInfo = [];
   foreach ($groupTree as $set) {
     $fieldInfo += $set['fields'];
   }
@@ -1468,22 +1468,22 @@ function _civicrm_api3_custom_data_get(&$returnArray, $checkPermission, $entity,
  * @return array $errors
  */
 function _civicrm_api3_validate($entity, $action, $params) {
-  $errors = array();
-  $fields = civicrm_api3($entity, 'getfields', array('sequential' => 1, 'api_action' => $action));
+  $errors = [];
+  $fields = civicrm_api3($entity, 'getfields', ['sequential' => 1, 'api_action' => $action]);
   $fields = $fields['values'];
 
   // Check for required fields.
   foreach ($fields as $values) {
     if (!empty($values['api.required']) && empty($params[$values['name']])) {
-      $errors[$values['name']] = array(
+      $errors[$values['name']] = [
         'message' => "Mandatory key(s) missing from params array: " . $values['name'],
         'code' => "mandatory_missing",
-      );
+      ];
     }
   }
 
   // Select only the fields which have been input as a param.
-  $finalfields = array();
+  $finalfields = [];
   foreach ($fields as $values) {
     if (array_key_exists($values['name'], $params)) {
       $finalfields[] = $values;
@@ -1499,14 +1499,14 @@ function _civicrm_api3_validate($entity, $action, $params) {
       _civicrm_api3_validate_switch_cases($fieldName, $fieldInfo, $entity, $params);
     }
     catch (Exception $e) {
-      $errors[$fieldName] = array(
+      $errors[$fieldName] = [
         'message' => $e->getMessage(),
         'code' => 'incorrect_value',
-      );
+      ];
     }
   }
 
-  return array($errors);
+  return [$errors];
 }
 
 /**
@@ -1766,10 +1766,10 @@ function _civicrm_api3_validate_unique_key(&$params, &$fieldName) {
   if (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) {
     return;
   }
-  $existing = civicrm_api($params['entity'], 'get', array(
+  $existing = civicrm_api($params['entity'], 'get', [
       'version' => $params['version'],
       $fieldName => $fieldValue,
-    ));
+    ]);
   // an entry already exists for this unique field
   if ($existing['count'] == 1) {
     // question - could this ever be a security issue?
@@ -1814,7 +1814,7 @@ function _civicrm_api3_generic_replace($entity, $params) {
     }
 
     // Save the new/updated records
-    $creates = array();
+    $creates = [];
     foreach ($params['values'] as $replacement) {
       // Sugar: Don't force clients to duplicate the 'key' data
       $replacement = array_merge($baseParams, $replacement);
@@ -1835,10 +1835,10 @@ function _civicrm_api3_generic_replace($entity, $params) {
       array_keys($creates)
     );
     foreach ($staleIDs as $staleID) {
-      $delete = civicrm_api($entity, 'delete', array(
+      $delete = civicrm_api($entity, 'delete', [
           'version' => $params['version'],
           'id' => $staleID,
-        ));
+        ]);
       if (civicrm_error($delete)) {
         $transaction->rollback();
         return $delete;
@@ -1883,17 +1883,17 @@ function _civicrm_api3_generic_replace_base_params($params) {
  *
  * @return array
  */
-function _civicrm_api_get_fields($entity, $unique = FALSE, &$params = array()) {
-  $unsetIfEmpty = array(
+function _civicrm_api_get_fields($entity, $unique = FALSE, &$params = []) {
+  $unsetIfEmpty = [
     'dataPattern',
     'headerPattern',
     'default',
     'export',
     'import',
-  );
+  ];
   $dao = _civicrm_api3_get_DAO($entity);
   if (empty($dao)) {
-    return array();
+    return [];
   }
   $d = new $dao();
   $fields = $d->fields();
@@ -1969,7 +1969,7 @@ function _civicrm_api_get_custom_fields($entity, &$params) {
     FALSE
   );
 
-  $ret = array();
+  $ret = [];
 
   foreach ($customfields as $key => $value) {
     // Regular fields have a 'name' property
@@ -2058,7 +2058,7 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti
     if (!is_numeric($fieldValue) && is_scalar($fieldValue)) {
       $realContactId = _civicrm_api3_resolve_contactID($fieldValue);
       if ('unknown-user' === $realContactId) {
-        throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName, "type" => "integer"));
+        throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, ['error_field' => $fieldName, "type" => "integer"]);
       }
       elseif (is_numeric($realContactId)) {
         $fieldValue = $realContactId;
@@ -2069,7 +2069,7 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti
       }
     }
     if (!empty($fieldInfo['pseudoconstant']) || !empty($fieldInfo['options'])) {
-      $additional_lookup_params = array();
+      $additional_lookup_params = [];
       if (strtolower($entity) == 'address' && $fieldName == 'state_province_id' && !empty($params['country_id'])) {
         $additional_lookup_params = ['country_id' => $params['country_id']];
       }
@@ -2079,7 +2079,7 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti
     // After swapping options, ensure we have an integer(s)
     foreach ((array) ($fieldValue) as $value) {
       if ($value && !is_numeric($value) && $value !== 'null' && $value !== NULL && !is_array($value)) {
-        throw new API_Exception("$fieldName is not a valid integer", 2001, array('error_field' => $fieldName, "type" => "integer"));
+        throw new API_Exception("$fieldName is not a valid integer", 2001, ['error_field' => $fieldName, "type" => "integer"]);
       }
     }
 
@@ -2087,7 +2087,7 @@ function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $enti
     if (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength']
       ) {
       throw new API_Exception($fieldValue . " is " . strlen($fieldValue) . " characters  - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters',
-        2100, array('field' => $fieldName, "max_length" => $fieldInfo['maxlength'])
+        2100, ['field' => $fieldName, "max_length" => $fieldInfo['maxlength']]
       );
     }
   }
@@ -2147,7 +2147,7 @@ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) {
   }
   if ($fieldValue) {
     if (!CRM_Utils_Rule::xssString($fieldValue)) {
-      throw new API_Exception('Input contains illegal SCRIPT tag.', array("field" => $fieldName, "error_code" => "xss"));
+      throw new API_Exception('Input contains illegal SCRIPT tag.', ["field" => $fieldName, "error_code" => "xss"]);
     }
   }
 }
@@ -2197,7 +2197,7 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti
   // Check our field length
   elseif (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen(utf8_decode($fieldValue)) > $fieldInfo['maxlength']) {
     throw new API_Exception("Value for $fieldName is " . strlen(utf8_decode($value)) . " characters  - This field has a maxlength of {$fieldInfo['maxlength']} characters.",
-      2100, array('field' => $fieldName)
+      2100, ['field' => $fieldName]
     );
   }
 
@@ -2221,8 +2221,8 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti
  *
  * @throws \API_Exception
  */
-function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo, $op = '=', $additional_lookup_params = array()) {
-  if (in_array($op, array('>', '<', '>=', '<=', 'LIKE', 'NOT LIKE'))) {
+function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo, $op = '=', $additional_lookup_params = []) {
+  if (in_array($op, ['>', '<', '>=', '<=', 'LIKE', 'NOT LIKE'])) {
     return;
   }
 
@@ -2243,7 +2243,7 @@ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldNam
     }
     $options = civicrm_api($entity, 'getoptions', $options_lookup_params);
 
-    $options = CRM_Utils_Array::value('values', $options, array());
+    $options = CRM_Utils_Array::value('values', $options, []);
   }
 
   // If passed a value-separated string, explode to an array, then re-implode after matching values.
@@ -2307,7 +2307,7 @@ function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldN
       // CiviMagic syntax for Nulling out the field - let it through.
       return;
     }
-    throw new API_Exception("'$value' is not a valid option for field $fieldName", 2001, array('error_field' => $fieldName));
+    throw new API_Exception("'$value' is not a valid option for field $fieldName", 2001, ['error_field' => $fieldName]);
   }
   $value = $newValue;
 }
@@ -2335,10 +2335,10 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName, $action = 'create'
   if ($fieldName == _civicrm_api_get_entity_name_from_camel($entity) . '_id') {
     return 'id';
   }
-  $result = civicrm_api($entity, 'getfields', array(
+  $result = civicrm_api($entity, 'getfields', [
     'version' => 3,
     'action' => $action,
-  ));
+  ]);
   $meta = $result['values'];
   if (!isset($meta[$fieldName]['name']) && isset($meta[$fieldName . '_id'])) {
     $fieldName = $fieldName . '_id';
@@ -2350,7 +2350,7 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName, $action = 'create'
     if ($fieldName == $info['name'] || $fieldName == CRM_Utils_Array::value('uniqueName', $info)) {
       return $info['name'];
     }
-    if (array_search($fieldName, CRM_Utils_Array::value('api.aliases', $info, array())) !== FALSE) {
+    if (array_search($fieldName, CRM_Utils_Array::value('api.aliases', $info, [])) !== FALSE) {
       return $info['name'];
     }
   }
@@ -2369,7 +2369,7 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName, $action = 'create'
  *
  * @return string|array|null
  */
-function _civicrm_api3_deprecation_check($entity, $result = array()) {
+function _civicrm_api3_deprecation_check($entity, $result = []) {
   if ($entity) {
     $apiFile = "api/v3/$entity.php";
     if (CRM_Utils_File::isIncludable($apiFile)) {
@@ -2406,7 +2406,7 @@ function _civicrm_api3_field_value_check(&$params, $fieldName, $type = NULL) {
     $op = key($fieldValue);
     $fieldValue = CRM_Utils_Array::value($op, $fieldValue);
   }
-  return array($fieldValue, $op);
+  return [$fieldValue, $op];
 }
 
 /**
@@ -2433,7 +2433,7 @@ function _civicrm_api3_basic_array_get($entity, $params, $records, $idCol, $filt
   $offset = CRM_Utils_Array::value('offset', $options);
   $limit = CRM_Utils_Array::value('limit', $options);
 
-  $matches = array();
+  $matches = [];
 
   $currentOffset = 0;
   foreach ($records as $record) {
@@ -2461,7 +2461,7 @@ function _civicrm_api3_basic_array_get($entity, $params, $records, $idCol, $filt
     }
   }
 
-  $return = CRM_Utils_Array::value('return', $options, array());
+  $return = CRM_Utils_Array::value('return', $options, []);
   if (!empty($return)) {
     $return['id'] = 1;
     $matches = CRM_Utils_Array::filterColumns($matches, array_keys($return));
@@ -2479,14 +2479,14 @@ function _civicrm_api3_check_edit_permissions($bao_name, $params) {
   // For lack of something more clever, here's a whitelist of entities whos permissions
   // are inherited from a contact record.
   // Note, when adding here, also remember to modify _civicrm_api3_permissions()
-  $contactEntities = array(
+  $contactEntities = [
     'CRM_Core_BAO_Email',
     'CRM_Core_BAO_Phone',
     'CRM_Core_BAO_Address',
     'CRM_Core_BAO_IM',
     'CRM_Core_BAO_Website',
     'CRM_Core_BAO_OpenID',
-  );
+  ];
   if (!empty($params['check_permissions']) && in_array($bao_name, $contactEntities)) {
     $cid = !empty($params['contact_id']) ? $params['contact_id'] : CRM_Core_DAO::getFieldValue($bao_name, $params['id'], 'contact_id');
     if (!CRM_Contact_BAO_Contact_Permission::allow($cid, CRM_Core_Permission::EDIT)) {
@@ -2503,7 +2503,7 @@ function _civicrm_api3_check_edit_permissions($bao_name, $params) {
  * @return bool
  */
 function _civicrm_api3_compare_timestamps($modifiedDate, $id, $entity) {
-  $currentDbInfo = civicrm_api3($entity, 'getsingle', array('id' => $id));
+  $currentDbInfo = civicrm_api3($entity, 'getsingle', ['id' => $id]);
   if (strtotime($currentDbInfo['modified_date']) <= strtotime($modifiedDate)) {
     return TRUE;
   }