From 5396af74bae49e4c3a80cbfc637d118783904d30 Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 15 Jan 2015 10:58:14 +0530 Subject: [PATCH] cleanup fixes --- CRM/Contact/BAO/GroupContactCache.php | 28 ++++++++-------- CRM/Contact/BAO/Individual.php | 20 ++++++------ CRM/Event/BAO/Event.php | 28 ++++++++-------- CRM/Member/BAO/MembershipType.php | 22 ++++++------- CRM/Report/Form/Contribute/Repeat.php | 32 ++++++++----------- api/v3/GroupContact.php | 20 ++++++------ bin/cli.class.php | 28 ++++++++-------- .../WebTest/Report/LoggingReportTest.php | 28 ++++++++-------- tests/phpunit/api/v3/MailingTest.php | 30 ++++++++--------- 9 files changed, 115 insertions(+), 121 deletions(-) diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 71f0986172..e3917eb887 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -43,7 +43,7 @@ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCach * @param $groupIDs * Of group that we are checking against. * - * @return boolean + * @return bool * TRUE if we did not regenerate, FALSE if we did */ public static function check($groupIDs) { @@ -117,12 +117,12 @@ AND ( g.cache_date IS NULL OR * Check to see if we have cache entries for this group * if not, regenerate, else return * - * @param int /array $groupID groupID of group that we are checking against + * @param int /array $groupIDs groupIDs of group that we are checking against * if empty, all groups are checked * @param int $limit * Limits the number of groups we evaluate. * - * @return boolean + * @return bool * TRUE if we did not regenerate, FALSE if we did */ public static function loadAll($groupIDs = NULL, $limit = 0) { @@ -468,7 +468,6 @@ WHERE id = %1 CRM_Contact_BAO_ProximityQuery::fixInputParams($ssParams); } - $returnProperties = array(); if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $savedSearchID, 'mapping_id')) { $fv = CRM_Contact_BAO_SavedSearch::getFormValues($savedSearchID); @@ -481,8 +480,7 @@ WHERE id = %1 // we split it up and store custom class // so temp tables are not destroyed if they are used // hence customClass is defined above at top of function - $customClass = - CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID); + $customClass = CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID); $searchSQL = $customClass->contactIDs(); $searchSQL = str_replace('ORDER BY contact_a.id ASC', '', $searchSQL); $idName = 'contact_id'; @@ -490,8 +488,8 @@ WHERE id = %1 else { $formValues = CRM_Contact_BAO_SavedSearch::getFormValues($savedSearchID); - $query = - new CRM_Contact_BAO_Query( + $query + = new CRM_Contact_BAO_Query( $ssParams, $returnProperties, NULL, FALSE, FALSE, 1, TRUE, TRUE, @@ -501,8 +499,8 @@ WHERE id = %1 ); $query->_useDistinct = FALSE; $query->_useGroupBy = FALSE; - $searchSQL = - $query->searchQuery( + $searchSQL + = $query->searchQuery( 0, 0, NULL, FALSE, FALSE, FALSE, TRUE, @@ -615,7 +613,7 @@ AND civicrm_group_contact.group_id = $groupID "; */ public static function contactGroup($contactID, $showHidden = FALSE) { if (empty($contactID)) { - return; + return NULL; } if (is_array($contactID)) { @@ -654,12 +652,12 @@ ORDER BY gc.contact_id, g.children } $prevContactID = $dao->contact_id; if (!array_key_exists($dao->contact_id, $contactGroup)) { - $contactGroup[$dao->contact_id] = - array('group' => array(), 'groupTitle' => array()); + $contactGroup[$dao->contact_id] + = array('group' => array(), 'groupTitle' => array()); } - $contactGroup[$dao->contact_id]['group'][] = - array( + $contactGroup[$dao->contact_id]['group'][] + = array( 'id' => $dao->group_id, 'title' => $dao->title, 'description' => $dao->description, diff --git a/CRM/Contact/BAO/Individual.php b/CRM/Contact/BAO/Individual.php index aa2b0c02f1..b2750a788e 100644 --- a/CRM/Contact/BAO/Individual.php +++ b/CRM/Contact/BAO/Individual.php @@ -56,7 +56,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { */ public static function format(&$params, &$contact) { if (!self::dataExists($params)) { - return; + return NULL; } // "null" value for example is passed by dedupe merge in order to empty. @@ -274,7 +274,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { if ($date = CRM_Utils_Array::value('birth_date', $params)) { if (in_array($format, array( 'dd-mm', - 'mm/dd' + 'mm/dd', ))) { $separator = '/'; if ($format == 'dd-mm') { @@ -283,17 +283,17 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { $date = $date . $separator . '1902'; } elseif (in_array($format, array( - 'yy-mm' + 'yy-mm', ))) { $date = $date . '-01'; } elseif (in_array($format, array( - 'M yy' + 'M yy', ))) { $date = $date . '-01'; } elseif (in_array($format, array( - 'yy' + 'yy', ))) { $date = $date . '-01-01'; } @@ -306,7 +306,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { if ($date = CRM_Utils_Array::value('deceased_date', $params)) { if (in_array($format, array( 'dd-mm', - 'mm/dd' + 'mm/dd', ))) { $separator = '/'; if ($format == 'dd-mm') { @@ -315,17 +315,17 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { $date = $date . $separator . '1902'; } elseif (in_array($format, array( - 'yy-mm' + 'yy-mm', ))) { $date = $date . '-01'; } elseif (in_array($format, array( - 'M yy' + 'M yy', ))) { $date = $date . '-01'; } elseif (in_array($format, array( - 'yy' + 'yy', ))) { $date = $date . '-01-01'; } @@ -410,7 +410,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact { * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return boolean + * @return bool */ public static function dataExists(&$params) { if ($params['contact_type'] == 'Individual') { diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 64ebe160c7..5018a77144 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -260,7 +260,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event { * * @return array */ - static function getEvents( + public static function getEvents( $all = 0, $id = FALSE, $isActive = TRUE, @@ -579,13 +579,13 @@ $event_summary_limit * Get participant count * * @param int $eventId - * @param bool $considerStatusConsider status for participant count. + * @param bool $considerStatus consider status for participant count. * Consider status for participant count. - * @param bool $statusConsider counted participant. + * @param bool $status counted participant. * Consider counted participant. - * @param bool $considerRoleConsider role for participant count. + * @param bool $considerRole consider role for participant count. * Consider role for participant count. - * @param bool $roleConsider counted( is filter role) participant. + * @param bool $role consider counted( is filter role) participant. * Consider counted( is filter role) participant. * * @@ -713,19 +713,19 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL * * @param date $start * Get events with start date >= this date. - * @param int $typeGet events on the a specific event type (by event_type_id). + * @param int $type Get events on the a specific event type (by event_type_id). * Get events on the a specific event type (by event_type_id). - * @param int $eventIdReturn a single event - by event id. + * @param int $eventId Return a single event - by event id. * Return a single event - by event id. * @param date $end * Also get events with end date >= this date. - * @param bool $onlyPublicInclude public events only, default TRUE. + * @param bool $onlyPublic Include public events only, default TRUE. * Include public events only, default TRUE. * * @return array * array of all the events that are searched */ - static function &getCompleteInfo( + public static function &getCompleteInfo( $start = NULL, $type = NULL, $eventId = NULL, @@ -944,7 +944,7 @@ WHERE civicrm_event.is_active = 1 array('id' => $id), array( 'loc_block_id' => - ($locBlockId) ? $locBlockId : NULL, + ($locBlockId) ? $locBlockId : NULL, ), $fieldsFix ); @@ -1260,7 +1260,7 @@ WHERE civicrm_event.is_active = 1 * * @return void */ - static function buildCustomDisplay( + public static function buildCustomDisplay( $id, $name, $cid, @@ -1724,7 +1724,7 @@ WHERE id = $cfID * @return array * array of Additional participant's info OR array of Ids. */ - static function buildCustomProfile( + public static function buildCustomProfile( $participantId, $values, $contactId = NULL, @@ -1885,7 +1885,7 @@ WHERE ce.loc_block_id = $locBlockId"; * * @param array $values * @param int $eventID - * @return boolean + * @return bool */ public static function validRegistrationRequest($values, $eventID) { // check that the user has permission to register for this event @@ -2218,7 +2218,7 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get return CRM_Financial_BAO_FinancialType::getIncomeFinancialType(); - break; + break; } return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context); } diff --git a/CRM/Member/BAO/MembershipType.php b/CRM/Member/BAO/MembershipType.php index d03bb4b80f..b35392376b 100644 --- a/CRM/Member/BAO/MembershipType.php +++ b/CRM/Member/BAO/MembershipType.php @@ -167,7 +167,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $message .= '
' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from Find Members. If you are still getting this message after deleting these memberships, there may be contacts in the Trash (deleted) with this membership type. Try using Advanced Search and checking "Search in Trash".', array( 1 => $findMembersURL, 2 => $deleteURL, - 3 => $cnt + 3 => $cnt, )); $cnt++; } @@ -176,7 +176,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { $deleteURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1'); $message .= ts('%2. This Membership Type is used in an Online Contribution page. Uncheck this membership type in the Memberships tab.', array( 1 => $deleteURL, - 2 => $cnt + 2 => $cnt, )); throw new CRM_Core_Exception($message); } @@ -305,7 +305,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $dateParam) { if (!empty($$dateParam)) { $$dateParam = CRM_Utils_Date::processDate($$dateParam, NULL, FALSE, 'Y-m-d'); @@ -478,7 +478,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * * CRM-7297 Membership Upsell - Added $membershipTypeID param to facilitate calculations of dates when membership type changes * - * @return Array + * @return array * array fo the start date, end date and join date of the membership */ public static function getRenewalDatesForMembershipType($membershipId, $changeToday = NULL, $membershipTypeID = NULL, $numRenewTerms = 1) { @@ -585,7 +585,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { * @param int $orgID * Id of Organization. * - * @return Array + * @return array * array of the details of membership types */ public static function getMembershipTypesByOrg($orgID) { @@ -603,9 +603,9 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { /** * Retrieve all Membership Types with Member of Contact id * - * @param array membership types - * - * @return Array + * @param array $membershipTypes + * array of membership type ids + * @return array * array of the details of membership types with Member of Contact id */ public static function getMemberOfContactByMemTypes($membershipTypes) { @@ -752,12 +752,12 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType { } } - /** This function updates all price field value for quick config + /** * This function updates all price field value for quick config * price set which has membership type * - * @param integer membership type id + * @param int $membershipTypeId membership type id * - * @param integer financial type id + * @param array $params */ public static function updateAllPriceFieldValue($membershipTypeId, $params) { if (!empty($params['minimum_fee'])) { diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index 99918334d6..7d07560621 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -149,9 +149,7 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form { 'type' => CRM_Utils_Type::T_MONEY, 'default' => TRUE, 'required' => TRUE, - 'clause' => ' -contribution_civireport1.total_amount_count as contribution1_total_amount_count, -contribution_civireport1.total_amount_sum as contribution1_total_amount_sum', + 'clause' => 'contribution_civireport1.total_amount_count as contribution1_total_amount_count, contribution_civireport1.total_amount_sum as contribution1_total_amount_sum', ), 'total_amount2' => array( 'name' => 'total_amount', @@ -160,9 +158,7 @@ contribution_civireport1.total_amount_sum as contribution1_total_amount_sum', 'type' => CRM_Utils_Type::T_MONEY, 'default' => TRUE, 'required' => TRUE, - 'clause' => ' -contribution_civireport2.total_amount_count as contribution2_total_amount_count, -contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', + 'clause' => 'contribution_civireport2.total_amount_count as contribution2_total_amount_count, contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', ), ), 'grouping' => 'contri-fields', @@ -397,8 +393,8 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution public function where() { if (!$this->_amountClauseWithAND) { - $this->_amountClauseWithAND = - "!({$this->_aliases['civicrm_contribution']}1.total_amount_count IS NULL AND {$this->_aliases['civicrm_contribution']}2.total_amount_count IS NULL)"; + $this->_amountClauseWithAND + = "!({$this->_aliases['civicrm_contribution']}1.total_amount_count IS NULL AND {$this->_aliases['civicrm_contribution']}2.total_amount_count IS NULL)"; } $clauses = array("atleast_one_amount" => $this->_amountClauseWithAND); @@ -617,8 +613,8 @@ LEFT JOIN civicrm_temp_civireport_repeat2 //store contributions in array 'contact_sums' for comparison $contact_sums = array(); while ($dao->fetch()) { - $contact_sums[$dao->contact_id] = - array( + $contact_sums[$dao->contact_id] + = array( 'contribution1_total_amount_sum' => $dao->contribution1_total_amount_sum, 'contribution2_total_amount_sum' => $dao->contribution2_total_amount_sum, ); @@ -701,16 +697,16 @@ GROUP BY currency $count = $count2 = 0; while ($dao->fetch()) { if ($dao->amount) { - $amount[] = - CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . + $amount[] + = CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . $dao->count . ")"; $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency); } $count += $dao->count; if ($dao->amount2) { - $amount2[] = - CRM_Utils_Money::format($dao->amount2, $dao->currency) . "(" . + $amount2[] + = CRM_Utils_Money::format($dao->amount2, $dao->currency) . "(" . $dao->count . ")"; $average2[] = CRM_Utils_Money::format($dao->avg2, $dao->currency); } @@ -853,13 +849,13 @@ currency varchar(3) $rows[$uid]['change'] = ts('New Donor'); } if ($row['contribution1_total_amount_count']) { - $rows[$uid]['contribution1_total_amount_sum'] = - $row['contribution1_total_amount_sum'] . + $rows[$uid]['contribution1_total_amount_sum'] + = $row['contribution1_total_amount_sum'] . " ({$row['contribution1_total_amount_count']})"; } if ($row['contribution2_total_amount_count']) { - $rows[$uid]['contribution2_total_amount_sum'] = - $row['contribution2_total_amount_sum'] . + $rows[$uid]['contribution2_total_amount_sum'] + = $row['contribution2_total_amount_sum'] . " ({$row['contribution2_total_amount_count']})"; } } diff --git a/api/v3/GroupContact.php b/api/v3/GroupContact.php index e03110b172..946df5baf5 100644 --- a/api/v3/GroupContact.php +++ b/api/v3/GroupContact.php @@ -85,8 +85,8 @@ function civicrm_api3_group_contact_get($params) { * @return array * Information about operation results * - * On success, the return array will be structured as follows: - * array( + * On success, the return array will be structured as follows: + * array( * "is_error" => 0, * "version" => 3, * "count" => 3, @@ -95,15 +95,15 @@ function civicrm_api3_group_contact_get($params) { * "added" => integer, * "total_count" => integer * ) - * ) + * ) * - * On failure, the return array will be structured as follows: - * array( + * On failure, the return array will be structured as follows: + * array( * 'is_error' => 1, * 'error_message' = string, * 'error_data' = mixed or undefined - * ) - * {@getfields GroupContact_create} + * ) + * {@getfields GroupContact_create} */ function civicrm_api3_group_contact_create($params) { // Nonstandard bao - doesn't accept ID as a param, so convert id to group_id + contact_id @@ -160,7 +160,7 @@ function civicrm_api3_group_contact_pending($params) { * @param array $params * @param string $op * - * @return Array + * @return array * @todo behaviour is highly non-standard - need to figure out how to make this 'behave' * & at the very least return IDs & details of the groups created / changed */ @@ -220,8 +220,8 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') { $extraReturnValues['not_removed'] += $nr; } } - $dao = null;// can't pass this by reference - return civicrm_api3_create_success(1,$params,'group_contact','create',$dao,$extraReturnValues); + $dao = NULL;// can't pass this by reference + return civicrm_api3_create_success(1, $params, 'group_contact', 'create', $dao, $extraReturnValues); } /** diff --git a/bin/cli.class.php b/bin/cli.class.php index 9d23e4dd7e..d1db53c541 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -30,12 +30,12 @@ * In addition, there are several additional classes that inherit * civicrm_cli to do more precise functions. * - **/ + */ /** * base class for doing all command line operations via civicrm * used by cli.php - **/ + */ class civicrm_cli { // required values that must be passed // via the command line @@ -312,18 +312,18 @@ class civicrm_cli { /** * class used by csv/export.php to export records from * the database in a csv file format. - **/ + */ class civicrm_cli_csv_exporter extends civicrm_cli { var $separator = ','; /** */ - function __construct() { + public function __construct() { $this->_required_arguments = array('entity'); parent::initialize(); } - function run() { + public function run() { $out = fopen("php://output", 'w'); fputcsv($out, $this->columns, $this->separator, '"'); @@ -355,20 +355,20 @@ class civicrm_cli_csv_exporter extends civicrm_cli { * and civicrm_cli_csv_deleter to add or delete * records based on those found in a csv file * passed to the script. - **/ + */ class civicrm_cli_csv_file extends civicrm_cli { var $header; var $separator = ','; /** */ - function __construct() { + public function __construct() { $this->_required_arguments = array('entity', 'file'); $this->_additional_arguments = array('f' => 'file'); parent::initialize(); } - function run() { + public function run() { $this->row = 1; $handle = fopen($this->_file, "r"); @@ -400,7 +400,7 @@ class civicrm_cli_csv_file extends civicrm_cli { $this->processLine($params); } fclose($handle); - return; + return NULL; } /* return a params as expected */ @@ -409,7 +409,7 @@ class civicrm_cli_csv_file extends civicrm_cli { * * @return array */ - function convertLine($data) { + public function convertLine($data) { $params = array(); foreach ($this->header as $i => $field) { //split any multiselect data, denoted with CRM_Core_DAO::VALUE_SEPARATOR @@ -428,12 +428,12 @@ class civicrm_cli_csv_file extends civicrm_cli { * class for processing records to add * used by csv/import.php * - **/ + */ class civicrm_cli_csv_importer extends civicrm_cli_csv_file { /** * @param array $params */ - function processline($params) { + public function processline($params) { $result = civicrm_api($this->_entity, 'Create', $params); if ($result['is_error']) { echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n"; @@ -448,12 +448,12 @@ class civicrm_cli_csv_importer extends civicrm_cli_csv_file { * class for processing records to delete * used by csv/delete.php * - **/ + */ class civicrm_cli_csv_deleter extends civicrm_cli_csv_file { /** * @param array $params */ - function processline($params) { + public function processline($params) { $result = civicrm_api($this->_entity, 'Delete', $params); if ($result['is_error']) { echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n"; diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 3813cfc9df..322eb374d0 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -190,28 +190,28 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { array( "log_type" => "Relationship", "altered_contact" => "{$firstName} {$lastName} [Employee of]", - "action" => "Update" + "action" => "Update", ), array( "log_type" => "Relationship", "altered_contact" => "{$firstName} {$lastName} [Employee of]", - "action" => "Insert" + "action" => "Insert", ), array( "log_type" => "Relationship", "altered_contact" => "{$firstName} {$lastName} [Employee of]", - "action" => "Delete" + "action" => "Delete", ), //group data check array( "log_type" => "Group", "altered_contact" => "{$firstName} {$lastName} [Case Resources]", - "action" => "Added" + "action" => "Added", ), array( "log_type" => "Group", "altered_contact" => "{$firstName} {$lastName} [Case Resources]", - "action" => "Removed" + "action" => "Removed", ), //note data check array("log_type" => "Note", "altered_contact" => "{$firstName} {$lastName}", "action" => "Update"), @@ -222,30 +222,30 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { array( "log_type" => "Tag", "altered_contact" => "{$firstName} {$lastName} [Government Entity]", - "action" => "Insert" + "action" => "Insert", ), array("log_type" => "Tag", "altered_contact" => "{$firstName} {$lastName} [Company]", "action" => "Delete"), //case data check array( "log_type" => "Case", "altered_contact" => "{$firstName} {$lastName} [Housing Support]", - "action" => "Update" + "action" => "Update", ), array( "log_type" => "Case", "altered_contact" => "{$firstName} {$lastName} [Housing Support]", - "action" => "Insert" + "action" => "Insert", ), //case activity check array( "log_type" => "Activity", "altered_contact" => "{$firstName} {$lastName} [Interview]", - "action" => "Update" + "action" => "Update", ), array( "log_type" => "Activity", "altered_contact" => "{$firstName} {$lastName} [Interview]", - "action" => "Insert" + "action" => "Insert", ), ); $this->verifyReportData($data); @@ -256,12 +256,12 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { array( 'field' => 'Sort Name', 'changed_from' => "{$lastName}, {$originalFirstName}", - 'changed_to' => "{$lastName}, {$firstName}" + 'changed_to' => "{$lastName}, {$firstName}", ), array( 'field' => 'Display Name', 'changed_from' => "{$originalFirstName} {$lastName}", - 'changed_to' => "{$firstName} {$lastName}" + 'changed_to' => "{$firstName} {$lastName}", ), array('field' => 'First Name', 'changed_from' => $originalFirstName, 'changed_to' => $firstName), // array('field' => 'Email Greeting', 'changed_from' => "Dear {$originalFirstName}", 'changed_to' => "Dear {$firstName}"), @@ -314,8 +314,8 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { array( "log_type" => "Contact", "altered_contact" => "{$firstName} {$lastName}", - "action" => "Delete (to trash)" - ) + "action" => "Delete (to trash)", + ), ); $this->verifyReportData($contactDataDelete); diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index d4bcb4dd9d..4be15d85f5 100755 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -82,19 +82,19 @@ class api_v3_MailingTest extends CiviUnitTestCase { $contactIDs['a'] = $this->individualCreate(array( 'email' => 'include.me@example.org', 'first_name' => 'Includer', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $contactIDs['b'] = $this->individualCreate(array( 'email' => 'exclude.me@example.org', - 'last_name' => 'Excluder' + 'last_name' => 'Excluder', )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['a'], - 'contact_id' => $contactIDs['a'] + 'contact_id' => $contactIDs['a'], )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['b'], - 'contact_id' => $contactIDs['b'] + 'contact_id' => $contactIDs['b'], )); // END SAMPLE DATA @@ -179,7 +179,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { $contactIDs['include_me'] = $this->individualCreate(array( 'email' => 'include.me@example.org', 'first_name' => 'Includer', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $contactIDs['exclude_me'] = $this->individualCreate(array( 'email' => 'exclude.me@example.org', @@ -187,15 +187,15 @@ class api_v3_MailingTest extends CiviUnitTestCase { )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], - 'contact_id' => $contactIDs['include_me'] + 'contact_id' => $contactIDs['include_me'], )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], - 'contact_id' => $contactIDs['exclude_me'] + 'contact_id' => $contactIDs['exclude_me'], )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['exc'], - 'contact_id' => $contactIDs['exclude_me'] + 'contact_id' => $contactIDs['exclude_me'], )); $params = $this->_params; @@ -241,7 +241,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { $contactIDs['alice'] = $this->individualCreate(array( 'email' => 'alice@example.org', 'first_name' => 'Alice', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $mail = $this->callAPISuccess('mailing', 'create', $this->_params); @@ -266,29 +266,29 @@ class api_v3_MailingTest extends CiviUnitTestCase { $contactIDs['alice'] = $this->individualCreate(array( 'email' => 'alice@example.org', 'first_name' => 'Alice', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $contactIDs['bob'] = $this->individualCreate(array( 'email' => 'bob@example.org', 'first_name' => 'Bob', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $contactIDs['carol'] = $this->individualCreate(array( 'email' => 'carol@example.org', 'first_name' => 'Carol', - 'last_name' => 'Person' + 'last_name' => 'Person', )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], - 'contact_id' => $contactIDs['alice'] + 'contact_id' => $contactIDs['alice'], )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], - 'contact_id' => $contactIDs['bob'] + 'contact_id' => $contactIDs['bob'], )); $this->callAPISuccess('GroupContact', 'create', array( 'group_id' => $groupIDs['inc'], - 'contact_id' => $contactIDs['carol'] + 'contact_id' => $contactIDs['carol'], )); // END SAMPLE DATA -- 2.25.1