Short array syntax - auto-convert api dir
[civicrm-core.git] / api / v3 / examples / Participant / Get.php
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;
 }