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