Short array syntax - auto-convert api dir
[civicrm-core.git] / api / v3 / examples / MailingGroup / Subscribe.php
index 47c7b46e7596f86182910d94e35112704220fecb..50c0a7ab9cf74c65e91d66e5c76542c62a29580c 100644 (file)
@@ -1,10 +1,4 @@
 <?php
-/**
- * @file
- * Test Generated API Example.
- * See bottom of this file for more detail.
- */
-
 /**
  * Test Generated example of using mailing_group subscribe API.
  *
  *   API result array
  */
 function mailing_group_subscribe_example() {
-  $params = array(
+  $params = [
     'email' => 'test@test.test',
     'group_id' => 2,
     'contact_id' => 3,
     'hash' => 'b15de8b64e2cec34',
     'time_stamp' => '20101212121212',
-  );
+  ];
 
   try{
     $result = civicrm_api3('mailing_group', 'subscribe', $params);
@@ -29,11 +23,11 @@ function mailing_group_subscribe_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -47,19 +41,19 @@ function mailing_group_subscribe_example() {
  */
 function mailing_group_subscribe_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'contact_id' => '3',
         'subscribe_id' => '1',
         'hash' => '67eac7789eaee00',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
@@ -78,7 +72,7 @@ function mailing_group_subscribe_expectedresult() {
 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
 *
 * Browse the api on your own site with the api explorer
-* http://MYSITE.ORG/path/to/civicrm/api/explorer
+* http://MYSITE.ORG/path/to/civicrm/api
 *
 * Read more about testing here
 * http://wiki.civicrm.org/confluence/display/CRM/Testing