From: Dave Greenberg Date: Wed, 14 Jan 2015 02:11:34 +0000 (-0800) Subject: INFRA-132 - Batch #6 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a130e045946d9b7f2c2d12d05f98ea4ce22f1dbe;p=civicrm-core.git INFRA-132 - Batch #6 --- diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 20425cbfc9..99f77408d3 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -81,7 +81,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { foreach (array( 'surveyId', 'contactIds', - 'interviewerId' + 'interviewerId', ) as $fld) { $this->{"_$fld"} = $this->get($fld); } @@ -300,7 +300,7 @@ WHERE {$clause} $this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options); $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array( 'ASC' => 'Ascending', - 'DESC' => 'Descending' + 'DESC' => 'Descending', )); } @@ -321,7 +321,7 @@ WHERE {$clause} if (!empty($this->_resultOptions)) { $this->add('select', "field[$contactId][result]", ts('Result'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + array_combine($this->_resultOptions, $this->_resultOptions) ); @@ -350,7 +350,7 @@ WHERE {$clause} 'name' => ts('Done'), 'subName' => 'interview', 'isDefault' => TRUE, - ) + ), ); $buttons[] = array( @@ -431,11 +431,10 @@ WHERE {$clause} else { $defaults['order_bys'] = array( - 1 => - array( - 'column' => 'contact_a.sort_name', - 'order' => 'ASC', - ), + 1 => array( + 'column' => 'contact_a.sort_name', + 'order' => 'ASC', + ), ); } return $defaults; @@ -458,7 +457,7 @@ WHERE {$clause} foreach (array( 'surveyId', 'contactIds', - 'interviewerId' + 'interviewerId', ) as $fld) { $this->controller->set($fld, $this->{"_$fld"}); } @@ -466,7 +465,6 @@ WHERE {$clause} } // vote is done through ajax - return; } /** diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index c51b099203..bd27990f46 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -153,7 +153,8 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { /** * Create case contact record * - * @param array case_id, contact_id + * @param array $params + * case_id, contact_id * * @return object */ @@ -195,7 +196,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case { /** * Delet case contact record * - * @param int case_id + * @param int $caseID * * @return Void */ @@ -2341,7 +2342,7 @@ INNER JOIN civicrm_case_contact ON ( civicrm_case.id = civicrm_case_contact.cas * * @return int|NULL */ - static function mergeCases( + public static function mergeCases( $mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { $moveToTrash = TRUE; @@ -2800,7 +2801,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @param bool $checkComponent * Do we need to check component enabled. * - * @return boolean + * @return bool */ public static function checkPermission($activityId, $operation, $actTypeId = NULL, $contactId = NULL, $checkComponent = TRUE) { $allow = FALSE; @@ -3111,7 +3112,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @param int $activityID * Activity id. * - * @return boolean + * @return bool */ public static function isCaseActivity($activityID) { $isCaseActivity = FALSE; @@ -3382,7 +3383,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')'; * @param array $props * Whatever is known about this dao object. * - * @return Array|bool + * @return array|bool */ public static function buildOptions($fieldName, $context = NULL, $props = array()) { $className = __CLASS__; diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 2a7df6cb53..bb56e5641c 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -642,16 +642,16 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { 'title' => ts('Contribution Page'), 'name' => 'contribution_page', 'where' => 'civicrm_contribution_page.title', - 'data_type' => CRM_Utils_Type::T_STRING - )); + 'data_type' => CRM_Utils_Type::T_STRING, + ) + ); $contributionNote = array( - 'contribution_note' => - array( - 'title' => ts('Contribution Note'), - 'name' => 'contribution_note', - 'data_type' => CRM_Utils_Type::T_TEXT, - ), + 'contribution_note' => array( + 'title' => ts('Contribution Note'), + 'name' => 'contribution_note', + 'data_type' => CRM_Utils_Type::T_TEXT, + ), ); $contributionRecurId = array( @@ -844,7 +844,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = civicrm_contribution.conta * (reference) store ids of duplicate contribs. * @param int $id * - * @return boolean + * @return bool * true if duplicate, false otherwise */ public static function checkDuplicate($input, &$duplicates, $id = NULL) { @@ -1580,7 +1580,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ WHERE membership_id=$membership->id ORDER BY id DESC LIMIT 1;"; - $dao = new CRM_Core_DAO; + $dao = new CRM_Core_DAO(); $dao->query($sql); if ($dao->fetch()) { if (!empty($dao->membership_type_id)) { @@ -2570,7 +2570,7 @@ WHERE contribution_id = %1 "; * * @param bool $isNotCancelled * - * @return boolean + * @return bool */ public static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) { $cacheKeyString = "$contributionId"; @@ -3156,7 +3156,7 @@ WHERE contribution_id = %1 "; * @param array $props * whatever is known about this dao object. * - * @return Array|bool + * @return array|bool */ public static function buildOptions($fieldName, $context = NULL, $props = array()) { $className = __CLASS__; diff --git a/CRM/Contribute/Form/SoftCredit.php b/CRM/Contribute/Form/SoftCredit.php index f63f076f24..31a54b9cdf 100644 --- a/CRM/Contribute/Form/SoftCredit.php +++ b/CRM/Contribute/Form/SoftCredit.php @@ -133,7 +133,7 @@ class CRM_Contribute_Form_SoftCredit { $form->addSelect("soft_credit_type[{$rowNumber}]", array( 'entity' => 'contribution_soft', 'field' => 'soft_credit_type_id', - 'label' => ts('Type') + 'label' => ts('Type'), )); if (!empty($form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id'])) { $form->add('hidden', "soft_credit_id[{$rowNumber}]", diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index dd04b55cce..3492ebf0af 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -71,7 +71,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { * * @return array */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { // helper variable for nicer formatting @@ -294,7 +294,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { 'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1' ), - ) + ), ); // what action to take ? @@ -624,7 +624,7 @@ ORDER BY title asc * * @return int[] */ - function getCampaignIds() { + pubic function getCampaignIds() { // The unfiltered value from the session cannot be trusted, it needs to be // processed to get a clean array of positive integers. $ids = array(); @@ -640,7 +640,7 @@ ORDER BY title asc * @param $whereClause * @param array $whereParams */ - function pager($whereClause, $whereParams) { + public function pager($whereClause, $whereParams) { $params['status'] = ts('Contribution %%StatusMessage%%'); $params['csvString'] = NULL; diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index fe62f46a39..d964724840 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -71,7 +71,6 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { /** * Get all fields of the type Date */ - public static function getDateFields() { $allFields = CRM_Core_BAO_CustomField::getFields(''); $dateFields = array('birth_date' => ts('Birth Date')); @@ -489,7 +488,7 @@ AND cas.entity_value = $id AND foreach (array( 'text', 'html', - 'sms_text' + 'sms_text', ) as $elem) { $$elem = $smarty->fetch("string:{$$elem}"); } @@ -529,7 +528,7 @@ AND cas.entity_value = $id AND $smsParams = array( 'To' => $phoneNumber, 'provider_id' => $schedule->sms_provider_id, - 'activity_subject' => $messageSubject + 'activity_subject' => $messageSubject, ); $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type', 'SMS', @@ -701,16 +700,16 @@ AND cas.entity_value = $id AND $activityStatusID = FALSE; if ($actionSchedule->record_activity) { if ($mapping->entity == 'civicrm_membership') { - $activityTypeID = - CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name'); + $activityTypeID + = CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name'); } else { - $activityTypeID = - CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name'); + $activityTypeID + = CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name'); } - $activityStatusID = - CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name'); + $activityStatusID + = CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name'); } if ($mapping->entity == 'civicrm_activity') { @@ -753,7 +752,7 @@ LEFT JOIN civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option 'fee_amount', 'contact_email', 'contact_phone', - 'balance' + 'balance', ); $extraSelect = ', ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone '; @@ -880,8 +879,8 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL if ($toEmail || !(empty($toPhoneNumber) or $toDoNotSms)) { $to['email'] = $toEmail; $to['phone'] = $toPhoneNumber; - $result = - CRM_Core_BAO_ActionSchedule::sendReminder( + $result + = CRM_Core_BAO_ActionSchedule::sendReminder( $dao->contactID, $to, $actionSchedule->id, @@ -913,8 +912,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL $activityParams = array( 'subject' => $actionSchedule->title, 'details' => $actionSchedule->body_html, - 'source_contact_id' => - $session->get('userID') ? $session->get('userID') : $dao->contactID, + 'source_contact_id' => $session->get('userID') ? $session->get('userID') : $dao->contactID, 'target_contact_id' => $dao->contactID, 'activity_date_time' => date('YmdHis'), 'status_id' => $activityStatusID, @@ -1333,9 +1331,10 @@ INNER JOIN {$reminderJoinClause} $valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array( 1 => array( $actionSchedule->id, - 'Integer' - ) - )); + 'Integer', + ), + ) + ); $arrValues = array(); while ($valsqlInsertValues->fetch()) { diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index e137c04976..27709bdd65 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -131,8 +131,6 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * Get the location values of a domain * - * @param NULL - * * @return array * Location::getValues */ diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 2583c06eae..3ba7db4b3a 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -248,12 +248,12 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent ts('Allow Online Registration'), NULL, array( - 'onclick' => "return showHideByValue('is_online_registration', - '', - 'registration_blocks', - 'block', - 'radio', - false );", + 'onclick' => "return showHideByValue('is_online_registration'," . + "''," . + "'registration_blocks'," . + "'block'," . + "'radio'," . + "false );", ) ); @@ -354,7 +354,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * Label. * @param array $configs * Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes(). - **/ + */ public function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = NULL) { extract((is_null($configs)) ? self::getProfileSelectorTypes() : $configs); $element = $prefix . "custom_post_id_multiple[$count]"; @@ -367,7 +367,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @return array * ['allowCoreTypes' => array, 'allowSubTypes' => array, 'profileEntities' => array] - **/ + */ public static function getProfileSelectorTypes() { $configs = array( 'allowCoreTypes' => array(), @@ -377,7 +377,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $configs['allowCoreTypes'] = array_merge(array( 'Contact', - 'Individual' + 'Individual', ), CRM_Contact_BAO_ContactType::subTypes('Individual')); $configs['allowCoreTypes'][] = 'Participant'; //CRM-15427 @@ -393,7 +393,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $configs['profileEntities'][] = array( 'entity_name' => 'participant_1', 'entity_type' => 'ParticipantModel', - 'entity_sub_type' => '*' + 'entity_sub_type' => '*', ); return $configs; @@ -672,7 +672,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * Collect all email fields for an array of profile ids * * @param $profileIds - * @return boolean + * @return bool */ public static function getEmailFields($profileIds) { $emailFields = array(); @@ -693,7 +693,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * Check if a profile contains required fields * * @param $profileIds - * @return boolean + * @return bool */ public static function isProfileComplete($profileIds) { $profileReqFields = array(); @@ -728,9 +728,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent * * @param $profileIds * @param int $rgId - * @return boolean + * @return bool */ - public function canProfilesDedupe($profileIds, $rgId = 0) { // find the unsupervised rule diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 9a39399402..bae80a7a25 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -290,7 +290,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment array( 'title' => ts('CiviEvent Dashboard'), 'url' => CRM_Utils_System::url('civicrm/event', 'reset=1'), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumbs); @@ -643,7 +643,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if ($this->_single && $this->_context == 'standalone') { $this->addEntityRef('contact_id', ts('Contact'), array( 'create' => TRUE, - 'api' => array('extra' => array('email')) + 'api' => array('extra' => array('email')), ), TRUE); } @@ -703,8 +703,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name') ); $checkCancelledJs = array( - 'onchange' => - "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});", + 'onchange' => "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});", ); $participantStatusId = array_search('Pending from pay later', @@ -742,7 +741,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $this->addSelect('status_id', $checkCancelledJs + array( 'options' => $statusOptions, - 'option_url' => 'civicrm/admin/participant_status' + 'option_url' => 'civicrm/admin/participant_status', ), TRUE); $this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL); @@ -857,7 +856,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $contactId = $self->_contactId; $eventId = CRM_Utils_Array::value('event_id', $values); if (!empty($contactId) && !empty($eventId)) { - $dupeCheck = new CRM_Event_BAO_Participant; + $dupeCheck = new CRM_Event_BAO_Participant(); $dupeCheck->contact_id = $contactId; $dupeCheck->event_id = $eventId; $dupeCheck->find(TRUE); @@ -907,7 +906,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $duplicateContacts = 0; while (list($k, $dupeCheckContactId) = each($this->_contactIds)) { // Eliminate contacts that have already been assigned to this event. - $dupeCheck = new CRM_Event_BAO_Participant; + $dupeCheck = new CRM_Event_BAO_Participant(); $dupeCheck->contact_id = $dupeCheckContactId; $dupeCheck->event_id = $event_id; $dupeCheck->find(TRUE); @@ -1078,8 +1077,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment CRM_Core_Error::fatal(ts('Selected Event is not Paid Event ')); } - $eventTitle = - CRM_Core_DAO::getFieldValue( + $eventTitle + = CRM_Core_DAO::getFieldValue( 'CRM_Event_DAO_Event', $params['event_id'], 'title' @@ -1089,7 +1088,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if (empty($params['source'])) { $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array( 1 => $userName, - 2 => $eventTitle + 2 => $eventTitle, )); } else { @@ -1115,8 +1114,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } // also add location name to the array - $params["address_name-{$this->_bltID}"] = - CRM_Utils_Array::value('billing_first_name', $params) . ' ' . + $params["address_name-{$this->_bltID}"] + = CRM_Utils_Array::value('billing_first_name', $params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params); @@ -1228,8 +1227,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment ); //add contribution record - $this->_params['financial_type_id'] = - CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id'); + $this->_params['financial_type_id'] + = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id'); $this->_params['mode'] = $this->_mode; //add contribution reocord @@ -1322,7 +1321,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment if (empty($params['source'])) { $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array( 1 => $eventTitle, - 2 => $userName + 2 => $userName, )); } else { diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 484ad36e50..6cde6e5f15 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -214,7 +214,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { array( 'title' => ts('Manage Events'), 'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); } @@ -302,7 +302,7 @@ ORDER BY start_date desc // get the list of active event pcps $eventPCPS = array(); - $pcpDao = new CRM_PCP_DAO_PCPBlock; + $pcpDao = new CRM_PCP_DAO_PCPBlock(); $pcpDao->entity_table = 'civicrm_event'; $pcpDao->find(); diff --git a/CRM/Grant/Info.php b/CRM/Grant/Info.php index a569c7fcb7..ae1405ddf8 100644 --- a/CRM/Grant/Info.php +++ b/CRM/Grant/Info.php @@ -135,7 +135,7 @@ class CRM_Grant_Info extends CRM_Core_Component_Info { 'query' => "reset=1&action=add&context=standalone", 'ref' => 'new-grant', 'title' => ts('Grant'), - ) + ), )); } } diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index 75ca55c5a0..34bfc24113 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -70,102 +70,102 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { } $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'grouping' => 'contact-field', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Donor Name'), - 'default' => TRUE, - 'required' => TRUE, - ), - 'first_name' => array( - 'title' => ts('First Name'), - ), - 'last_name' => array( - 'title' => ts('Last Name'), - ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'grouping' => 'contact-field', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Donor Name'), + 'default' => TRUE, + 'required' => TRUE, ), - 'filters' => array( - 'sort_name' => array( - 'title' => ts('Donor Name'), - 'operator' => 'like', - ), + 'first_name' => array( + 'title' => ts('First Name'), + ), + 'last_name' => array( + 'title' => ts('Last Name'), + ), + 'contact_type' => array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => array( + 'title' => ts('Contact Subtype'), + ), + ), + 'filters' => array( + 'sort_name' => array( + 'title' => ts('Donor Name'), + 'operator' => 'like', + ), + ), + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'grouping' => 'contact-field', + 'fields' => array( + 'email' => array( + 'title' => ts('Email'), + 'default' => TRUE, ), ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'grouping' => 'contact-field', - 'fields' => array( - 'email' => array( - 'title' => ts('Email'), - 'default' => TRUE, - ), + ), + 'civicrm_phone' => array( + 'dao' => 'CRM_Core_DAO_Phone', + 'grouping' => 'contact-field', + 'fields' => array( + 'phone' => array( + 'title' => ts('Phone'), + 'default' => TRUE, ), ), - 'civicrm_phone' => array( - 'dao' => 'CRM_Core_DAO_Phone', - 'grouping' => 'contact-field', - 'fields' => array( - 'phone' => array( - 'title' => ts('Phone'), - 'default' => TRUE, - ), + ), + ) + + $this->addAddressFields() + + array( + 'civicrm_contribution' => array( + 'dao' => 'CRM_Contribute_DAO_Contribution', + 'fields' => array( + 'contact_id' => array( + 'title' => ts('contactId'), + 'no_display' => TRUE, + 'required' => TRUE, + 'no_repeat' => TRUE, + ), + 'total_amount' => array( + 'title' => ts('Total Amount'), + 'no_display' => TRUE, + 'required' => TRUE, + 'no_repeat' => TRUE, + ), + 'receive_date' => array( + 'title' => ts('Year'), + 'no_display' => TRUE, + 'required' => TRUE, + 'no_repeat' => TRUE, ), ), - ) - + $this->addAddressFields() - + array( - 'civicrm_contribution' => array( - 'dao' => 'CRM_Contribute_DAO_Contribution', - 'fields' => array( - 'contact_id' => array( - 'title' => ts('contactId'), - 'no_display' => TRUE, - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'total_amount' => array( - 'title' => ts('Total Amount'), - 'no_display' => TRUE, - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'receive_date' => array( - 'title' => ts('Year'), - 'no_display' => TRUE, - 'required' => TRUE, - 'no_repeat' => TRUE, - ), + 'filters' => array( + 'yid' => array( + 'name' => 'receive_date', + 'title' => ts('This Year'), + 'operatorType' => CRM_Report_Form::OP_SELECT, + 'options' => $optionYear, + 'default' => date('Y'), ), - 'filters' => array( - 'yid' => array( - 'name' => 'receive_date', - 'title' => ts('This Year'), - 'operatorType' => CRM_Report_Form::OP_SELECT, - 'options' => $optionYear, - 'default' => date('Y'), - ), - 'financial_type_id' => array( - 'title' => ts('Financial Type'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::financialType(), - ), - 'contribution_status_id' => array( - 'title' => ts('Contribution Status'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), - 'default' => array('1'), - ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::financialType(), + ), + 'contribution_status_id' => array( + 'title' => ts('Contribution Status'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), + 'default' => array('1'), ), ), - ); + ), + ); // If we have a campaign, build out the relevant elements if ($campaignEnabled && !empty($this->activeCampaigns)) { diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index 8f26e014e3..3d3a6c0f5b 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -69,113 +69,113 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { } $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Contact Name'), - 'required' => TRUE, - 'no_repeat' => TRUE, - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Contact Name'), + 'required' => TRUE, + 'no_repeat' => TRUE, ), - 'filters' => array( - 'sort_name' => array('title' => ts('Contact Name')), - 'id' => array('no_display' => TRUE), - ), - 'grouping' => 'contact-fields', ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'fields' => array( - 'email' => array('no_repeat' => TRUE), - ), - 'grouping' => 'contact-fields', + 'filters' => array( + 'sort_name' => array('title' => ts('Contact Name')), + 'id' => array('no_display' => TRUE), + ), + 'grouping' => 'contact-fields', + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array('no_repeat' => TRUE), ), - 'civicrm_pledge' => array( - 'dao' => 'CRM_Pledge_DAO_Pledge', - 'fields' => array( - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), - 'contact_id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), - 'amount' => array( - 'title' => ts('Pledge Amount'), - 'required' => TRUE, - 'type' => CRM_Utils_Type::T_MONEY, - ), - 'currency' => array( - 'required' => TRUE, - 'no_display' => TRUE, - ), - 'frequency_unit' => array( - 'title' => ts('Frequency Unit'), - ), - 'installments' => array( - 'title' => ts('Installments'), - ), - 'pledge_create_date' => array( - 'title' => ts('Pledge Made Date'), - ), - 'start_date' => array( - 'title' => ts('Pledge Start Date'), - 'type' => CRM_Utils_Type::T_DATE, - ), - 'end_date' => array( - 'title' => ts('Pledge End Date'), - 'type' => CRM_Utils_Type::T_DATE, - ), - 'status_id' => array( - 'title' => ts('Pledge Status'), - 'required' => TRUE, - ), + 'grouping' => 'contact-fields', + ), + 'civicrm_pledge' => array( + 'dao' => 'CRM_Pledge_DAO_Pledge', + 'fields' => array( + 'id' => array( + 'no_display' => TRUE, + 'required' => TRUE, ), - 'filters' => array( - 'pledge_create_date' => array( - 'title' => 'Pledge Made Date', - 'operatorType' => CRM_Report_Form::OP_DATE, - ), - 'pledge_amount' => array( - 'title' => ts('Pledged Amount'), - 'operatorType' => CRM_Report_Form::OP_INT, - ), - 'currency' => array( - 'title' => 'Currency', - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_OptionGroup::values('currencies_enabled'), - 'default' => NULL, - 'type' => CRM_Utils_Type::T_STRING, - ), - 'sid' => array( - 'name' => 'status_id', - 'title' => ts('Pledge Status'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_OptionGroup::values('contribution_status'), - ), - + 'contact_id' => array( + 'no_display' => TRUE, + 'required' => TRUE, + ), + 'amount' => array( + 'title' => ts('Pledge Amount'), + 'required' => TRUE, + 'type' => CRM_Utils_Type::T_MONEY, + ), + 'currency' => array( + 'required' => TRUE, + 'no_display' => TRUE, + ), + 'frequency_unit' => array( + 'title' => ts('Frequency Unit'), + ), + 'installments' => array( + 'title' => ts('Installments'), + ), + 'pledge_create_date' => array( + 'title' => ts('Pledge Made Date'), + ), + 'start_date' => array( + 'title' => ts('Pledge Start Date'), + 'type' => CRM_Utils_Type::T_DATE, + ), + 'end_date' => array( + 'title' => ts('Pledge End Date'), + 'type' => CRM_Utils_Type::T_DATE, + ), + 'status_id' => array( + 'title' => ts('Pledge Status'), + 'required' => TRUE, ), ), - 'civicrm_pledge_payment' => array( - 'dao' => 'CRM_Pledge_DAO_PledgePayment', - 'fields' => array( - 'total_paid' => array( - 'title' => ts('Total Amount Paid'), - 'type' => CRM_Utils_Type::T_MONEY, - ), - 'balance_due' => array( - 'title' => ts('Balance Due'), - 'default' => TRUE, - 'type' => CRM_Utils_Type::T_MONEY, - ), + 'filters' => array( + 'pledge_create_date' => array( + 'title' => 'Pledge Made Date', + 'operatorType' => CRM_Report_Form::OP_DATE, + ), + 'pledge_amount' => array( + 'title' => ts('Pledged Amount'), + 'operatorType' => CRM_Report_Form::OP_INT, + ), + 'currency' => array( + 'title' => 'Currency', + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_OptionGroup::values('currencies_enabled'), + 'default' => NULL, + 'type' => CRM_Utils_Type::T_STRING, + ), + 'sid' => array( + 'name' => 'status_id', + 'title' => ts('Pledge Status'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_OptionGroup::values('contribution_status'), + ), + ), + ), + 'civicrm_pledge_payment' => array( + 'dao' => 'CRM_Pledge_DAO_PledgePayment', + 'fields' => array( + 'total_paid' => array( + 'title' => ts('Total Amount Paid'), + 'type' => CRM_Utils_Type::T_MONEY, + ), + 'balance_due' => array( + 'title' => ts('Balance Due'), + 'default' => TRUE, + 'type' => CRM_Utils_Type::T_MONEY, ), ), - ) - + $this->getAddressColumns(array('group_by' => FALSE)) - + $this->getPhoneColumns(); + ), + ); + + $this->_columns += $this->getAddressColumns(array('group_by' => FALSE)) + $this->getPhoneColumns(); + // If we have a campaign, build out the relevant elements $this->_tagFilter = TRUE; if ($campaignEnabled && !empty($this->activeCampaigns)) { diff --git a/CRM/Report/Interface.php b/CRM/Report/Interface.php index 926ef61845..313a60076d 100644 --- a/CRM/Report/Interface.php +++ b/CRM/Report/Interface.php @@ -74,7 +74,7 @@ interface CRM_Report_Interface { * Retrieve all the values that match the current input parameters * Used by the selector */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE ); diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index cc0fd4dd19..123af298ee 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -294,7 +294,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $defaultLocation = $this->_location_types[$defaultLocationType->id]; unset($this->_location_types[$defaultLocationType->id]); $this->_location_types = array( - $defaultLocationType->id => $defaultLocation + $defaultLocationType->id => $defaultLocation, ) + $this->_location_types; } @@ -562,7 +562,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $showBestResult = FALSE; if (in_array($ufField->field_name, array( 'country', - 'state_province' + 'state_province', )) && count($config->countryLimit) > 1 ) { // get state or country field weight if exists @@ -631,7 +631,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { 'Participant', 'Contribution', 'Membership', - 'Activity' + 'Activity', ))) { $individualSubTypes = CRM_Contact_BAO_ContactType::subTypes('Individual'); foreach ($groupType as $value) { @@ -677,7 +677,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { * @param array $errors * Collect errors. * - * @return Array + * @return array * list of errors to be posted back to the form */ public static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) { @@ -687,7 +687,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { 'Contribution', 'Membership', 'Activity', - 'Case' + 'Case', ))) { $params = array('id' => $customField->custom_group_id); $customGroup = array(); @@ -796,7 +796,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { 'Contribution', 'Participant', 'Membership', - 'Activity' + 'Activity', )) ) { $errors['in_selector'] = ts("'In Selector' cannot be checked for %1 fields.", array(1 => $entityName)); @@ -988,7 +988,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { if ($fieldType != $profileType) { $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array( 1 => $fieldType, - 2 => $profileType + 2 => $profileType, )); } } @@ -1000,7 +1000,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form { ) { $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array( 1 => $fieldType, - 2 => $profileType + 2 => $profileType, )); } } diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index 1e97062f90..a51df38b35 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -301,7 +301,7 @@ class CRM_Utils_PDF_Utils { * @param string $author * @param string $title */ - static function &pdflib( + pubic static function &pdflib( $fileName, $searchPath, &$values, diff --git a/api/v3/Profile.php b/api/v3/Profile.php index 8417fad60c..c41b04b7ce 100644 --- a/api/v3/Profile.php +++ b/api/v3/Profile.php @@ -31,26 +31,26 @@ * @package CiviCRM_APIv3 * @subpackage API_ActivityProfile * @copyright CiviCRM LLC (c) 2004-2014 - * @version $Id: ActivityProfile.php 30486 2011-05-20 16:12:09Z rajan $ + * @version $Id: Profile.php 30486 2011-05-20 16:12:09Z rajan $ * */ /** * Retrieve Profile field values. * - * @param array $params - * Associative array of property name/value. - * pairs to get profile field values - * - * @throws API_Exception - * @return array - * * NOTE this api is not standard & since it is tested we need to honour that * but the correct behaviour is for it to return an id indexed array as this supports * multiple instances - if a single profile is passed in we will not return a normal api result array * in order to avoid breaking code. (This could still be confusing :-( but we have to keep the tested behaviour working * * Note that if contact_id is empty an array of defaults is returned + * + * @param array $params + * Associative array of property name/value. + * pairs to get profile field values + * + * @throws API_Exception + * @return array */ function civicrm_api3_profile_get($params) { $nonStandardLegacyBehaviour = is_numeric($params['profile_id']) ? TRUE : FALSE; diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 9be7a535e3..d293c830dc 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -222,7 +222,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array(), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); $this->assertType('array', $rc, 'In line ' . __LINE__ @@ -258,7 +258,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = call_user_func(array('CRM_Member_Form_Membership', 'formRule'), $params, $files, $obj ); @@ -287,7 +287,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); $this->assertType('array', $rc, 'In line ' . __LINE__ @@ -314,7 +314,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); $this->assertType('array', $rc, 'In line ' . __LINE__ @@ -340,7 +340,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '13'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); $this->assertType('array', $rc); $this->assertTrue(array_key_exists('status_id', $rc)); @@ -359,7 +359,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'is_override' => TRUE, ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); $this->assertType('array', $rc, 'In line ' . __LINE__ @@ -383,7 +383,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found no valid membership status @@ -408,7 +408,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found New membership status @@ -429,7 +429,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found New membership status @@ -450,7 +450,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found Current membership status @@ -471,7 +471,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found Grace membership status @@ -492,7 +492,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '3'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found Expired membership status @@ -513,7 +513,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { 'membership_type_id' => array('23', '7'), ); $files = array(); - $obj = new CRM_Member_Form_Membership; + $obj = new CRM_Member_Form_Membership(); $rc = $obj->formRule($params, $files, $obj); // Should have found Current membership status diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index e16a0232d0..3584c546f5 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -189,7 +189,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { // also load the class loader require_once 'CRM/Core/ClassLoader.php'; CRM_Core_ClassLoader::singleton()->register(); - if (function_exists('_civix_phpunit_setUp')) { // FIXME: loosen coupling + if (function_exists('_civix_phpunit_setUp')) { + // FIXME: loosen coupling _civix_phpunit_setUp(); } } @@ -679,7 +680,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @param $expectedValue * @param $message */ - function assertDBCompareValue( + public function assertDBCompareValue( $daoName, $searchValue, $returnColumn, $searchColumn, $expectedValue, $message ) { @@ -1024,7 +1025,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { 'debug' => 1, ); $result = $this->civicrm_api($entity, 'getcount', $params); - if (!is_integer($result) || !empty($result['is_error']) || isset($result['values'])) { + if (!is_int($result) || !empty($result['is_error']) || isset($result['values'])) { throw new Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result)); } if (is_int($count)) { @@ -1176,7 +1177,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { ); $params = array('contact_type' => $contact_type); foreach ($samples[$contact_type] as $key => $values) { - $params[$key] = $values[$seq % sizeof($values)]; + $params[$key] = $values[$seq % count($values)]; } if ($contact_type == 'Individual') { $params['email'] = strtolower( @@ -1214,7 +1215,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * Contact ID to delete */ public function contactDelete($contactID) { - $domain = new CRM_Core_BAO_Domain; + $domain = new CRM_Core_BAO_Domain(); $domain->contact_id = $contactID; if (!$domain->find(TRUE)) { $this->callAPISuccess('contact', 'delete', array( @@ -1304,7 +1305,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { public function membershipDelete($membershipID) { $deleteParams = array('id' => $membershipID); $result = $this->callAPISuccess('Membership', 'Delete', $deleteParams); - return; } /** @@ -1332,7 +1332,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return; } $result = $this->callAPISuccess('MembershipStatus', 'Delete', array('id' => $membershipStatusID)); - return; } /** @@ -1811,7 +1810,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Delete a Location Type * - * @param int location type id + * @param int locationTypeId */ public function locationTypeDelete($locationTypeId) { $locationType = new CRM_Core_DAO_LocationType(); @@ -1852,8 +1851,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @param int $groupID * @param int $totalCount - * @return int groupId of created group - * groupId of created group + * @return int + * groupId of created group */ public function groupContactCreate($groupID, $totalCount = 10) { $params = array('group_id' => $groupID); @@ -1929,7 +1928,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { /** * Delete a UF Join Entry * - * @param array with missing uf_group_id + * @param array $params + * with missing uf_group_id */ public function ufjoinDelete($params = NULL) { if ($params === NULL) { diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 21b9467fc7..37e5bb3e15 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -176,13 +176,13 @@ class api_v3_ProfileTest extends CiviUnitTestCase { 'contact_id' => $contactId, 'street_address' => '25 Big Street', 'city' => 'big city', - 'location_type_id' => 5 + 'location_type_id' => 5, )); $this->callAPISuccess('email', 'create', array( 'contact_id' => $contactId, 'email' => 'big@once.com', 'location_type_id' => 2, - 'is_billing' => 1 + 'is_billing' => 1, )); $expected = current($individual); @@ -309,7 +309,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $this->_addCustomFieldToProfile($this->_profileID); $result = $this->callAPIAndDocument('profile', 'getfields', array( 'action' => 'submit', - 'profile_id' => $this->_profileID + 'profile_id' => $this->_profileID, ), __FUNCTION__, __FILE__, 'demonstrates retrieving profile fields passing in an id'); $this->assertArrayKeyExists('first_name', $result['values']); @@ -327,7 +327,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', 'profile_id' => 'participant_status', - 'get_options' => 'all' + 'get_options' => 'all', ) ); $this->assertTrue(array_key_exists('participant_status_id', $result['values'])); @@ -343,7 +343,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', 'profile_id' => 'membership_batch_entry', - 'get_options' => 'all' + 'get_options' => 'all', ) ); $this->assertTrue(array_key_exists('total_amount', $result['values'])); @@ -351,7 +351,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $this->assertEquals(array( 'contribution_type_id', 'contribution_type', - 'financial_type' + 'financial_type', ), $result['values']['financial_type_id']['api.aliases']); $this->assertTrue(!array_key_exists('financial_type', $result['values'])); $this->assertEquals(12, $result['values']['receive_date']['type']); @@ -368,7 +368,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', 'profile_id' => $profileID, - 'get_options' => 'all' + 'get_options' => 'all', ) ); } @@ -475,11 +475,11 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $profileFields = $this->callAPISuccess('profile', 'getfields', array( 'get_options' => 'all', 'action' => 'submit', - 'profile_id' => 'membership_batch_entry' + 'profile_id' => 'membership_batch_entry', )); $getoptions = $this->callAPISuccess('membership', 'getoptions', array( 'field' => 'membership_type', - 'context' => 'validate' + 'context' => 'validate', )); $this->assertEquals(array_keys($membershipTypes['values']), array_keys($getoptions['values'])); $this->assertEquals(array_keys($membershipTypes['values']), array_keys($profileFields['values']['membership_type_id']['options'])); @@ -492,7 +492,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { public function testMembershipGetFieldsOrder() { $result = $this->callAPISuccess('profile', 'getfields', array( 'action' => 'submit', - 'profile_id' => 'membership_batch_entry' + 'profile_id' => 'membership_batch_entry', )); $weight = 1; foreach ($result['values'] as $fieldName => $field) { @@ -716,7 +716,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { foreach (array( 'email', 'phone', - 'address' + 'address', ) as $fieldType) { $typeValues = array_pop($result['values'][$fieldType]); foreach ($expected[$fieldType] as $field => $value) { @@ -933,7 +933,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $this->uFFieldCreate(array( 'uf_group_id' => $profileID, 'field_name' => 'custom_' . $ids['custom_field_id'], - 'contact_type' => 'Contact' + 'contact_type' => 'Contact', )); } }