* API result array
*/
function uf_group_create_example() {
- $params = array(
+ $params = [
'add_captcha' => 1,
'add_contact_to_group' => 1,
'group' => 1,
'notify' => 'admin@example.org',
'post_URL' => 'http://example.org/post',
'title' => 'Test Group',
- );
+ ];
try{
$result = civicrm_api3('UFGroup', 'create', $params);
$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;
*/
function uf_group_create_expectedresult() {
- $expectedResult = array(
+ $expectedResult = [
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 2,
- 'values' => array(
- '2' => array(
+ 'values' => [
+ '2' => [
'id' => '2',
'is_active' => 0,
'group_type' => 'Individual,Contact',
'created_id' => '1',
'created_date' => '2013-07-28 08:49:19',
'is_proximity_search' => '',
- ),
- ),
- );
+ ],
+ ],
+ ];
return $expectedResult;
}