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