Short array syntax - auto-convert api dir
[civicrm-core.git] / api / v3 / examples / TaxContributionPage / Create.php
index 8b8bb96eab79b03da338ce894a35843a7eca8073..850ab5799726cdd7e20cba64d0fbd924f46c63a4 100644 (file)
@@ -1,19 +1,12 @@
 <?php
-/**
- * @file
- * Test Generated API Example.
- * See bottom of this file for more detail.
- */
-
 /**
  * Test Generated example of using tax_contribution_page create API.
  *
- *
  * @return array
  *   API result array
  */
 function tax_contribution_page_create_example() {
-  $params = array(
+  $params = [
     'contact_id' => 1,
     'receive_date' => '20120511',
     'total_amount' => '100',
@@ -23,7 +16,7 @@ function tax_contribution_page_create_example() {
     'invoice_id' => 67890,
     'source' => 'SSF',
     'contribution_status_id' => 2,
-  );
+  ];
 
   try{
     $result = civicrm_api3('tax_contribution_page', 'create', $params);
@@ -33,11 +26,11 @@ function tax_contribution_page_create_example() {
     $errorMessage = $e->getMessage();
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
-    return array(
+    return [
       'error' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
-    );
+    ];
   }
 
   return $result;
@@ -51,13 +44,13 @@ function tax_contribution_page_create_example() {
  */
 function tax_contribution_page_create_expectedresult() {
 
-  $expectedResult = array(
+  $expectedResult = [
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
     'id' => 1,
-    'values' => array(
-      '1' => array(
+    'values' => [
+      '1' => [
         'id' => '1',
         'contact_id' => '1',
         'financial_type_id' => '11',
@@ -87,9 +80,9 @@ function tax_contribution_page_create_expectedresult() {
         'creditnote_id' => '',
         'tax_amount' => '20',
         'contribution_type_id' => '11',
-      ),
-    ),
-  );
+      ],
+    ],
+  ];
 
   return $expectedResult;
 }
@@ -108,7 +101,7 @@ function tax_contribution_page_create_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