Short array syntax - auto-convert api dir
[civicrm-core.git] / api / v3 / examples / ParticipantStatusType / Get.php
index 38c57c57fb17b502b7ece8f08ed6b9abc2b41bc5..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,11 +25,12 @@ function participant_status_type_get_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
-      'error' => $errorMessage,
+    return [
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -43,14 +44,14 @@ function participant_status_type_get_example() {
  */
 function participant_status_type_get_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 17,
-    'values' => array(
-      '17' => array(
-        'id' => '17',
+    'id' => 18,
+    'values' => [
+      '18' => [
+        'id' => '18',
         'name' => 'test status',
         'label' => 'I am a test',
         'class' => 'Positive',
@@ -59,9 +60,9 @@ function participant_status_type_get_expectedresult() {
         'is_counted' => '1',
         'weight' => '10',
         'visibility_id' => '1',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }