X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=api%2Fv3%2Fexamples%2FMailing%2FGetTokens.php;h=856e27952707b582bc06289722a1e8d4115cabc4;hb=cf8f0fff2d9b29aeeb6b511208054da760b4d544;hp=e5a7be5d2a125a0ef566f80c9fee00d2a886066f;hpb=6d6ead51f15f398a344585e6b08232d9316bd6ff;p=civicrm-core.git diff --git a/api/v3/examples/Mailing/GetTokens.php b/api/v3/examples/Mailing/GetTokens.php index e5a7be5d2a..856e279527 100644 --- a/api/v3/examples/Mailing/GetTokens.php +++ b/api/v3/examples/Mailing/GetTokens.php @@ -9,12 +9,12 @@ * API result array */ function mailing_gettokens_example() { - $params = array( - 'entity' => array( + $params = [ + 'entity' => [ '0' => 'Contact', '1' => 'Mailing', - ), - ); + ], + ]; try{ $result = civicrm_api3('Mailing', 'gettokens', $params); @@ -24,12 +24,12 @@ function mailing_gettokens_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; @@ -43,11 +43,11 @@ function mailing_gettokens_example() { */ function mailing_gettokens_expectedresult() { - $expectedResult = array( + $expectedResult = [ 'is_error' => 0, 'version' => 3, 'count' => 82, - 'values' => array( + 'values' => [ '{action.unsubscribe}' => 'Unsubscribe via email', '{action.unsubscribeUrl}' => 'Unsubscribe via web page', '{action.resubscribe}' => 'Resubscribe via email', @@ -107,6 +107,7 @@ function mailing_gettokens_expectedresult() { '{contact.street_unit}' => 'Street Unit', '{contact.supplemental_address_1}' => 'Supplemental Address 1', '{contact.supplemental_address_2}' => 'Supplemental Address 2', + '{contact.supplemental_address_3}' => 'Supplemental Address 3', '{contact.city}' => 'City', '{contact.postal_code_suffix}' => 'Postal Code Suffix', '{contact.postal_code}' => 'Postal Code', @@ -130,8 +131,8 @@ function mailing_gettokens_expectedresult() { '{contact.url}' => 'Website', '{contact.checksum}' => 'Checksum', '{contact.contact_id}' => 'Internal Contact ID', - ), - ); + ], + ]; return $expectedResult; }