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