From d5cc0fc2b73ee915b099c24272e006af803fd8a4 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Thu, 15 Jan 2015 13:13:11 +0530 Subject: [PATCH] Fixed code after cleanup test --- CRM/Campaign/Form/Survey/Results.php | 73 ++++++++----------- CRM/Case/StateMachine/Search.php | 2 +- CRM/Contact/Form/Edit/Email.php | 2 +- .../Form/Search/Custom/ActivitySearch.php | 2 +- CRM/Contact/Form/Task/AddToHousehold.php | 15 ++-- CRM/Contact/Form/Task/Print.php | 2 +- CRM/Contact/Form/Task/SaveSearch.php | 3 +- CRM/Contribute/Page/ContributionRecur.php | 2 +- CRM/Core/Action.php | 4 +- CRM/Core/InnoDBIndexer.php | 2 +- CRM/Core/Page/Angular.php | 14 ++-- CRM/Core/Page/Basic.php | 13 ++-- CRM/Core/Payment/Elavon.php | 2 +- CRM/Core/Payment/FirstData.php | 27 ++++--- CRM/Core/Payment/PayPalProIPN.php | 14 ++-- CRM/Event/BAO/ParticipantStatusType.php | 12 +-- CRM/Event/Badge.php | 12 +-- CRM/Event/Form/ManageEvent/Registration.php | 12 +-- CRM/Event/Import/Form/Summary.php | 2 +- CRM/Mailing/BAO/Recipients.php | 2 +- CRM/Mailing/Event/BAO/Delivered.php | 2 +- CRM/Member/Import/Parser/Membership.php | 10 +-- CRM/PCP/BAO/PCP.php | 12 +-- CRM/PCP/Form/Event.php | 4 +- CRM/Price/BAO/PriceField.php | 14 ++-- CRM/Profile/Form.php | 13 ++-- CRM/Report/Form/Contribute/LoggingDetail.php | 2 +- CRM/Report/Form/Extended.php | 19 +++-- CRM/Utils/Array.php | 14 ++-- CRM/Utils/Date.php | 12 +-- CRM/Utils/Migrate/Export.php | 2 +- CRM/Utils/REST.php | 14 ++-- CRM/Utils/System/Base.php | 14 ++-- CRM/Utils/System/Soap.php | 12 ++- Civi/Core/Transaction/Manager.php | 4 +- api/v3/Contact.php | 10 +-- api/v3/UFMatch.php | 4 +- tests/phpunit/AllTests.php | 2 +- tests/phpunit/CRM/Bridge/OG/DrupalTest.php | 2 +- .../OfflineMembershipAddPricesetTest.php | 4 +- .../WebTest/Member/StandaloneAddTest.php | 2 +- tests/phpunit/api/v3/UFJoinTest.php | 2 +- 42 files changed, 187 insertions(+), 204 deletions(-) diff --git a/CRM/Campaign/Form/Survey/Results.php b/CRM/Campaign/Form/Survey/Results.php index 70e49c6571..039ef71573 100644 --- a/CRM/Campaign/Form/Survey/Results.php +++ b/CRM/Campaign/Form/Survey/Results.php @@ -77,8 +77,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { * 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 */ @@ -100,8 +98,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -344,8 +340,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -415,23 +409,21 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { if (!$this->_reportId && $survey->id && !empty($params['create_report'])) { $activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); $activityStatus = array_flip($activityStatus); - $this->_params = - array( - 'name' => "survey_{$survey->id}", - 'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'], - 'status_id_op' => 'eq', - 'status_id_value' => $activityStatus['Scheduled'], // reserved status - 'survey_id_value' => array($survey->id), - 'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'), - ); + $this->_params = array( + 'name' => "survey_{$survey->id}", + 'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'], + 'status_id_op' => 'eq', + 'status_id_value' => $activityStatus['Scheduled'], // reserved status + 'survey_id_value' => array($survey->id), + 'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'), + ); //Default value of order by - $this->_params['order_bys'] = - array( - 1 => array( - 'column' => 'sort_name', - 'order' => 'ASC', - ), - ); + $this->_params['order_bys'] = array( + 1 => array( + 'column' => 'sort_name', + 'order' => 'ASC', + ), + ); // for WalkList or default $displayFields = array( 'id', @@ -445,25 +437,24 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey { if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_values['activity_type_id'] ) { - $this->_params['order_bys'] = - array( - 1 => array( - 'column' => 'street_name', - 'order' => 'ASC', - ), - 2 => array( - 'column' => 'street_number_odd_even', - 'order' => 'ASC', - ), - 3 => array( - 'column' => 'street_number', - 'order' => 'ASC', - ), - 4 => array( - 'column' => 'sort_name', - 'order' => 'ASC', - ), - ); + $this->_params['order_bys'] = array( + 1 => array( + 'column' => 'street_name', + 'order' => 'ASC', + ), + 2 => array( + 'column' => 'street_number_odd_even', + 'order' => 'ASC', + ), + 3 => array( + 'column' => 'street_number', + 'order' => 'ASC', + ), + 4 => array( + 'column' => 'sort_name', + 'order' => 'ASC', + ), + ); } elseif (CRM_Core_OptionGroup::getValue('activity_type', 'PhoneBank') == $this->_values['activity_type_id'] diff --git a/CRM/Case/StateMachine/Search.php b/CRM/Case/StateMachine/Search.php index 26bee4b885..4e460c7e36 100644 --- a/CRM/Case/StateMachine/Search.php +++ b/CRM/Case/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array(); diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php index 003d1b6e1b..916f22b041 100644 --- a/CRM/Contact/Form/Edit/Email.php +++ b/CRM/Contact/Form/Edit/Email.php @@ -69,7 +69,7 @@ class CRM_Contact_Form_Edit_Email { $form->addSelect("email[$blockId][location_type_id]", array( 'entity' => 'email', 'class' => 'eight', - 'placeholder' => NULL + 'placeholder' => NULL, )); $multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail(); diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index 54ed4e595d..e21c6479ec 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -158,7 +158,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_ /** * 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/Task/AddToHousehold.php b/CRM/Contact/Form/Task/AddToHousehold.php index cad57bfc0b..f537e23ca0 100644 --- a/CRM/Contact/Form/Task/AddToHousehold.php +++ b/CRM/Contact/Form/Task/AddToHousehold.php @@ -62,7 +62,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { $this->add('select', 'relationship_type_id', ts('Relationship Type'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + CRM_Contact_BAO_Relationship::getRelationType("Household"), TRUE ); @@ -164,27 +164,27 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { 'count' => $valid, 'plural' => '%count %2 %3 relationships created', 2 => $relationship, - 3 => $house - )) + 3 => $house, + )), ); if ($duplicate) { $status[] = ts('%count was skipped because the contact is already %2 %3', array( 'count' => $duplicate, 'plural' => '%count were skipped because the contacts are already %2 %3', 2 => $relationship, - 3 => $house + 3 => $house, )); } if ($invalid) { $status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array( 'count' => $invalid, - 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship' + 'plural' => '%count relationships were not created because the contact is not of the right type for this relationship', )); } $status = ''; CRM_Core_Session::setStatus($status, ts('Relationship created.', array( 'count' => $valid, - 'plural' => 'Relationships created.' + 'plural' => 'Relationships created.', )), 'success', array('expires' => 0)); } } @@ -285,8 +285,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task { $contact_type = ' array( $ids['contribution'], - 'Integer' - ) + 'Integer', + ), )); // only handle component at this stage - not terribly sure how a recurring event payment would arise // & suspec main function may be a victom of copy & paste diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index 86439c42a7..00b5db2ac6 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -36,13 +36,13 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu /** * @param array $params * - * @return $this|null + * @return this|null */ public static function add(&$params) { if (empty($params)) { return NULL; } - $dao = new CRM_Event_DAO_ParticipantStatusType; + $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->copyValues($params); return $dao->save(); } @@ -50,7 +50,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu /** * @param array $params * - * @return $this|null + * @return this|null */ public static function &create(&$params) { $transaction = new CRM_Core_Transaction(); @@ -70,7 +70,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu */ public static function deleteParticipantStatusType($id) { // return early if there are participants with this status - $participant = new CRM_Event_DAO_Participant; + $participant = new CRM_Event_DAO_Participant(); $participant->status_id = $id; if ($participant->find()) { return FALSE; @@ -78,7 +78,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id); - $dao = new CRM_Event_DAO_ParticipantStatusType; + $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->id = $id; $dao->find(TRUE); $dao->delete(); @@ -94,7 +94,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu public static function retrieve(&$params, &$defaults) { $result = NULL; - $dao = new CRM_Event_DAO_ParticipantStatusType; + $dao = new CRM_Event_DAO_ParticipantStatusType(); $dao->copyValues($params); if ($dao->find(TRUE)) { CRM_Core_DAO::storeValues($dao, $defaults); diff --git a/CRM/Event/Badge.php b/CRM/Event/Badge.php index f5e59dad35..cb77e25ed0 100644 --- a/CRM/Event/Badge.php +++ b/CRM/Event/Badge.php @@ -51,7 +51,7 @@ class CRM_Event_Badge { 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', - 'color' => array(0, 0, 200) + 'color' => array(0, 0, 200), ); $this->format = '5160'; $this->imgExtension = 'png'; @@ -80,7 +80,7 @@ class CRM_Event_Badge { * * @param array $participants * - * @return null + * @return; */ public function run(&$participants) { // fetch the 1st participant, and take her event to retrieve its attributes @@ -154,8 +154,8 @@ class CRM_Event_Badge { 'cap' => 'round', 'join' => 'round', 'dash' => '2,10', - 'color' => array(255, 0, 0) - ) + 'color' => array(255, 0, 0), + ), )); } $img = $this->getImageFileName($this->event->id, $img); @@ -172,7 +172,7 @@ class CRM_Event_Badge { /** * This is supposed to be overrided - **/ + */ public function generateLabel($participant) { $txt = "{$this->event['title']} {$participant['display_name']} @@ -189,7 +189,7 @@ class CRM_Event_Badge { * * @param array $participants * - * @return null + * @return; */ public function createLabels(&$participants) { diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 3ba7db4b3a..72640c0a1b 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 );", ) ); diff --git a/CRM/Event/Import/Form/Summary.php b/CRM/Event/Import/Form/Summary.php index 8cb666679a..85b7693570 100644 --- a/CRM/Event/Import/Form/Summary.php +++ b/CRM/Event/Import/Form/Summary.php @@ -104,7 +104,7 @@ class CRM_Event_Import_Form_Summary extends CRM_Import_Form_Summary { 'downloadDuplicateRecordsUrl', 'downloadMismatchRecordsUrl', 'groupAdditions', - 'unMatchCount' + 'unMatchCount', ); foreach ($properties as $property) { $this->assign($property, $this->get($property)); diff --git a/CRM/Mailing/BAO/Recipients.php b/CRM/Mailing/BAO/Recipients.php index 71d0704f55..2a0cf10f82 100644 --- a/CRM/Mailing/BAO/Recipients.php +++ b/CRM/Mailing/BAO/Recipients.php @@ -63,7 +63,7 @@ WHERE mailing_id = %1 * * @return Object */ - static function mailingQuery( + public static function mailingQuery( $mailingID, $offset = NULL, $limit = NULL ) { diff --git a/CRM/Mailing/Event/BAO/Delivered.php b/CRM/Mailing/Event/BAO/Delivered.php index fe2606c226..2eb5e68da3 100755 --- a/CRM/Mailing/Event/BAO/Delivered.php +++ b/CRM/Mailing/Event/BAO/Delivered.php @@ -280,7 +280,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { * Consider mailings that were completed not more than $maxDays ago. * * @return void - **/ + */ public static function updateEmailResetDate($minDays = 3, $maxDays = 7) { $dao = new CRM_Core_Dao(); diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 315e0506d2..aa7f6290ca 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -112,7 +112,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool */ public function mapField(&$values) { return CRM_Import_Parser::VALID; @@ -124,7 +124,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function preview(&$values) { @@ -137,7 +137,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function summary(&$values) { @@ -254,7 +254,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function import($onDuplicate, &$values) { @@ -594,7 +594,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * * @param $formatted * - * @return Array + * @return; * formatted containing date values */ public function formattedDates($calcDates, &$formatted) { diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php index f602508865..b2bf44f665 100644 --- a/CRM/PCP/BAO/PCP.php +++ b/CRM/PCP/BAO/PCP.php @@ -350,7 +350,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @param int $id * Campaign page id. * - * @return null + * @return; */ public static function deleteById($id) { CRM_Utils_Hook::pre('delete', 'Campaign', $id, CRM_Core_DAO::$_nullArray); @@ -582,7 +582,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * * @param $is_active * - * @return null + * @return; */ public static function setIsActive($id, $is_active) { switch ($is_active) { @@ -778,7 +778,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @param int $id * Pcp block id. * - * @return Boolean + * @return Bool */ public static function getPcpBlockInUse($id) { $query = " @@ -797,7 +797,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0"; * @param int $profileId * Supporter's profile id. * - * @return boolean + * @return bool */ public static function checkEmailProfile($profileId) { $query = " @@ -847,7 +847,7 @@ WHERE field_name like 'email%' And is_active = 1 And uf_group_id = %1"; * @param int $pcpId * @param $component * - * @return String + * @return string */ public static function getPcpBlockEntityId($pcpId, $component) { $entity_table = self::getPcpEntityTable($component); @@ -872,7 +872,7 @@ WHERE pcp.id = %1"; * * @param $component * - * @return String + * @return string */ public static function getPcpEntityTable($component) { $entity_table_map = array( diff --git a/CRM/PCP/Form/Event.php b/CRM/PCP/Form/Event.php index 8024e067fa..dcd1300877 100644 --- a/CRM/PCP/Form/Event.php +++ b/CRM/PCP/Form/Event.php @@ -106,7 +106,7 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { $this->add('select', 'target_entity_id', ts('Online Contribution Page'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + CRM_Contribute_PseudoConstant::contributionPage() ); @@ -122,7 +122,7 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent { if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) { foreach (array( 'target_entity_type', - 'target_entity_id' + 'target_entity_id', ) as $element_name) { $element = $this->getElement($element_name); $element->freeze(); diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 6e33a0b1da..859063d959 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -201,7 +201,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { if (!empty($fieldOptions['is_full'])) { $element->freeze(); } - return; + return NULL; } /** @@ -309,7 +309,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $priceVal = implode($seperator, array( $customOption[$optionKey][$valueFieldName] + $taxAmount, $count, - $max_value + $max_value, )); $extra = array(); @@ -326,7 +326,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) { $useRequired = 0; } - elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label. + elseif (!empty($fieldOptions[$optionKey]['label'])) { + //check for label. $label = $fieldOptions[$optionKey]['label']; } @@ -500,7 +501,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $element = &$qf->add('select', $elementName, $label, array( - '' => ts('- select -') + '' => ts('- select -'), ) + $selectOption, $useRequired && $field->is_required, array('price' => json_encode($priceVal)) @@ -622,7 +623,7 @@ WHERE $dao = CRM_Core_DAO::executeQuery($query, array( 1 => array($optionGroupName, 'String'), - 2 => array($optionLabel, 'String') + 2 => array($optionLabel, 'String'), )); while ($dao->fetch()) { @@ -636,7 +637,7 @@ WHERE * @param int $id * Field Id. * - * @return boolean + * @return bool * */ public static function deleteField($id) { @@ -688,7 +689,6 @@ WHERE * @param bool $allowNoneSelection * */ - public static function priceSetValidation($priceSetId, $fields, &$error, $allowNoneSelection = FALSE) { // check for at least one positive // amount price field should be selected. diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 8d4303359d..295b5043c1 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -361,7 +361,7 @@ class CRM_Profile_Form extends CRM_Core_Form { elseif (!empty($this->_multiRecordFields) && (!$this->_multiRecord || !in_array($this->_multiRecord, array( CRM_Core_Action::DELETE, - CRM_Core_Action::UPDATE + CRM_Core_Action::UPDATE, ))) ) { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); @@ -667,8 +667,7 @@ class CRM_Profile_Form extends CRM_Core_Form { ) { $return = TRUE; if (!$statusMessage) { - $statusMessage = - ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.", + $statusMessage = ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.", array(1 => $profileSubType ? $profileSubType : $profileType)); } } @@ -965,24 +964,24 @@ class CRM_Profile_Form extends CRM_Core_Form { $duplicateContactsLinks = '
'; $duplicateContactsLinks .= ts('One matching contact was found. ', array( 'count' => count($contactLinks['rows']), - 'plural' => '%count matching contacts were found.
' + 'plural' => '%count matching contacts were found.
', )); if ($contactLinks['msg'] == 'view') { $duplicateContactsLinks .= ts('You can View the existing contact.', array( 'count' => count($contactLinks['rows']), - 'plural' => 'You can View the existing contacts.' + 'plural' => 'You can View the existing contacts.', )); } else { $duplicateContactsLinks .= ts('You can View or Edit the existing contact.', array( 'count' => count($contactLinks['rows']), - 'plural' => 'You can View or Edit the existing contacts.' + 'plural' => 'You can View or Edit the existing contacts.', )); } $duplicateContactsLinks .= '
'; $duplicateContactsLinks .= ''; $row = ''; - for ($i = 0; $i < sizeof($contactLinks['rows']); $i++) { + for ($i = 0; $i < count($contactLinks['rows']); $i++) { $row .= ' '; $row .= '
'; $row .= $contactLinks['rows'][$i]['display_name']; diff --git a/CRM/Report/Form/Contribute/LoggingDetail.php b/CRM/Report/Form/Contribute/LoggingDetail.php index c1f94073b9..e7b5320b46 100644 --- a/CRM/Report/Form/Contribute/LoggingDetail.php +++ b/CRM/Report/Form/Contribute/LoggingDetail.php @@ -36,7 +36,7 @@ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail /** */ public function __construct() { - $logging = new CRM_Logging_Schema; + $logging = new CRM_Logging_Schema(); $this->tables[] = 'civicrm_contribution'; $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables())); diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index f6f2227f54..9fcd9dd1e1 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -250,12 +250,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { // are grouped together across price sets but there may be a separate need to group // by id so that entries in one price set are distinct from others. Not quite sure what // to call the distinction for end users benefit - array( - 'price_field_value_label' => array( - 'title' => ts('Price Field Value Label'), - 'name' => 'label', - ), + array( + 'price_field_value_label' => array( + 'title' => ts('Price Field Value Label'), + 'name' => 'label', ), + ), ), ); } @@ -596,8 +596,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { 'filters' => array( 'id' => array( 'title' => ts('Contact ID'), - ) - , + ), 'sort_name' => array( 'title' => ts('Contact Name'), ), @@ -1222,7 +1221,7 @@ WHERE line_item_civireport.id IS NOT NULL */ public function alterNickName($value, &$row) { if (empty($row['civicrm_contact_id'])) { - return; + return NULL; } $contactID = $row['civicrm_contact_id']; return "
@@ -1374,7 +1373,7 @@ WHERE line_item_civireport.id IS NOT NULL */ public function alterParticipantStatus($value) { if (empty($value)) { - return; + return NULL; } return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label'); } @@ -1386,7 +1385,7 @@ WHERE line_item_civireport.id IS NOT NULL */ public function alterParticipantRole($value) { if (empty($value)) { - return; + return NULL; } $roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value); $value = array(); diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index 0468f4d447..11c169f204 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -440,7 +440,7 @@ class CRM_Utils_Array { * @param array $array * (optional) Array to be checked for emptiness. * - * @return boolean + * @return bool * True if the array is empty. */ public static function crmIsEmptyArray($array = array()) { @@ -744,18 +744,18 @@ class CRM_Utils_Array { * @return array * Each item is a distinct combination of values from $dimensions. * - * For example, the product of - * { + * For example, the product of + * { * fg => {red, blue}, * bg => {white, black} - * } - * would be - * { + * } + * would be + * { * {fg => red, bg => white}, * {fg => red, bg => black}, * {fg => blue, bg => white}, * {fg => blue, bg => black} - * } + * } */ public static function product($dimensions, $template = array()) { if (empty($dimensions)) { diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 93c301e483..a456f45386 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -719,7 +719,7 @@ class CRM_Utils_Date { * 'day' => '25', 'month' => '10', * 'year' => '2007' ); * - * @param array $dayParamsArray of the day, month, year. + * @param array $dayParams of the day, month, year. * Array of the day, month, year. * values. * @param string $format @@ -1437,7 +1437,7 @@ class CRM_Utils_Date { $from['Y'] = $now['year']; $from['H'] = 00; $from['i'] = $to['s'] = 00; - $to = self::intervalAdd('month', +1, $from); + $to = self::intervalAdd('month', 1, $from); $to = self::intervalAdd('second', -1, $to); break; } @@ -1537,7 +1537,7 @@ class CRM_Utils_Date { $from['M'] = $now['mon']; $from['Y'] = $now['year']; $from = self::intervalAdd('day', -1 * ($now['wday']) + 7, $from); - $to = self::intervalAdd('day', +6, $from); + $to = self::intervalAdd('day', 6, $from); break; case 'starting': @@ -1546,7 +1546,7 @@ class CRM_Utils_Date { $from['Y'] = $now['year']; $from['H'] = 00; $from['i'] = $to['s'] = 00; - $to = self::intervalAdd('day', +7, $from); + $to = self::intervalAdd('day', 7, $from); $to = self::intervalAdd('second', -1, $to); break; } @@ -1606,7 +1606,7 @@ class CRM_Utils_Date { $to['d'] = $now['mday']; $to['M'] = $now['mon']; $to['Y'] = $now['year']; - $to = self::intervalAdd('day', +1, $to); + $to = self::intervalAdd('day', 1, $to); $from['d'] = $to['d']; $from['M'] = $to['M']; $from['Y'] = $to['Y']; @@ -1618,7 +1618,7 @@ class CRM_Utils_Date { foreach (array( 'from', - 'to' + 'to', ) as $item) { if (!empty($$item)) { $dateRange[$item] = self::format($$item); diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php index 2694c092f2..1f416f6a02 100644 --- a/CRM/Utils/Migrate/Export.php +++ b/CRM/Utils/Migrate/Export.php @@ -484,7 +484,7 @@ class CRM_Utils_Migrate_Export { 'Individual', 'Organization', 'Household', - 'Case' + 'Case', ))) { if ($object->extends == 'Event') { $key = 'event_type'; diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 658a96a202..dbe4740e3a 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -468,8 +468,10 @@ class CRM_Utils_REST { return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/api/explorer')); } - /** used to load a template "inline", eg. for ajax, without having to build a menu for each template */ - static function loadTemplate() { + /** + * used to load a template "inline", eg. for ajax, without having to build a menu for each template + */ + public static function loadTemplate() { $request = CRM_Utils_Request::retrieve('q', 'String'); if (FALSE !== strpos($request, '..')) { die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org"); @@ -522,10 +524,11 @@ class CRM_Utils_REST { } } - /** This is a wrapper so you can call an api via json (it returns json too) + /** + * This is a wrapper so you can call an api via json (it returns json too) * http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals * works for POST & GET (POST recommended) - **/ + */ public static function ajaxJson() { $requestParams = CRM_Utils_Request::exportValues(); @@ -559,8 +562,7 @@ class CRM_Utils_REST { if (!is_array($params)) { CRM_Utils_JSON::output(array( 'is_error' => 1, - 'error_message', - 'invalid json format: ?{"param_with_double_quote":"value"}' + 'error_message' => 'invalid json format: ?{"param_with_double_quote":"value"}', )); } diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index 70c95607b6..3ec8a101ed 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -142,7 +142,7 @@ abstract class CRM_Utils_System_Base { * @return string * Formatted url. */ - function languageNegotiationURL( + public function languageNegotiationURL( $url, $addLanguagePart = TRUE, $removeLanguagePart = FALSE @@ -177,7 +177,7 @@ abstract class CRM_Utils_System_Base { * @param string $username * * @throws CRM_Core_Exception - * @return int|NULL + * @return; */ public function getUfId($username) { $className = get_class($this); @@ -218,9 +218,9 @@ abstract class CRM_Utils_System_Base { * @param string $dir * * @return array - * - $url, (Joomla - non admin url) - * - $siteName, - * - $siteRoot + * - $url, (Joomla - non admin url) + * - $siteName, + * - $siteRoot */ public function getDefaultSiteSettings($dir) { $config = CRM_Core_Config::singleton(); @@ -311,7 +311,7 @@ abstract class CRM_Utils_System_Base { /** * Get currently logged in user uf id. * - * @return int + * @return; * $userID logged in user uf id. */ public function getLoggedInUfID() { @@ -320,7 +320,7 @@ abstract class CRM_Utils_System_Base { /** * Get currently logged in user unique identifier - this tends to be the email address or user name. * - * @return string + * @return; * logged in user unique identifier */ public function getLoggedInUniqueIdentifier() { diff --git a/CRM/Utils/System/Soap.php b/CRM/Utils/System/Soap.php index 525aa5d974..c8aa0e2408 100644 --- a/CRM/Utils/System/Soap.php +++ b/CRM/Utils/System/Soap.php @@ -56,7 +56,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void */ public function setTitle($title, $pageTitle) { - return; + return NULL; } /** @@ -65,7 +65,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @param string $str * The permission to check. * - * @return boolean + * @return bool * true if yes, else false */ public function checkPermission($str) { @@ -81,7 +81,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void */ public function appendBreadCrumb($title, $url) { - return; + return NULL; } /** @@ -93,7 +93,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * @return void */ public function addHTMLHead($head) { - return; + return NULL; } /** @@ -127,8 +127,6 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { /** * Figure out the post url for the form * - * @param the default action if one is pre-specified - * * @return string * the url to post the form */ @@ -199,7 +197,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * If present, add destination to querystring (works for Drupal only). * * @throws Exception - * @return string + * @return; * loginURL for the current CMS */ public function getLoginURL($destination = '') { diff --git a/Civi/Core/Transaction/Manager.php b/Civi/Core/Transaction/Manager.php index 7b2ca2dc64..8e38800620 100644 --- a/Civi/Core/Transaction/Manager.php +++ b/Civi/Core/Transaction/Manager.php @@ -153,7 +153,9 @@ class Manager { * @return \Civi\Core\Transaction\Frame */ public function getBaseFrame() { - if (empty($this->frames)) return NULL; + if (empty($this->frames)) { + return NULL; + } return $this->frames[count($this->frames) - 1]; } diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 4a23bdd0b4..bb31c023a8 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -69,7 +69,7 @@ function civicrm_api3_contact_create($params) { $defLocType = CRM_Core_BAO_LocationType::getDefault(); $params['email'] = array( 1 => array( - 'email' => $email, + 'email' => $email, 'is_primary' => 1, 'location_type_id' => ($defLocType->id) ? $defLocType->id : 1, ), @@ -80,8 +80,8 @@ function civicrm_api3_contact_create($params) { if (!empty($params['home_url'])) { $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'); $params['website'] = array( - 1 => array( - 'website_type_id' => key($websiteTypes), + 1 => array( + 'website_type_id' => key($websiteTypes), 'url' => $params['home_url'], ), ); @@ -141,8 +141,6 @@ function _civicrm_api3_contact_create_spec(&$params) { /** * Retrieve one or more contacts, given a set of search params * - * @param array input parameters - * * @return array * API Result Array */ @@ -819,7 +817,7 @@ LIMIT 0, {$limit} if ($listCurrentEmployer && !empty($currEmpDetails)) { $contactList = array( array( - 'data' => $currEmpDetails['data'], + 'data' => $currEmpDetails['data'], 'id' => $currEmpDetails['id'], ), ); diff --git a/api/v3/UFMatch.php b/api/v3/UFMatch.php index d57dbb770b..77359bc332 100644 --- a/api/v3/UFMatch.php +++ b/api/v3/UFMatch.php @@ -57,7 +57,7 @@ function civicrm_api3_uf_match_get($params) { * * @return array * api result array - * {@getfields uf_match_create} + * {@getfields uf_match_create} */ function civicrm_api3_uf_match_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -86,7 +86,7 @@ function _civicrm_api3_uf_match_create_spec(&$params) { * * @return array * api result array - * {@getfields uf_match_create} + * {@getfields uf_match_create} */ function civicrm_api3_uf_match_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/tests/phpunit/AllTests.php b/tests/phpunit/AllTests.php index 29f4df4ecd..9f30e106ef 100644 --- a/tests/phpunit/AllTests.php +++ b/tests/phpunit/AllTests.php @@ -47,7 +47,7 @@ class 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/Bridge/OG/DrupalTest.php b/tests/phpunit/CRM/Bridge/OG/DrupalTest.php index 09f083bd1b..1705f48b5e 100644 --- a/tests/phpunit/CRM/Bridge/OG/DrupalTest.php +++ b/tests/phpunit/CRM/Bridge/OG/DrupalTest.php @@ -40,7 +40,7 @@ require_once 'api/api.php'; * @package CiviCRM */ class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase { - /* + /** * Test that one (ane only one) role (option value) is deleted by the updateCiviACLRole function */ public function testACLRoleDeleteFunctionality() { diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php index 644e606cb5..56fe2c620d 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php @@ -313,7 +313,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } @@ -403,7 +403,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa foreach (array( 'joinDate', 'startDate', - 'endDate' + 'endDate', ) as $date) { $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull); } diff --git a/tests/phpunit/WebTest/Member/StandaloneAddTest.php b/tests/phpunit/WebTest/Member/StandaloneAddTest.php index ec624c6b26..e1194fc148 100644 --- a/tests/phpunit/WebTest/Member/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Member/StandaloneAddTest.php @@ -250,7 +250,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase { $test = $this; $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, function () use ($test) { - $test->select('membership_type_id_0', 'value=1'); + $test->select('membership_type_id_0', 'value=1'); } ); } diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 50ea902262..fa401b3d62 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -54,7 +54,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { ) ); $this->_apiversion = 3; - $op = new PHPUnit_Extensions_Database_Operation_Insert; + $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute( $this->_dbconn, $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml') -- 2.25.1