From: yashodha Date: Mon, 19 Jan 2015 08:13:59 +0000 (+0530) Subject: clean up for batch-20 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=389bcebf543e6293648a6c09e162652c1385b768;p=civicrm-core.git clean up for batch-20 --- diff --git a/CRM/Activity/Form/Task/FileOnCase.php b/CRM/Activity/Form/Task/FileOnCase.php index a3f5663e3b..a224386f47 100644 --- a/CRM/Activity/Form/Task/FileOnCase.php +++ b/CRM/Activity/Form/Task/FileOnCase.php @@ -94,7 +94,6 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { * * @return void */ - public function postProcess() { $formparams = $this->exportValues(); $caseId = $formparams['unclosed_case_id']; @@ -131,7 +130,7 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task { else { CRM_Core_Session::setStatus(ts('Not permitted to file activity %1 %2.', array( 1 => empty($defaults['subject']) ? '' : $defaults['subject'], - 2 => $defaults['activity_date_time'] + 2 => $defaults['activity_date_time'], )), ts("Error"), "error"); } diff --git a/CRM/Activity/Form/Task/PickProfile.php b/CRM/Activity/Form/Task/PickProfile.php index e3a7ba962b..ee444ea43e 100755 --- a/CRM/Activity/Form/Task/PickProfile.php +++ b/CRM/Activity/Form/Task/PickProfile.php @@ -76,7 +76,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { if (count($this->_activityHolderIds) > $this->_maxActivities) { CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array( 1 => $this->_maxActivities, - 2 => count($this->_activityHolderIds) + 2 => count($this->_activityHolderIds), )), ts('Maximum Exceeded'), 'error'); $validate = TRUE; } @@ -129,7 +129,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task { $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'), array( - '' => ts('- select profile -') + '' => ts('- select profile -'), ) + $profiles, TRUE ); $this->addDefaultButtons(ts('Continue')); diff --git a/CRM/Admin/Form/MailSettings.php b/CRM/Admin/Form/MailSettings.php index 0d45fe10fa..9f4e085a75 100644 --- a/CRM/Admin/Form/MailSettings.php +++ b/CRM/Admin/Form/MailSettings.php @@ -156,7 +156,7 @@ class CRM_Admin_Form_MailSettings extends CRM_Admin_Form { foreach ($fields as $f) { if (in_array($f, array( 'is_default', - 'is_ssl' + 'is_ssl', ))) { $params[$f] = CRM_Utils_Array::value($f, $formValues, FALSE); } diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index cbb44aa8c2..d6626d7106 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -120,7 +120,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting { $from = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>'; $testMailStatusMsg = ts('Sending test email. FROM: %1 TO: %2.
', array( 1 => $domainEmailAddress, - 2 => $toEmail + 2 => $toEmail, )); $params = array(); diff --git a/CRM/Admin/Page/JobLog.php b/CRM/Admin/Page/JobLog.php index 366d2c58fe..df94a88183 100644 --- a/CRM/Admin/Page/JobLog.php +++ b/CRM/Admin/Page/JobLog.php @@ -83,7 +83,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { 'url' => CRM_Utils_System::url('civicrm/admin', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); return parent::run(); @@ -104,8 +104,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic { $jobName = NULL; if ($jid) { - $jobName = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Job', $jid); + $jobName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Job', $jid); } $this->assign('jobName', $jobName); diff --git a/CRM/Admin/Page/Options.php b/CRM/Admin/Page/Options.php index 49d42dab9e..1eba4b5bc3 100644 --- a/CRM/Admin/Page/Options.php +++ b/CRM/Admin/Page/Options.php @@ -125,7 +125,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { 'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); } @@ -210,7 +210,7 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic { 'url' => 'civicrm/contact/search/custom', 'qs' => 'reset=1&csid=%%value%%', 'title' => ts('Run %1', array(1 => self::$_gName)), - ) + ), ); self::$_links = $runLink + self::$_links; } diff --git a/CRM/Admin/Page/ParticipantStatusType.php b/CRM/Admin/Page/ParticipantStatusType.php index b4d931f6a1..8a64f30d92 100644 --- a/CRM/Admin/Page/ParticipantStatusType.php +++ b/CRM/Admin/Page/ParticipantStatusType.php @@ -80,7 +80,7 @@ class CRM_Admin_Page_ParticipantStatusType extends CRM_Core_Page_Basic { public function browse() { $statusTypes = array(); - $dao = new CRM_Event_DAO_ParticipantStatusType; + $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->orderBy('weight'); $dao->find(); @@ -92,7 +92,7 @@ class CRM_Admin_Page_ParticipantStatusType extends CRM_Core_Page_Basic { 'Awaiting approval', 'Pending from waitlist', 'Pending from approval', - 'Rejected' + 'Rejected', ); while ($dao->fetch()) { diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index b329ea11e7..620d497aa1 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -106,7 +106,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { //CRM-15546 $paymentProcessorTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', array( 'labelColumn' => 'name', - 'flip' => 1 + 'flip' => 1, )); $this->assign('defaultPaymentProcessorType', $paymentProcessorTypes['PayPal']); $breadCrumb = array( @@ -115,7 +115,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { 'url' => CRM_Utils_System::url('civicrm/admin', 'reset=1' ), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); return parent::run(); diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 940a04e6df..b723e37134 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -48,7 +48,7 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign { */ public static function create(&$params) { if (empty($params)) { - return; + return NULL; } if (!(CRM_Utils_Array::value('id', $params))) { diff --git a/CRM/Campaign/BAO/Petition.php b/CRM/Campaign/BAO/Petition.php index 30136a430e..53fc7f392b 100644 --- a/CRM/Campaign/BAO/Petition.php +++ b/CRM/Campaign/BAO/Petition.php @@ -177,7 +177,7 @@ SELECT petition.id as id, */ public function createSignature(&$params) { if (empty($params)) { - return; + return NULL; } if (!isset($params['sid'])) { @@ -637,7 +637,6 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; ) ) . "@$emailDomain"; - $confirmUrl = CRM_Utils_System::url('civicrm/petition/confirm', "reset=1&cid={$se->contact_id}&sid={$se->id}&h={$se->hash}&a={$params['activityId']}&pid={$params['sid']}", TRUE diff --git a/CRM/Campaign/Form/Petition.php b/CRM/Campaign/Form/Petition.php index 973b6e29b9..10584fdb44 100644 --- a/CRM/Campaign/Form/Petition.php +++ b/CRM/Campaign/Form/Petition.php @@ -122,8 +122,6 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -199,7 +197,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form { // custom group id $this->add('select', 'contact_profile_id', ts('Contact Profile'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $customContactProfiles, TRUE ); diff --git a/CRM/Campaign/Form/Search/Survey.php b/CRM/Campaign/Form/Search/Survey.php index 0b6195b2ec..c0cca939b0 100755 --- a/CRM/Campaign/Form/Search/Survey.php +++ b/CRM/Campaign/Form/Search/Survey.php @@ -50,7 +50,7 @@ class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form { * * @return void */ - function preProcess() { + public function preProcess() { $this->_search = CRM_Utils_Array::value('search', $_GET); $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE); $this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'survey'); @@ -86,7 +86,7 @@ class CRM_Campaign_Form_Search_Survey extends CRM_Core_Form { $surveyTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType(); $this->add('select', 'activity_type_id', ts('Activity Type'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $surveyTypes ); $this->set('surveyTypes', $surveyTypes); diff --git a/CRM/Campaign/Page/DashBoard.php b/CRM/Campaign/Page/DashBoard.php index eb0d701606..b92cee3fc5 100644 --- a/CRM/Campaign/Page/DashBoard.php +++ b/CRM/Campaign/Page/DashBoard.php @@ -475,7 +475,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page { ->addSetting(array( 'tabSettings' => array( 'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')), - ) + ), )); } diff --git a/CRM/Campaign/Page/Petition/Confirm.php b/CRM/Campaign/Page/Petition/Confirm.php index e1a78ee074..5a513231e6 100644 --- a/CRM/Campaign/Page/Petition/Confirm.php +++ b/CRM/Campaign/Page/Petition/Confirm.php @@ -103,7 +103,7 @@ class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page { * @param int $activity_id * @param int $petition_id * - * @return boolean + * @return bool * True on success */ public static function confirm($contact_id, $subscribe_id, $hash, $activity_id, $petition_id) { diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index 4991df9072..c65921502c 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -56,7 +56,6 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { // since the pcm - preferred comminication method is logically // grouped hence we'll use groups of HTML_QuickForm - // checkboxes for DO NOT phone, email, mail // we take labels from SelectValues $privacy = $commPreff = $commPreference = array(); @@ -118,7 +117,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { if (!empty($greetingTokens)) { $form->addElement('select', $fields['field'], $fields['label'], array( - '' => ts('- select -') + '' => ts('- select -'), ) + $greetingTokens ); //custom addressee @@ -187,8 +186,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { if ($form->_action & CRM_Core_Action::ADD) { foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) { if (empty($defaults[$greeting . '_id'])) { - if ($defaultGreetingTypeId = - CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting) + if ($defaultGreetingTypeId = CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting) ) { $defaults[$greeting . '_id'] = $defaultGreetingTypeId; } diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index ba367123ca..9d0a46df9f 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -131,7 +131,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $this->prev = $this->next = NULL; foreach (array( 'prev', - 'next' + 'next', ) as $position) { if (!empty($pos[$position])) { if ($pos[$position]['id1'] && $pos[$position]['id2']) { @@ -282,7 +282,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $buttons[] = array( 'type' => 'done', 'name' => ts('Merge and View Result'), - 'icon' => 'circle-check' + 'icon' => 'circle-check', ); } diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 7823d4c21d..fb879abe72 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -86,7 +86,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { 'entity' => 'group_contact', 'label' => ts('in'), 'context' => 'search', - 'placeholder' => ts('- any group -') + 'placeholder' => ts('- any group -'), )); } @@ -97,7 +97,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { 'entity' => 'entity_tag', 'label' => ts('with'), 'context' => 'search', - 'placeholder' => ts('- any tag -') + 'placeholder' => ts('- any tag -'), )); } } @@ -243,7 +243,7 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { $this->_formValues['tag'][$tag] = 1; } - return; + return NULL; } /** diff --git a/CRM/Contact/Form/Search/Custom/Basic.php b/CRM/Contact/Form/Search/Custom/Basic.php index e2c7d55d24..bdeaf51a7d 100644 --- a/CRM/Contact/Form/Search/Custom/Basic.php +++ b/CRM/Contact/Form/Search/Custom/Basic.php @@ -72,7 +72,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo 'city', 'state_province', 'postal_code', - 'country' + 'country', )) && empty($addressOptions[$field]) ) { unset($this->_columns[$name]); @@ -112,7 +112,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo $this->_formValues['tag'][$tag] = 1; } - return; + return NULL; } /** @@ -155,7 +155,7 @@ class CRM_Contact_Form_Search_Custom_Basic extends CRM_Contact_Form_Search_Custo * * @return CRM_Contact_DAO_Contact */ - function all( + public function all( $offset = 0, $rowCount = 0, $sort = NULL, diff --git a/CRM/Contact/Form/Search/Custom/EventAggregate.php b/CRM/Contact/Form/Search/Custom/EventAggregate.php index 1b6ee7ad28..b1550153cf 100644 --- a/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -96,7 +96,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea 'end_date', 'show_payees', 'event_type_id', - 'event_id' + 'event_id', )); } @@ -110,7 +110,7 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea /** * Construct the search query */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { diff --git a/CRM/Contact/Form/Search/Custom/RandomSegment.php b/CRM/Contact/Form/Search/Custom/RandomSegment.php index 2ec16741fc..d638eb4755 100644 --- a/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -131,7 +131,7 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -376,6 +376,6 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear // the temporary tables are dropped automatically // so we don't do it here // but let mysql clean up - return; + return NULL; } } diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index 06a8da3243..aeb0976b8a 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -480,7 +480,7 @@ class CRM_Contact_Form_Task_EmailCommon { $count_success = count($form->_toContactDetails); CRM_Core_Session::setStatus(ts('One message was sent successfully.', array( 'plural' => '%count messages were sent successfully.', - 'count' => $count_success + 'count' => $count_success, )), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $count_success)), 'success'); } @@ -501,7 +501,7 @@ class CRM_Contact_Form_Task_EmailCommon { $status = '(' . ts('because no email address on file or communication preferences specify DO NOT EMAIL or Contact is deceased or Primary email address is On Hold') . ')'; CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array( 'count' => count($emailsNotSent), - 'plural' => '%count Messages Not Sent' + 'plural' => '%count Messages Not Sent', )), 'info'); } diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index 2e8d49da0e..b7cd6e02e9 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -113,7 +113,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio $params = array( 1 => array($contact_id, 'Integer'), - 2 => array($isTest, 'Integer') + 2 => array($isTest, 'Integer'), ); $cs = CRM_Core_DAO::executeQuery($query, $params); @@ -237,8 +237,8 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio * * @param int $contact_id * Contact id. - * @param int $isTest * @param string $filter + * @param int $isTest * Additional filter criteria, later used in where clause. * * @return array diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 43105ba5fb..ec4aa8b28d 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -840,6 +840,9 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr if (!empty($dupeParams['onbehalf'])) { unset($dupeParams['onbehalf']); } + if (!empty($dupeParams['honor'])) { + unset($dupeParams['honor']); + } $dedupeParams = CRM_Dedupe_Finder::formatParams($dupeParams, 'Individual'); $dedupeParams['check_permission'] = FALSE; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index b1dafd2d17..0823aac7c4 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -156,7 +156,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont 'pcp_display_in_roll', 'pcp_is_anonymous', 'pcp_roll_nickname', - 'pcp_personal_note' + 'pcp_personal_note', ) as $val) { if (!empty($this->_params[$val])) { $this->assign($val, $this->_params[$val]); @@ -242,7 +242,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont elseif (in_array($name, array( 'addressee', 'email_greeting', - 'postal_greeting' + 'postal_greeting', )) && !empty($contact[$name . '_custom']) ) { $defaults[$name . '_custom'] = $contact[$name . '_custom']; diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 152e371f6d..9c8ca81c6d 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -738,7 +738,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { 'last_name', 'suffix_id', 'organization_name', - 'household_name' + 'household_name', ); if ($profileContactType == 'honor' && in_array($field['name'], $honoreeNamefields)) { unset($fields[$field['name']]); @@ -887,7 +887,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { * When we get the control back from payment gate way * lets delete the recurring and related contribution. * - **/ + */ public function cancelRecurring() { $isCancel = CRM_Utils_Request::retrieve('cancel', 'Boolean', CRM_Core_DAO::$_nullObject); if ($isCancel) { diff --git a/CRM/Contribute/Form/ContributionPage/Custom.php b/CRM/Contribute/Form/ContributionPage/Custom.php index c561cc308b..7bca28df4e 100644 --- a/CRM/Contribute/Form/ContributionPage/Custom.php +++ b/CRM/Contribute/Form/ContributionPage/Custom.php @@ -59,7 +59,7 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co $entities[] = array( 'entity_name' => 'contribution_1', 'entity_type' => 'ContributionModel', - 'entity_sub_type' => '*' + 'entity_sub_type' => '*', ); // If applicable, register 'membership_1' @@ -69,7 +69,7 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co $entities[] = array( 'entity_name' => 'membership_1', 'entity_type' => 'MembershipModel', - 'entity_sub_type' => '*' + 'entity_sub_type' => '*', ); $allowCoreTypes[] = 'Membership'; $allowSubTypes['MembershipType'] = explode(',', $member['membership_types']); diff --git a/CRM/Contribute/Form/ContributionPage/TabHeader.php b/CRM/Contribute/Form/ContributionPage/TabHeader.php index 5f73c80864..0b6762136f 100644 --- a/CRM/Contribute/Form/ContributionPage/TabHeader.php +++ b/CRM/Contribute/Form/ContributionPage/TabHeader.php @@ -54,7 +54,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { ->addSetting(array( 'tabSettings' => array( 'active' => self::getCurrentTab($tabs), - ) + ), )); return $tabs; } @@ -171,8 +171,7 @@ class CRM_Contribute_Form_ContributionPage_TabHeader { $tabs[$key]['qfKey'] = NULL; } - $tabs[$key]['link'] = - CRM_Utils_System::url( + $tabs[$key]['link'] = CRM_Utils_System::url( "civicrm/admin/contribute/{$key}", "{$reset}action=update&id={$contribPageId}{$tabs[$key]['qfKey']}" ); diff --git a/CRM/Contribute/Form/Task/Delete.php b/CRM/Contribute/Form/Task/Delete.php index 0cf8ff2dcb..12cae6507b 100644 --- a/CRM/Contribute/Form/Task/Delete.php +++ b/CRM/Contribute/Form/Task/Delete.php @@ -53,7 +53,7 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviContribute', CRM_Core_Action::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); @@ -86,7 +86,7 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task { } $status = ts('Deleted Contribution(s): %1 (Total Selected: %2) ', array( 1 => $deletedContributions, - 2 => count($this->_contributionIds) + 2 => count($this->_contributionIds), )); CRM_Core_Session::setStatus($status, '', 'info'); } diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 75260e9e2a..25d1b94929 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -53,7 +53,7 @@ class CRM_Contribute_Form_Task_PDF extends CRM_Contribute_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE ); @@ -94,7 +94,7 @@ AND {$this->_componentClause}"; array( 'url' => $url, 'title' => ts('Search Results'), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); diff --git a/CRM/Contribute/Form/Task/PickProfile.php b/CRM/Contribute/Form/Task/PickProfile.php index 5e263e65d6..6b755636e3 100644 --- a/CRM/Contribute/Form/Task/PickProfile.php +++ b/CRM/Contribute/Form/Task/PickProfile.php @@ -73,7 +73,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { if (count($this->_contributionIds) > $this->_maxContributions) { CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array( 1 => $this->_maxContributions, - 2 => count($this->_contributionIds) + 2 => count($this->_contributionIds), )), ts('Batch Update Error'), 'error'); $validate = TRUE; } @@ -102,7 +102,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'), array( - '' => ts('- select profile -') + '' => ts('- select profile -'), ) + $profiles, TRUE ); $this->addDefaultButtons(ts('Continue')); diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 10a8b7c4d6..2f6cd9f1d3 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -430,11 +430,13 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $session->setStatus($status, $msgTitle, $msgType); } elseif (!$userID) { - if ($status) + if ($status) { CRM_Utils_System::setUFMessage($status); + } $result = (int) ($updateSubscription && isset($ctype)); - if (isset($tplParams)) + if (isset($tplParams)) { $session->set('resultParams', $tplParams); + } return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus', "reset=1&task=billing&result={$result}")); } diff --git a/CRM/Contribute/Import/Form/MapField.php b/CRM/Contribute/Import/Form/MapField.php index 3ee66a3ae9..6b367225ae 100644 --- a/CRM/Contribute/Import/Form/MapField.php +++ b/CRM/Contribute/Import/Form/MapField.php @@ -79,7 +79,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField { foreach (array( 'contribution_id', 'invoice_id', - 'trxn_id' + 'trxn_id', ) as $key) { $this->_mapperFields[$key] .= ' (match to contribution record)'; $highlightedFields[] = $key; @@ -92,7 +92,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField { 'email', 'first_name', 'last_name', - 'external_identifier' + 'external_identifier', ); foreach ($highlightedFieldsArray as $name) { $highlightedFields[] = $name; diff --git a/CRM/Core/CommunityMessages.php b/CRM/Core/CommunityMessages.php index a9b7a0648d..83c00071ed 100644 --- a/CRM/Core/CommunityMessages.php +++ b/CRM/Core/CommunityMessages.php @@ -224,10 +224,10 @@ class CRM_Core_CommunityMessages { * @return bool */ public function validateDocument($document) { - if (!isset($document['ttl']) || !is_integer($document['ttl'])) { + if (!isset($document['ttl']) || !is_int($document['ttl'])) { return FALSE; } - if (!isset($document['retry']) || !is_integer($document['retry'])) { + if (!isset($document['retry']) || !is_int($document['retry'])) { return FALSE; } if (!isset($document['messages']) || !is_array($document['messages'])) { diff --git a/CRM/Core/Component/Info.php b/CRM/Core/Component/Info.php index 6100cedd0b..6231f4a5c6 100644 --- a/CRM/Core/Component/Info.php +++ b/CRM/Core/Component/Info.php @@ -229,7 +229,7 @@ abstract class CRM_Core_Component_Info { * Provides information whether given component is currently * marked as enabled in configuration. * - * @return boolean + * @return bool * true if component is enabled, false if not */ public function isEnabled() { @@ -322,7 +322,7 @@ abstract class CRM_Core_Component_Info { /** * Provides information whether given component uses system wide search. * - * @return boolean + * @return bool * true if component needs search integration */ public function usesSearch() { diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index b19c280016..4dbe82f381 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -45,7 +45,7 @@ class CRM_Core_ManagedEntities { CRM_Core_Transaction::addCallback( CRM_Core_Transaction::PHASE_POST_COMMIT, function () { - CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); + CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); }, array(), 'ManagedEntities::reconcile' diff --git a/CRM/Core/Smarty/plugins/function.isValueChange.php b/CRM/Core/Smarty/plugins/function.isValueChange.php index 4d0f78af95..5818f1e052 100644 --- a/CRM/Core/Smarty/plugins/function.isValueChange.php +++ b/CRM/Core/Smarty/plugins/function.isValueChange.php @@ -57,7 +57,7 @@ function smarty_function_isValueChange($params, &$smarty) { if (empty($params['key'])) { $smarty->trigger_error("Missing required parameter, 'key', in isValueChange plugin."); - return; + return NULL; } $is_changed = FALSE; @@ -85,5 +85,5 @@ function smarty_function_isValueChange($params, &$smarty) { $smarty->assign($params['assign'], $is_changed); } - return; + return NULL; } diff --git a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php index 0c847f9139..641f4fb54b 100644 --- a/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php +++ b/CRM/Core/Smarty/plugins/modifier.crmNumberFormat.php @@ -49,8 +49,8 @@ * @return string * the formatted string * - * For alternate decimal point and thousands separator, delimit values with single quotes in the template. - * EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56 + * For alternate decimal point and thousands separator, delimit values with single quotes in the template. + * EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56 */ function smarty_modifier_crmNumberFormat($number, $decimals = NULL, $dec_point = NULL, $thousands_sep = NULL) { if (is_numeric($number)) { diff --git a/CRM/Core/StateMachine.php b/CRM/Core/StateMachine.php index 5ccb534066..f858b97880 100644 --- a/CRM/Core/StateMachine.php +++ b/CRM/Core/StateMachine.php @@ -111,7 +111,7 @@ class CRM_Core_StateMachine { /** * Setter for name * - * @param string + * @param string $name * * @return void */ @@ -394,7 +394,7 @@ class CRM_Core_StateMachine { * beginning from the final state, but retain the same session * values * - * @return boolean + * @return bool */ public function shouldReset() { return TRUE; diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php index 06d26d3da6..f27f8501af 100644 --- a/CRM/Custom/Form/ChangeFieldType.php +++ b/CRM/Custom/Form/ChangeFieldType.php @@ -112,7 +112,7 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { 'dst_html_type', ts('New HTML Type'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $this->_htmlTypeTransitions, TRUE ); @@ -168,7 +168,7 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { if ($dstHtmlType == 'Text' && in_array($srcHtmlType, array( 'Select', 'Radio', - 'Autocomplete-Select' + 'Autocomplete-Select', )) ) { $customField->option_group_id = "NULL"; diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index 0be813e09b..fc08631793 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -74,7 +74,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { * @return mixed * @throws Exception */ - function run( + public function run( $fileName, $separator = ',', &$mapper, @@ -291,7 +291,7 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { * Given a list of the importable field keys that the user has selected * set the active fields array to this list * - * @param array mapped array of values + * @param array $fieldKeys mapped array of values * * @return void */ diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index 2003d472f0..9c3baf3e18 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -53,7 +53,6 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { /** * Get the action links for this page. * - * @param null * * @return array * array of action links that we need to display for the browse screen @@ -108,8 +107,6 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * type of action and executes that action. * Finally it calls the parent's run method. * - * @param null - * * @return void */ public function run() { diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php index 37c9a941b9..ceead104b3 100644 --- a/CRM/Dedupe/BAO/Rule.php +++ b/CRM/Dedupe/BAO/Rule.php @@ -188,7 +188,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { /** * find fields related to a rule group. * - * @param array contains the rule group property to identify rule group + * @param array $params contains the rule group property to identify rule group * * @return array * rule fields array associated to rule group @@ -217,7 +217,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { */ public static function validateContacts($cid, $oid) { if (!$cid || !$oid) { - return; + return NULL; } $exception = new CRM_Dedupe_DAO_Exception(); $exception->contact_id1 = $cid; diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index 0ef208d6c7..d557b4f2ec 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -413,7 +413,6 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { /** * Get all of the combinations of fields that would work with a rule */ - public static function combos($rgFields, $threshold, &$combos, $running = array()) { foreach ($rgFields as $rgField => $weight) { unset($rgFields[$rgField]); @@ -451,8 +450,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { $dao->find(); $result = array(); while ($dao->fetch()) { - $title = - !empty($dao->title) ? $dao->title : (!empty($dao->name) ? $dao->name : $dao->contact_type); + $title = !empty($dao->title) ? $dao->title : (!empty($dao->name) ? $dao->name : $dao->contact_type); $name = "$title - {$dao->used}"; $result[$dao->id] = $name; diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 094b399621..3c6b053a71 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -95,7 +95,7 @@ class CRM_Dedupe_Finder { * @return array * matching contact ids */ - static function dupesByParams( + public static function dupesByParams( $params, $ctype, $used = 'Unsupervised', @@ -236,7 +236,7 @@ class CRM_Dedupe_Finder { // handle {birth,deceased}_date foreach (array( 'birth_date', - 'deceased_date' + 'deceased_date', ) as $date) { if (!empty($fields[$date])) { $flat[$date] = $fields[$date]; diff --git a/CRM/Event/Cart/BAO/EventInCart.php b/CRM/Event/Cart/BAO/EventInCart.php index b9f661a0d9..03f34e0ce3 100644 --- a/CRM/Event/Cart/BAO/EventInCart.php +++ b/CRM/Event/Cart/BAO/EventInCart.php @@ -26,7 +26,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl /** * @param array $params * - * @return $this|CRM_Event_Cart_BAO_EventInCart + * @return object $this|CRM_Event_Cart_BAO_EventInCart * @throws Exception */ public static function create(&$params) { diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index e5628f00e7..65c786ad13 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -239,7 +239,7 @@ class CRM_Event_Form_EventFees { 'payment_instrument_id', 'contribution_status_id', 'receive_date', - 'total_amount' + 'total_amount', ) as $f) { if ($f == 'receive_date') { list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f); @@ -401,7 +401,7 @@ SELECT id, html_type $element = $form->add('select', 'discount_id', ts('Discount Set'), array( - 0 => ts('- select -') + 0 => ts('- select -'), ) + $discounts, FALSE, array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );") diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 53644e2287..0f839ca6d4 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -210,7 +210,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { array( 'title' => ts('Manage Events'), 'url' => $this->_doneUrl, - ) + ), ); } } @@ -220,7 +220,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { array( 'title' => ts('Manage Event Templates'), 'url' => $this->_doneUrl, - ) + ), ); } CRM_Utils_System::appendBreadCrumb($breadCrumb); diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 5b8a68bcdc..b1497f644d 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -147,8 +147,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { foreach ($discountFields['options'] as $discountFieldsval) { $defaults['discounted_label'][$discountFieldsval['weight']] = $discountFieldsval['label']; - $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] = - CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a'); + $defaults['discounted_value'][$discountFieldsval['weight']][$rowCount] = CRM_Utils_Money::format($discountFieldsval['amount'], NULL, '%a'); $defaults['discount_option_id'][$rowCount][$discountFieldsval['weight']] = $discountFieldsval['id']; if (!empty($discountFieldsval['is_default'])) { $defaults['discounted_default'] = $discountFieldsval['weight']; @@ -297,7 +296,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { } $this->add('select', 'price_set_id', ts('Price Set'), array( - '' => ts('- none -') + '' => ts('- none -'), ) + $price, NULL, array('onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);") ); diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php index 1759544f7c..829545b6d3 100644 --- a/CRM/Event/Form/ManageEvent/Location.php +++ b/CRM/Event/Form/ManageEvent/Location.php @@ -204,9 +204,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { $this->addRadio('location_option', ts("Choose Location"), $optionTypes); if (!isset($locationEvents[$this->_oldLocBlockId]) || (!$this->_oldLocBlockId)) { - $locationEvents = array( - '' => ts('- select -') - ) + $locationEvents; + $locationEvents = array('' => ts('- select -')) + $locationEvents; } $this->add('select', 'loc_event_id', ts('Use Location'), $locationEvents); } @@ -260,7 +258,7 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { foreach (array( 'address', 'phone', - 'email' + 'email', ) as $block) { if (empty($params[$block]) || !is_array($params[$block])) { continue; diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index 54198ece0a..7c2f97e83d 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -55,7 +55,7 @@ class CRM_Event_Form_ManageEvent_TabHeader { ->addSetting(array( 'tabSettings' => array( 'active' => self::getCurrentTab($tabs), - ) + ), )); CRM_Event_Form_ManageEvent::addProfileEditScripts(); return $tabs; diff --git a/CRM/Mailing/Event/BAO/Bounce.php b/CRM/Mailing/Event/BAO/Bounce.php index 4026d5181f..b359e4fbc9 100755 --- a/CRM/Mailing/Event/BAO/Bounce.php +++ b/CRM/Mailing/Event/BAO/Bounce.php @@ -266,8 +266,7 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce { 'name' => "{$dao->display_name}", 'email' => $dao->email, // FIXME: translate this - 'type' => (empty($dao->bounce_type) - ? ts('Unknown') : $dao->bounce_type + 'type' => (empty($dao->bounce_type) ? ts('Unknown') : $dao->bounce_type ), 'reason' => $dao->reason, 'date' => CRM_Utils_Date::customFormat($dao->date), diff --git a/CRM/Queue/Task.php b/CRM/Queue/Task.php index 682b192c35..5342b59bb3 100644 --- a/CRM/Queue/Task.php +++ b/CRM/Queue/Task.php @@ -30,10 +30,14 @@ */ class CRM_Queue_Task { - /** Task was performed successfully */ + /** + * Task was performed successfully + */ const TASK_SUCCESS = 1; - /** Task failed and should not be retried */ + /** + * Task failed and should not be retried + */ const TASK_FAIL = 2; /** diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index 13ad8c1980..6dbabefc87 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -277,9 +277,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} $this->_where = "WHERE {$this->_aliases['civicrm_contact']}.employer_id!='null' "; } else { - $this->_where = - "WHERE ({$this->_aliases['civicrm_contact']}.employer_id!='null') AND " . - implode(' AND ', $clauses); + $this->_where = "WHERE ({$this->_aliases['civicrm_contact']}.employer_id!='null') AND " . implode(' AND ', $clauses); } if ($this->_aclWhere) { diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index 8f2a0db86f..2a8aadfb30 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -281,9 +281,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params); if ($op) { if ($fieldName == 'relationship_type_id') { - $clause = - "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" . - $this->relationshipId; + $clause = "{$this->_aliases['civicrm_relationship']}.relationship_type_id=" . $this->relationshipId; } else { $clause = $this->whereClause($field, @@ -452,10 +450,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { $this->_absoluteUrl ); - $rows[$rowNum]['civicrm_contact_household_household_name'] = - "" . $value . - ''; + $rows[$rowNum]['civicrm_contact_household_household_name'] = "" . $value . ''; } $entryFound = TRUE; } diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php index 72709a3ea6..60fdc848e7 100644 --- a/CRM/Report/Form/Contribute/PCP.php +++ b/CRM/Report/Form/Contribute/PCP.php @@ -264,11 +264,11 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' public function statistics(&$rows) { $statistics = parent::statistics($rows); - $select = - "SELECT SUM({$this->_aliases['civicrm_pcp']}.goal_amount) as goal_total, " . - "SUM({$this->_aliases['civicrm_contribution_soft']}.amount) as committed_total, " . - "COUNT({$this->_aliases['civicrm_contribution_soft']}.id) as donors_total, " . - "SUM(IF( contribution_civireport.contribution_status_id > 1, 0, contribution_soft_civireport.amount)) AS received_total "; + $select + = "SELECT SUM({$this->_aliases['civicrm_pcp']}.goal_amount) as goal_total, " . + "SUM({$this->_aliases['civicrm_contribution_soft']}.amount) as committed_total, " . + "COUNT({$this->_aliases['civicrm_contribution_soft']}.id) as donors_total, " . + "SUM(IF( contribution_civireport.contribution_status_id > 1, 0, contribution_soft_civireport.amount)) AS received_total "; $sql = "{$select} {$this->_from} {$this->_where}"; $dao = CRM_Core_DAO::executeQuery($sql); $dao->fetch(); diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index f564082d70..facd4c6e81 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -490,7 +490,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { 'bounce_rate', 'open_rate', 'CTR', - 'CTO' + 'CTO', ))) { $isError = FALSE; } @@ -499,7 +499,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { if ($isError) { $errors['_qf_default'] = ts('For Chart view, please select at least one field from %1 OR %2.', array( 1 => implode(', ', $criterias['count']), - 2 => implode(', ', $criterias['rate']) + 2 => implode(', ', $criterias['rate']), )); } diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 81e2f42238..de8eb9fe25 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -241,8 +241,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { } if (!empty($this->_params['group_bys_freq'][$fieldName])) { $this->_interval = $field['title']; - $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = - $field['title'] . ' Beginning'; + $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] = $field['title'] . ' Beginning'; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type']; $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['group_by'] = $this->_params['group_bys_freq'][$fieldName]; @@ -339,8 +338,6 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { ON payment.contribution_id = {$this->_aliases['civicrm_contribution']}.id"; } - // end of from - public function where() { $this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0 AND {$this->_aliases['civicrm_contact']}.is_deleted = 0"; @@ -413,9 +410,7 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency $totalAmount = $average = array(); $count = $memberCount = 0; while ($dao->fetch()) { - $totalAmount[] = - CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . - $dao->count . ")"; + $totalAmount[] = CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . $dao->count . ")"; $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency); $count += $dao->count; $memberCount += $dao->memberCount; diff --git a/CRM/SMS/Form/Group.php b/CRM/SMS/Form/Group.php index f65ee7629f..66c4cf3c07 100644 --- a/CRM/SMS/Form/Group.php +++ b/CRM/SMS/Form/Group.php @@ -192,7 +192,7 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { foreach (array( 'name', 'group_id', - 'is_sms' + 'is_sms', ) as $n) { if (!empty($values[$n])) { $params[$n] = $values[$n]; @@ -253,7 +253,7 @@ class CRM_SMS_Form_Group extends CRM_Contact_Form_Task { // delete previous includes/excludes, if mailing already existed foreach (array( 'groups', - 'mailings' + 'mailings', ) as $entity) { $mg = new CRM_Mailing_DAO_MailingGroup(); $mg->mailing_id = $ids['mailing_id']; diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index b73f4e7664..75d4e95ad2 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -55,7 +55,7 @@ class CRM_Utils_Address { * formatted address string * */ - static function format( + public static function format( $fields, $format = NULL, $microformat = FALSE, @@ -66,13 +66,11 @@ class CRM_Utils_Address { static $config = NULL; if (!$format) { - $format = - CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format'); + $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_format'); } if ($mailing) { - $format = - CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format'); + $format = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'mailing_format'); } $formatted = $format; diff --git a/CRM/Utils/Address/BatchUpdate.php b/CRM/Utils/Address/BatchUpdate.php index 5a890d4b51..0b0ccdb5cb 100644 --- a/CRM/Utils/Address/BatchUpdate.php +++ b/CRM/Utils/Address/BatchUpdate.php @@ -256,16 +256,16 @@ class CRM_Utils_Address_BatchUpdate { } $this->returnMessages[] = ts("Addresses Evaluated: %1", array( - 1 => $totalAddresses + 1 => $totalAddresses, )) . "\n"; if ($processGeocode) { $this->returnMessages[] = ts("Addresses Geocoded: %1", array( - 1 => $totalGeocoded + 1 => $totalGeocoded, )) . "\n"; } if ($parseStreetAddress) { $this->returnMessages[] = ts("Street Addresses Parsed: %1", array( - 1 => $totalAddressParsed + 1 => $totalAddressParsed, )) . "\n"; if ($unparseableContactAddress) { $this->returnMessages[] = "
\n" . ts("Following is the list of contacts whose address is not parsed:") . "
\n"; diff --git a/api/v3/ActionSchedule.php b/api/v3/ActionSchedule.php index bd4899699f..1d89f72b3a 100644 --- a/api/v3/ActionSchedule.php +++ b/api/v3/ActionSchedule.php @@ -53,7 +53,7 @@ function civicrm_api3_action_schedule_get($params) { * * @return array * - * {@getfields action_schedule_create} + * {@getfields action_schedule_create} */ function civicrm_api3_action_schedule_create($params) { civicrm_api3_verify_one_mandatory($params, NULL, array('start_action_date', 'absolute_date')); diff --git a/api/v3/PaymentProcessor.php b/api/v3/PaymentProcessor.php index 9385eb1473..a21a22c37d 100644 --- a/api/v3/PaymentProcessor.php +++ b/api/v3/PaymentProcessor.php @@ -78,10 +78,9 @@ function civicrm_api3_payment_processor_delete($params) { /** * Retrieve one or more PaymentProcessor * - * @param mixed[] (reference) input parameters - * {@getfields payment_processor_get} * @param array $params * An associative array of name/value pairs. + * {@getfields payment_processor_get} * * @return array * details of found PaymentProcessor diff --git a/bin/deprecated/UpdateMembershipRecord.php b/bin/deprecated/UpdateMembershipRecord.php index 8c6140fd9c..715ae814c6 100644 --- a/bin/deprecated/UpdateMembershipRecord.php +++ b/bin/deprecated/UpdateMembershipRecord.php @@ -45,7 +45,7 @@ class CRM_UpdateMembershipRecord { /** */ - function __construct() { + public function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { require_once "cli.php"; @@ -66,7 +66,7 @@ class CRM_UpdateMembershipRecord { } } - function initialize() { + public function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; diff --git a/bin/deprecated/UpdateMembershipReminderDate.php b/bin/deprecated/UpdateMembershipReminderDate.php index c511bd3d46..03297634bb 100644 --- a/bin/deprecated/UpdateMembershipReminderDate.php +++ b/bin/deprecated/UpdateMembershipReminderDate.php @@ -37,7 +37,7 @@ class CRM_UpdateMembershipReminderDate { /** */ - function __construct() { + public function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { require_once "cli.php"; @@ -58,7 +58,7 @@ class CRM_UpdateMembershipReminderDate { } } - function initialize() { + public function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; diff --git a/bin/deprecated/UpdatePledgeRecord.php b/bin/deprecated/UpdatePledgeRecord.php index 1170098959..31f9bebd1e 100644 --- a/bin/deprecated/UpdatePledgeRecord.php +++ b/bin/deprecated/UpdatePledgeRecord.php @@ -42,7 +42,7 @@ require_once 'CRM/Core/Config.php'; class CRM_UpdatePledgeRecord { /** */ - function __construct() { + public function __construct() { $config = CRM_Core_Config::singleton(); // this does not return on failure require_once 'CRM/Utils/System.php'; @@ -72,7 +72,7 @@ class CRM_UpdatePledgeRecord { foreach (array( 'Completed', 'Cancelled', - 'Failed' + 'Failed', ) as $statusKey) { if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) { unset($allStatus[$key]); diff --git a/bin/deprecated/action.cronjob.php b/bin/deprecated/action.cronjob.php index bd24f1812f..689cda3edb 100644 --- a/bin/deprecated/action.cronjob.php +++ b/bin/deprecated/action.cronjob.php @@ -35,7 +35,7 @@ class CRM_Cron_Action { /** */ - function __construct() { + public function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { require_once "cli.php"; @@ -56,7 +56,7 @@ class CRM_Cron_Action { } } - function initialize() { + public function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; diff --git a/bin/migrate/move.php b/bin/migrate/move.php index c2c15d9d11..154722b3b5 100644 --- a/bin/migrate/move.php +++ b/bin/migrate/move.php @@ -24,6 +24,14 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ */ + +/** + * + * @package CRM + * @copyright CiviCRM LLC (c) 2004-2014 + * $Id$ + * + */ function run() { session_start(); diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index 5b477a7a32..69838daa40 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -72,7 +72,7 @@ function generateJoomlaConfig($version) { $output = $targetDir . '/civicrm.xml'; $fd = fopen($output, "w"); - fputs($fd, $xml); + fwrite($fd, $xml); fclose($fd); require_once 'CRM/Core/Config.php'; @@ -106,6 +106,6 @@ function generateJoomlaConfig($version) { $output = $targetDir . '/admin/access.xml'; $xml = $smarty->fetch('access.tpl'); $fd = fopen($output, "w"); - fputs($fd, $xml); + fwrite($fd, $xml); fclose($fd); } diff --git a/settings/Event.setting.php b/settings/Event.setting.php index f745135acf..8ba2580c81 100644 --- a/settings/Event.setting.php +++ b/settings/Event.setting.php @@ -37,18 +37,18 @@ */ return array( 'event_enable_cart' => - array( - 'name' => 'enable_cart', - 'group_name' => 'Event Preferences', - 'group' => 'event', - 'type' => 'String', - 'quick_form_type' => 'Element', - 'default' => 0, - 'add' => 4.1, - 'title' => 'Enable Event Cart', - 'is_domain' => 1, - 'is_contact' => 1, - 'description' => "WRITE ME", - 'help_text' => 'WRITE ME', - ), + array( + 'name' => 'enable_cart', + 'group_name' => 'Event Preferences', + 'group' => 'event', + 'type' => 'String', + 'quick_form_type' => 'Element', + 'default' => 0, + 'add' => 4.1, + 'title' => 'Enable Event Cart', + 'is_domain' => 1, + 'is_contact' => 1, + 'description' => "WRITE ME", + 'help_text' => 'WRITE ME', + ), ); diff --git a/tests/phpunit/CRM/Core/AllTests.php b/tests/phpunit/CRM/Core/AllTests.php index 7460038140..f5776e64e6 100644 --- a/tests/phpunit/CRM/Core/AllTests.php +++ b/tests/phpunit/CRM/Core/AllTests.php @@ -47,7 +47,7 @@ class CRM_Core_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/CRM/Member/Form/AllTests.php b/tests/phpunit/CRM/Member/Form/AllTests.php index 19e91eb4c8..1d52d81ba7 100644 --- a/tests/phpunit/CRM/Member/Form/AllTests.php +++ b/tests/phpunit/CRM/Member/Form/AllTests.php @@ -47,7 +47,7 @@ class CRM_Member_Form_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index bf3f11d037..739549324d 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -67,8 +67,9 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { } } -/* --- Library of test hook implementations ---- */ - +/** + * Library of test hook implementations + */ function hooktesta_civicrm_testRunHooks_outer() { $test = CRM_Utils_HookTest::$activeTest; $test->log[] = 'a-outer'; @@ -100,8 +101,9 @@ function hooktesta_civicrm_testRunHooks_merge() { return array('from-module-a1', 'from-module-a2'); } -// OMIT: function hooktestb_civicrm_testRunHooks_merge - +/** + * OMIT: function hooktestb_civicrm_testRunHooks_merge + */ function hooktestc_civicrm_testRunHooks_merge() { return array(); } diff --git a/tests/phpunit/Civi/API/RequestTest.php b/tests/phpunit/Civi/API/RequestTest.php index f2e068f618..1c281b5144 100644 --- a/tests/phpunit/Civi/API/RequestTest.php +++ b/tests/phpunit/Civi/API/RequestTest.php @@ -36,7 +36,7 @@ class RequestTest extends \CiviUnitTestCase { 'option.limit' => 15, 'option.foo' => array('bar'), 'options' => array('whiz' => 'bang'), - 'optionnotreally' => 'data' + 'optionnotreally' => 'data', ), // requestParams array('limit' => 15, 'foo' => array('bar'), 'whiz' => 'bang'), // expectedOptions array('optionnotreally' => 'data'), // expectedData @@ -48,7 +48,7 @@ class RequestTest extends \CiviUnitTestCase { 'return' => array('field1', 'field2'), 'return.field3' => 1, 'return.field4' => 0, - 'returnontreally' => 'data' + 'returnontreally' => 'data', ), // requestParams array('return' => array('field1', 'field2', 'field3')), // expectedOptions array('returnontreally' => 'data'), // expectedData diff --git a/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php b/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php index 8d82c8e482..9f8d2f8057 100644 --- a/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php +++ b/tests/phpunit/Civi/API/Subscriber/DynamicFKAuthorizationTest.php @@ -150,13 +150,13 @@ class DynamicFKAuthorizationTest extends \CiviUnitTestCase { 'FakeFile', 'create', array(), - "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/" + "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/", ); $cases[] = array( 'FakeFile', 'get', array(), - "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/" + "/Mandatory key\\(s\\) missing from params array: 'id' or 'entity_table/", ); $cases[] = array('FakeFile', 'create', array('entity_table' => 'unknown'), '/Unrecognized target entity/'); diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index e3d1f94d4f..352e124a86 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -47,7 +47,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { 'edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', - 'edit-2-delete-in-civicase' + 'edit-2-delete-in-civicase', ); $this->changePermissions($permission); @@ -98,7 +98,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { 'edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', - 'edit-2-delete-in-civicase' + 'edit-2-delete-in-civicase', ); $this->changePermissions($permission); diff --git a/tests/phpunit/WebTest/Case/AddCaseTest.php b/tests/phpunit/WebTest/Case/AddCaseTest.php index 0ebe8fbf76..c1f042e1c2 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTest.php @@ -47,7 +47,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { 'edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', - 'edit-2-delete-in-civicase' + 'edit-2-delete-in-civicase', ); $this->changePermissions($permission); @@ -155,7 +155,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { 'edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', - 'edit-2-delete-in-civicase' + 'edit-2-delete-in-civicase', ); $this->changePermissions($permission); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 4f54d09b14..7277a22f5f 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -264,7 +264,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Fee_upload_done-bottom'); $this->click('CIVICRM_QFID_1_is_monetary'); $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']"); - $this->select('financial_type_id','label=Event Fee'); + $this->select('financial_type_id', 'label=Event Fee'); $this->select('price_set_id', 'label=' . $setTitle); // intro text for registration page diff --git a/tests/phpunit/api/v3/AllTests.php b/tests/phpunit/api/v3/AllTests.php index ba828c6cc9..9e3409fb41 100644 --- a/tests/phpunit/api/v3/AllTests.php +++ b/tests/phpunit/api/v3/AllTests.php @@ -48,7 +48,7 @@ class api_v3_AllTests extends CiviTestSuite { * @param string $theClass * @param string $name */ - function __construct($theClass = '', $name = '') { + public function __construct($theClass = '', $name = '') { parent::__construct($theClass, $name); } @@ -56,7 +56,7 @@ class api_v3_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index de1e20dee8..9688a712bf 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -90,7 +90,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { array('label' => 'my goat', 'value' => 'goat', 'is_active' => TRUE, 'weight' => 2), array('label' => 'mohair', 'value' => 'wool', 'is_active' => TRUE, 'weight' => 3), array('label' => 'hungry', 'value' => '', 'is_active' => TRUE, 'weight' => 3), - ) + ), )); $columnName = $result['values'][$result['id']]['column_name']; $ids['custom_field_id'] = $result['id']; @@ -157,14 +157,13 @@ class api_v3_GrantTest extends CiviUnitTestCase { $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); } - /* - * This is a test to check if setting fields one at a time alters other fields - * Issues Hit so far = - * 1) Currency keeps getting reset to USD - BUT this may be the only enabled currency - * - in which case it is valid - * 2) - */ - + /** + * This is a test to check if setting fields one at a time alters other fields + * Issues Hit so far = + * 1) Currency keeps getting reset to USD - BUT this may be the only enabled currency + * - in which case it is valid + * 2) + */ public function testCreateAutoGrant() { $entityName = $this->_entity; $baoString = 'CRM_Grant_BAO_Grant'; diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index baa5ad2b37..9e098b5b76 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -82,7 +82,9 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { ); } - ///////////////// civicrm_group_contact_get methods + /** + * civicrm_group_contact_get methods + */ public function testGet() { $params = array( 'contact_id' => $this->_contactId, @@ -160,7 +162,9 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { $this->assertEquals($result['total_count'], 2, "in line " . __LINE__); } - ///////////////// civicrm_group_contact_remove methods + /** + * civicrm_group_contact_remove methods + */ public function testDelete() { $params = array( 'contact_id' => $this->_contactId, diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index a0086acdc0..72af35eaf7 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -189,7 +189,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { 'note' => 'note', 'contact_id' => $this->_contactID, 'modified_date' => '2011-01-31', - 'subject' => NULL + 'subject' => NULL, ); try { @@ -255,7 +255,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { 'end_date' => '', 'membership_end_date' => '0', 'join_date' => '2010-12-20', - 'membership_start_date' => '2010-12-20' + 'membership_start_date' => '2010-12-20', ); $fields = civicrm_api3('Membership', 'getfields', array('action' => 'get')); _civicrm_api3_validate_fields('Membership', 'get', $params, $fields['values']);