From acb1052ec2199198d0ca02bda45e61cc95ec6d35 Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 16 Jan 2015 12:12:31 +0530 Subject: [PATCH] INFRA 32 - Batch #17 --- CRM/ACL/API.php | 4 ++-- CRM/Activity/Import/Form/MapField.php | 4 ++-- CRM/Batch/Form/Entry.php | 4 ++-- CRM/Campaign/Form/Search.php | 8 ++++---- CRM/Campaign/Form/Survey/Main.php | 8 +------- CRM/Campaign/Form/Task/Interview.php | 16 ++++++++-------- CRM/Case/XMLProcessor/Report.php | 8 ++++---- CRM/Contact/BAO/Contact/Permission.php | 8 +++----- CRM/Contact/BAO/SavedSearch.php | 2 -- CRM/Contact/Form/Location.php | 2 +- CRM/Contact/Form/Search/Custom/Base.php | 2 +- .../Custom/FullText/AbstractPartialQuery.php | 6 +++--- CRM/Contact/Form/Search/Custom/Group.php | 6 +----- CRM/Contact/Page/View/ContactSmartGroup.php | 1 - CRM/Contact/Page/View/UserDashBoard.php | 3 +-- CRM/Contribute/Form/AdditionalPayment.php | 8 +++----- CRM/Contribute/Form/Contribution.php | 9 +++------ CRM/Contribute/Form/ContributionPage/Amount.php | 6 +++--- CRM/Contribute/Form/Search.php | 6 +++--- CRM/Contribute/Import/Parser/Contribution.php | 8 ++++---- CRM/Contribute/Page/Tab.php | 3 +-- CRM/Core/BAO/IM.php | 8 ++------ CRM/Core/BAO/Location.php | 6 +++--- CRM/Core/BAO/Navigation.php | 6 +++--- CRM/Core/BAO/PaperSize.php | 6 ------ CRM/Core/BAO/PdfFormat.php | 8 -------- CRM/Core/BAO/WordReplacement.php | 1 - CRM/Core/CodeGen/Specification.php | 7 +++---- CRM/Core/Payment/Form.php | 8 ++++---- CRM/Core/Permission.php | 8 ++++---- CRM/Event/BAO/ParticipantPayment.php | 8 ++++---- CRM/Event/Badge/Logo5395.php | 2 +- CRM/Event/Form/Task/PickProfile.php | 2 +- CRM/Event/Import/Form/MapField.php | 6 ++---- CRM/Financial/Page/BatchTransaction.php | 4 ++-- CRM/Mailing/MailStore/Mbox.php | 8 ++++---- CRM/Mailing/MailStore/Pop3.php | 8 ++++---- CRM/Member/BAO/MembershipStatus.php | 4 ++-- CRM/Pledge/StateMachine/Search.php | 2 +- CRM/Price/BAO/PriceSet.php | 11 +++++------ CRM/Price/Page/Set.php | 6 +----- CRM/Profile/Page/MultipleRecordFieldsListing.php | 8 ++++---- CRM/Profile/Page/Router.php | 6 ++---- CRM/Report/Utils/Report.php | 2 +- CRM/Utils/SQL/Select.php | 2 +- api/v3/Contribution.php | 10 ++++------ api/v3/ContributionPage.php | 8 ++++---- api/v3/Pledge.php | 7 +++---- api/v3/WordReplacement.php | 2 +- bin/csv/export.php | 2 +- tests/phpunit/CRM/Activity/BAO/ActivityTest.php | 8 ++++---- tests/phpunit/CRM/Contact/BAO/QueryTest.php | 8 ++++---- tests/phpunit/CRM/Queue/Queue/AllTests.php | 2 +- .../Contribute/OnBehalfOfOrganization.php | 2 +- .../Contribute/UpdateContributionTest.php | 14 +++++++------- .../api/v3/CustomValueContactTypeTest.php | 8 +++----- tests/phpunit/api/v3/SurveyTest.php | 2 +- 57 files changed, 138 insertions(+), 194 deletions(-) diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index 0ceb4b124d..4a85ba1dda 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -54,7 +54,7 @@ class CRM_ACL_API { * @param int $contactID * The contactID for whom the check is made. * - * @return boolean + * @return bool * true if yes, else false */ public static function check($str, $contactID = NULL) { @@ -208,7 +208,7 @@ class CRM_ACL_API { //adding a way for unit tests to flush the cache if ($flush) { $cache = array(); - return; + return NULL; } if (!$contactID) { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index c1fdd6014a..6ce40979d3 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -72,7 +72,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { 'activity_type_id', 'activity_label', 'target_contact_id', - 'activity_subject' + 'activity_subject', ); foreach ($requiredFields as $val) { $highlightedFields[] = $val; @@ -195,7 +195,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { $defaults["mapper[$i]"] = array( $this->defaultFromHeader($this->_columnHeaders[$i], $headerPatterns - ) + ), ); } else { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 0673689d44..854ca2ba75 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -202,7 +202,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) { $this->addEntityRef("primary_contact_id[{$rowNumber}]", '', array( 'create' => TRUE, - 'placeholder' => ts('- select -') + 'placeholder' => ts('- select -'), )); // special field specific to membership batch udpate @@ -253,7 +253,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { 'contact' => array( 'return' => implode(',', $contactReturnProperties), 'fieldmap' => array_flip($contactReturnProperties), - ) + ), )); // don't set the status message when form is submitted. diff --git a/CRM/Campaign/Form/Search.php b/CRM/Campaign/Form/Search.php index a36fb93d6d..5d16dfc5de 100755 --- a/CRM/Campaign/Form/Search.php +++ b/CRM/Campaign/Form/Search.php @@ -74,7 +74,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function preProcess() { + public function preProcess() { $this->_done = FALSE; $this->_defaults = array(); @@ -96,7 +96,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { if (!in_array($this->_operation, array( 'reserve', 'release', - 'interview' + 'interview', )) ) { $this->_operation = 'reserve'; @@ -232,7 +232,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { $taskValue = array( $currentTaskValue => ts('Record %1 Responses', array(1 => $activityTypes[$surveyTypeId]) - ) + ), ); } @@ -356,7 +356,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search { $contactType = CRM_Campaign_BAO_Survey::getSurveyContactType(CRM_Utils_Array::value('campaign_survey_id', $this->_formValues)); if ($contactType && in_array($this->_operation, array( 'reserve', - 'interview' + 'interview', )) ) { $this->_formValues['contact_type'][$contactType] = 1; diff --git a/CRM/Campaign/Form/Survey/Main.php b/CRM/Campaign/Form/Survey/Main.php index 84ab2f6a47..8163555c98 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -104,8 +104,6 @@ class CRM_Campaign_Form_Survey_Main 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 */ @@ -143,8 +141,6 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -190,8 +186,6 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -229,7 +223,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { 1 => array( $this->_values['result_id'], 'Positive', - ) + ), ) ); // delete option group if no any survey is using it. diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 99f77408d3..e742e619c4 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -108,8 +108,8 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task { $orderByParams = CRM_Utils_Array::value('order_bys', $_POST); } elseif (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) { - $orderByParams = - array( + $orderByParams + = array( 1 => array( 'column' => 'civicrm_address.street_name', 'order' => 'ASC', @@ -288,8 +288,8 @@ WHERE {$clause} public function buildQuickForm() { $this->assign('surveyTypeId', $this->_surveyTypeId); - $options = - array( + $options + = array( '' => ' - none - ', 'civicrm_address.street_name' => 'Street Name', 'civicrm_address.street_number%2' => 'Odd / Even Street Number', @@ -408,8 +408,8 @@ WHERE {$clause} } if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) { - $defaults['order_bys'] = - array( + $defaults['order_bys'] + = array( 1 => array( 'column' => 'civicrm_address.street_name', 'order' => 'ASC', @@ -429,8 +429,8 @@ WHERE {$clause} ); } else { - $defaults['order_bys'] = - array( + $defaults['order_bys'] + = array( 1 => array( 'column' => 'contact_a.sort_name', 'order' => 'ASC', diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index d5dded61d2..5408b52a98 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -68,7 +68,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { public function &getRedactionRules() { foreach (array( 'redactionStringRules', - 'redactionRegexRules' + 'redactionRegexRules', ) as $key => $rule) { $$rule = CRM_Case_PseudoConstant::redactionRule($key); @@ -96,7 +96,7 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor { * * @return array */ - function &caseInfo( + public function &caseInfo( $clientID, $caseID ) { @@ -323,7 +323,7 @@ WHERE a.id = %1 $clientID = CRM_Utils_Type::escape($clientID, 'Integer'); if (!in_array($activityTypeInfo['name'], array( 'Email', - 'Inbound Email' + 'Inbound Email', )) ) { $activity['editURL'] = CRM_Utils_System::url('civicrm/case/activity', @@ -637,7 +637,7 @@ AND cg.extends = 'Activity'"; 1 => array( $activityTypeID, 'Integer', - ) + ), ); $dao = CRM_Core_DAO::executeQuery($query, $params); diff --git a/CRM/Contact/BAO/Contact/Permission.php b/CRM/Contact/BAO/Contact/Permission.php index e9b4355b03..04f36414bd 100644 --- a/CRM/Contact/BAO/Contact/Permission.php +++ b/CRM/Contact/BAO/Contact/Permission.php @@ -41,7 +41,7 @@ class CRM_Contact_BAO_Contact_Permission { * Contact id. * @param int|string $type the type of operation (view|edit) * - * @return boolean + * @return bool * true if the user has permission, false otherwise */ public static function allow($id, $type = CRM_Core_Permission::VIEW) { @@ -143,8 +143,6 @@ ON DUPLICATE KEY UPDATE CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)'); $_processed[$userID] = 1; - - return; } /** @@ -154,9 +152,9 @@ ON DUPLICATE KEY UPDATE * @param int $contactID * Contact id. * - * @return boolean + * @return bool */ - static function hasContactsInCache( + public static function hasContactsInCache( $type = CRM_Core_Permission::VIEW, $contactID = NULL ) { diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 35818a5466..fe1f399a78 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -254,8 +254,6 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ $this->where_tables = serialize($whereTables); } } - - return; } public function save() { diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index 008291f041..8c2f938740 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -56,7 +56,7 @@ class CRM_Contact_Form_Location { $className = CRM_Utils_System::getClassName($form); if (in_array($className, array( 'CRM_Event_Form_ManageEvent_Location', - 'CRM_Contact_Form_Domain' + 'CRM_Contact_Form_Domain', ))) { $form->_blocks = array( 'Address' => ts('Address'), diff --git a/CRM/Contact/Form/Search/Custom/Base.php b/CRM/Contact/Form/Search/Custom/Base.php index cca35084f2..dd1d45bc3a 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -95,7 +95,7 @@ class CRM_Contact_Form_Search_Custom_Base { * * @return string */ - function sql( + public function sql( $selectClause, $offset = 0, $rowcount = 0, diff --git a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php index a1f3153f85..814360b6a3 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php +++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php @@ -161,9 +161,9 @@ $sqlStatement } $query = $tableValues + array( - 'text' => CRM_Utils_QueryFormatter::singleton() - ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR), - ); + 'text' => CRM_Utils_QueryFormatter::singleton() + ->format($queryText, CRM_Utils_QueryFormatter::LANG_SOLR), + ); list($intLimit, $intOffset) = $this->parseLimitOffset($limit); $files = $searcher->search($query, $intLimit, $intOffset); $matches = array(); diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index 53ebf0e47b..66ea3e1786 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -68,8 +68,6 @@ class CRM_Contact_Form_Search_Custom_Group $this->_groups = FALSE; $this->_tags = FALSE; $this->_andOr = CRM_Utils_Array::value('andOr', $this->_formValues); - - //make easy to check conditions for groups and tags are //selected or it is empty search if (empty($this->_includeGroups) && empty($this->_excludeGroups) && @@ -183,7 +181,7 @@ class CRM_Contact_Form_Search_Custom_Group * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -354,8 +352,6 @@ WHERE gcc.group_id = {$ssGroup->id} SELECT civicrm_contact.id as contact_id, '' FROM civicrm_contact"; } - - //used only when exclude group is selected if ($xGroups != 0) { $includeGroup .= " LEFT JOIN Xg_{$this->_tableName} diff --git a/CRM/Contact/Page/View/ContactSmartGroup.php b/CRM/Contact/Page/View/ContactSmartGroup.php index 7ac5c0a5f4..5d88beabe1 100644 --- a/CRM/Contact/Page/View/ContactSmartGroup.php +++ b/CRM/Contact/Page/View/ContactSmartGroup.php @@ -42,7 +42,6 @@ class CRM_Contact_Page_View_ContactSmartGroup extends CRM_Core_Page { /** * called when action is browse * - * @return null */ public function browse() { $in = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added'); diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index a14f730d4c..c769dc5a37 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -176,7 +176,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { 'sectionTitle' => ts('Your Assigned Activities'), 'weight' => 5, ); - $userDashboard = new CRM_Activity_Page_UserDashboard; + $userDashboard = new CRM_Activity_Page_UserDashboard(); $userDashboard->run(); } @@ -214,7 +214,6 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { * @return array * (reference) of action links */ - static public function &links() { if (!(self::$_links)) { $disableExtra = ts('Are you sure you want to disable this relationship?'); diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 96aa20b062..806e5062eb 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -161,7 +161,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract */ public function setDefaultValues() { if ($this->_view == 'transaction' && ($this->_action & CRM_Core_Action::BROWSE)) { - return; + return NULL; } $defaults = array(); if ($this->_mode) { @@ -333,8 +333,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract ), ) ); - - $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend' ); @@ -429,8 +427,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract //get the payment processor id as per mode. //@todo unclear relevance of mode - seems like a lot of duplicated params here! - $this->_params['payment_processor'] = $params['payment_processor_id'] = - $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id']; + $this->_params['payment_processor'] = $params['payment_processor_id'] + = $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id']; $now = date('YmdHis'); $fields = array(); diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 66cf5f3cb7..446e2ad7cb 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -664,7 +664,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($this->_context == 'standalone') { $this->addEntityRef('contact_id', ts('Contact'), array( 'create' => TRUE, - 'api' => array('extra' => array('email')) + 'api' => array('extra' => array('email')), ), TRUE); } @@ -1550,8 +1550,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP ); //get the payment processor id as per mode. - $this->_params['payment_processor'] = $params['payment_processor_id'] = - $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id']; + $this->_params['payment_processor'] = $params['payment_processor_id'] + = $this->_params['payment_processor_id'] = $submittedValues['payment_processor_id'] = $this->_paymentProcessor['id']; $now = date('YmdHis'); $fields = array(); @@ -1762,8 +1762,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->_id, 'Contribution' ); - - if (empty($paymentParams['is_recur'])) { $contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($this, $this->_params, @@ -1818,7 +1816,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP /** * @param array $paymentParams * - * @return array */ public function cleanupDBAfterPaymentFailure($paymentParams, $message) { //make sure to cleanup db for recurring case. diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 7a5ceec45d..be4ce87500 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -152,7 +152,7 @@ SELECT id } $this->add('select', 'price_set_id', ts('Price Set'), array( - '' => ts('- none -') + '' => ts('- none -'), ) + $price, NULL, array('onchange' => "showHideAmountBlock( this.value, 'price_set_id' );") ); @@ -210,7 +210,7 @@ SELECT id 'html_type', 'name', 'is_active', - 'label' + 'label', )); foreach ($priceFields as $priceField) { if ($priceField['id'] && $priceField['html_type'] == 'Radio' && $priceField['name'] == 'contribution_amount') { @@ -466,7 +466,7 @@ SELECT id if (in_array($field, array( 'min_amount', - 'max_amount' + 'max_amount', ))) { $val = CRM_Utils_Rule::cleanMoney($val); } diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index d34a4ae25e..9f50f5cccf 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -75,7 +75,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { * * @return void */ - function preProcess() { + public function preProcess() { $this->set('searchFormName', 'Search'); /** @@ -260,7 +260,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { foreach (array( 'contribution_amount_low', - 'contribution_amount_high' + 'contribution_amount_high', ) as $f) { if (isset($this->_formValues[$f])) { $this->_formValues[$f] = CRM_Utils_Rule::cleanMoney($this->_formValues[$f]); @@ -274,7 +274,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { 'contribution_soft_credit_type_id', 'contribution_status_id', 'contribution_source', - 'contribution_trxn_id' + 'contribution_trxn_id', ); foreach ($specialParams as $element) { $value = CRM_Utils_Array::value($element, $this->_formValues); diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 3ac33c1855..40ed6325eb 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -140,7 +140,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool */ public function mapField(&$values) { return CRM_Import_Parser::VALID; @@ -152,7 +152,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function preview(&$values) { @@ -165,7 +165,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @param array $values * The array of values belonging to this line. * - * @return boolean + * @return bool * the result of this processing */ public function summary(&$values) { @@ -244,7 +244,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @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) { diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 1d1ba4f993..12a8f68c06 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -104,7 +104,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { /** * called when action is browse * - * @return null */ public function browse() { // add annual contribution @@ -252,7 +251,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { if (empty($this->_contactId)) { $this->_contactId = civicrm_api3('contribution', 'getvalue', array( 'id' => $this->_id, - 'return' => 'contact_id' + 'return' => 'contact_id', )); } $this->assign('contactId', $this->_contactId); diff --git a/CRM/Core/BAO/IM.php b/CRM/Core/BAO/IM.php index 9e5b1788fb..2371436d10 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -63,9 +63,9 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * Given the list of params in the params array, fetch the object * and store the values in the values array * - * @param array entityBlock input parameters to find object + * @param array $entityBlock input parameters to find object * - * @return boolean + * @return bool */ public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('im', $entityBlock); @@ -137,12 +137,8 @@ ORDER BY if (empty($entityElements)) { return NULL; } - - $entityId = $entityElements['entity_id']; $entityTable = $entityElements['entity_table']; - - $sql = "SELECT cim.name as im, ltype.name as locationType, cim.is_primary as is_primary, cim.id as im_id, cim.location_type_id as locationTypeId FROM civicrm_loc_block loc, civicrm_im cim, civicrm_location_type ltype, {$entityTable} ev WHERE ev.id = %1 diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index aed679ab98..33f234af3b 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -109,7 +109,7 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { 'phone', 'email', 'im', - 'address' + 'address', ) as $loc) { $locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL; $locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL; @@ -216,7 +216,7 @@ WHERE e.id = %1"; * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return boolean + * @return bool */ public static function dataExists(&$params) { // return if no data present @@ -368,7 +368,7 @@ WHERE e.id = %1"; 'IM', 'Phone', 'Address', - 'OpenID' + 'OpenID', ) as $block) { $name = strtolower($block); if (array_key_exists($name, $primaryLocBlockIds) && diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 28b1f5b448..b12eb19051 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -84,7 +84,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { /** * Add/update navigation record * - * @param array associated array of submitted values + * @param $params associated array of submitted values * * @return object * navigation object @@ -312,7 +312,7 @@ ORDER BY parent_id, weight"; 'parentID' => $navigation->parent_id, 'navID' => $navigation->id, 'active' => $navigation->is_active, - ) + ), ); self::buildNavigationTree($navigationTree[$navigation->id]['child'], $navigation->id, $navigationMenu); } @@ -493,7 +493,7 @@ ORDER BY parent_id, weight"; //we need to check core view/edit or supported acls. if (in_array($menuName, array( 'Search...', - 'Contacts' + 'Contacts', ))) { if (!CRM_Core_Permission::giveMeAllACLs()) { $skipMenuItems[] = $navID; diff --git a/CRM/Core/BAO/PaperSize.php b/CRM/Core/BAO/PaperSize.php index 8a323498a6..2608314c19 100644 --- a/CRM/Core/BAO/PaperSize.php +++ b/CRM/Core/BAO/PaperSize.php @@ -70,8 +70,6 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Get Option Group ID for Paper Sizes * - * @param void - * * @return int * Group ID (null if Group ID doesn't exist) */ @@ -92,8 +90,6 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * @param string $returnURL * URL of page calling this function. * - * @return array - * (reference) List of Paper Sizes */ public static function &addOrder(&$list, $returnURL) { $filter = "option_group_id = " . self::_getGid(); @@ -133,8 +129,6 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Retrieve the default Paper Size values * - * @param NULL - * * @return array * Name/value pairs containing the default Paper Size values. */ diff --git a/CRM/Core/BAO/PdfFormat.php b/CRM/Core/BAO/PdfFormat.php index 166bf8a406..c13df3de6e 100644 --- a/CRM/Core/BAO/PdfFormat.php +++ b/CRM/Core/BAO/PdfFormat.php @@ -97,8 +97,6 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Get page orientations recognized by the DOMPDF package used to create PDF letters. * - * @param void - * * @return array * array of page orientations */ @@ -112,8 +110,6 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Get measurement units recognized by the DOMPDF package used to create PDF letters. * - * @param void - * * @return array * array of measurement units */ @@ -129,8 +125,6 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Get Option Group ID for PDF Page Formats * - * @param void - * * @return int * Group ID (null if Group ID doesn't exist) */ @@ -191,8 +185,6 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Get the default PDF Page Format values * - * @param NULL - * * @return array * Name/value pairs containing the default PDF Page Format values. */ diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index 82527f3b7f..eee35c7b5d 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -60,7 +60,6 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { * * @return CRM_Core_DAO_WordRepalcement */ - public static function retrieve(&$params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_WordRepalcement', $params, $defaults); } diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index f6f09d3980..c1b528cc78 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -47,8 +47,8 @@ class CRM_Core_CodeGen_Specification { foreach ($table['foreignKey'] as $fkName => $fkValue) { if ($this->tables[$fkValue['table']]['archive'] == 'true') { $table['foreignKey'][$fkName]['table'] = 'archive_' . $table['foreignKey'][$fkName]['table']; - $table['foreignKey'][$fkName]['uniqName'] = - str_replace('FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName']); + $table['foreignKey'][$fkName]['uniqName'] + = str_replace('FK_', 'FK_archive_', $table['foreignKey'][$fkName]['uniqName']); } } $archiveTables[$name] = $table; @@ -274,7 +274,6 @@ class CRM_Core_CodeGen_Specification { } $tables[$name] = &$table; - return; } /** @@ -303,7 +302,7 @@ class CRM_Core_CodeGen_Specification { $field['cols'] = isset($fieldXML->html) ? $this->value('cols', $fieldXML->html) : NULL; break; - break; + break; case 'datetime': $field['sqlType'] = $field['phpType'] = $type; diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index edf530427c..6b7b5c4e39 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -159,9 +159,9 @@ class CRM_Core_Payment_Form { 'title' => ts('Country'), 'cc_field' => TRUE, 'attributes' => array( - '' => ts('- select -') - ) + - CRM_Core_PseudoConstant::country(), + '' => ts('- select -'), + ) + + CRM_Core_PseudoConstant::country(), 'is_required' => TRUE, ); //CRM-15509 working towards giving control over billing fields to payment processors. For now removing tpl hard-coding @@ -265,7 +265,7 @@ class CRM_Core_Payment_Form { // which was previously available only in some form flows if (!empty($form->_paymentProcessor) && !empty($form->_paymentProcessor['object']) && $form->_paymentProcessor['object']->isSupported('buildForm')) { $form->_paymentProcessor['object']->buildForm($form); - return; + return NULL; } self::setPaymentFieldsByProcessor($form, $processor, empty($isBillingDataOptional)); diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 9b4ca59a07..23969c6ca5 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -114,7 +114,7 @@ class CRM_Core_Permission { * array('access CiviEvent', 'access CiviContribute') * ), * - * @return boolean + * @return bool * true if yes, else false */ public static function check($permissions) { @@ -162,7 +162,7 @@ class CRM_Core_Permission { * @param array $array * The group/role to check. * - * @return boolean + * @return bool * true if yes, else false */ public static function checkGroupRole($array) { @@ -673,8 +673,8 @@ class CRM_Core_Permission { * Validate user permission across * edit or view or with supportable acls. * - * @return boolean - **/ + * @return bool + */ public static function giveMeAllACLs() { if (CRM_Core_Permission::check('view all contacts') || CRM_Core_Permission::check('edit all contacts') diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php index 7f7749190b..d7c40e1a6d 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -76,8 +76,8 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment $lineItemCount = CRM_Core_DAO::singleValueQuery("select count(*) FROM civicrm_line_item WHERE contribution_id = %1", array( 1 => array( $participantPayment->contribution_id, - 'Integer' - ) + 'Integer', + ), )); if ($lineItemCount == 1) { $sql = "UPDATE civicrm_line_item li @@ -85,7 +85,7 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment WHERE contribution_id = %2 AND entity_table = 'civicrm_contribution'"; CRM_Core_DAO::executeQuery($sql, array( 1 => array($participantPayment->participant_id, 'Integer'), - 2 => array($participantPayment->contribution_id, 'Integer') + 2 => array($participantPayment->contribution_id, 'Integer'), )); } @@ -99,7 +99,7 @@ class CRM_Event_BAO_ParticipantPayment extends CRM_Event_DAO_ParticipantPayment * @param array $params * Associative array whose values match the record to be deleted. * - * @return boolean + * @return bool * true if deleted false otherwise */ public static function deleteParticipantPayment($params) { diff --git a/CRM/Event/Badge/Logo5395.php b/CRM/Event/Badge/Logo5395.php index 59d1d18231..a8200887bf 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -44,7 +44,7 @@ class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', - 'color' => array(0, 0, 200) + 'color' => array(0, 0, 200), )); $this->pdf->SetFontSize(9); diff --git a/CRM/Event/Form/Task/PickProfile.php b/CRM/Event/Form/Task/PickProfile.php index f6c45b5e4e..53c2ad11bc 100644 --- a/CRM/Event/Form/Task/PickProfile.php +++ b/CRM/Event/Form/Task/PickProfile.php @@ -99,7 +99,7 @@ class CRM_Event_Form_Task_PickProfile extends CRM_Event_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/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index e4ac8a1f39..192c5adafd 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -87,7 +87,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { 'first_name', 'last_name', 'external_identifier', - 'participant_status_id' + 'participant_status_id', ); foreach ($highlightedFieldsArray as $name) { $highlightedFields[] = $name; @@ -158,8 +158,6 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { $headerPatterns = $this->get('headerPatterns'); $dataPatterns = $this->get('dataPatterns'); $hasLocationTypes = $this->get('fieldTypes'); - - /* Initialize all field usages to false */ foreach ($mapperKeys as $key) { @@ -343,7 +341,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Import_Form_MapField { } else { $errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array( - 1 => $threshold + 1 => $threshold, )) . ' ' . ts('Or Provide Contact ID or External ID.') . '
'; } } diff --git a/CRM/Financial/Page/BatchTransaction.php b/CRM/Financial/Page/BatchTransaction.php index 0b03eaf08b..e613cd4773 100644 --- a/CRM/Financial/Page/BatchTransaction.php +++ b/CRM/Financial/Page/BatchTransaction.php @@ -104,8 +104,8 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { if (isset(self::$_entityID)) { $statusID = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', self::$_entityID, 'status_id'); } - $breadCrumb = - array( + $breadCrumb + = array( array( 'title' => ts('Accounting Batches'), 'url' => CRM_Utils_System::url('civicrm/financial/financialbatches', diff --git a/CRM/Mailing/MailStore/Mbox.php b/CRM/Mailing/MailStore/Mbox.php index 2b39759e47..71f8c27c0a 100644 --- a/CRM/Mailing/MailStore/Mbox.php +++ b/CRM/Mailing/MailStore/Mbox.php @@ -59,13 +59,13 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { 'CiviMail.ignored', date('Y'), date('m'), - date('d') + date('d'), ))); $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array( 'CiviMail.processed', date('Y'), date('m'), - date('d') + date('d'), ))); } @@ -98,7 +98,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { print "copying message $nr to ignored folder\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_ignored); - $parser = new ezcMailParser; + $parser = new ezcMailParser(); $parser->parseMail($set); $this->_leftToProcess--; } @@ -116,7 +116,7 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore { print "copying message $nr to processed folder\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_processed); - $parser = new ezcMailParser; + $parser = new ezcMailParser(); $parser->parseMail($set); $this->_leftToProcess--; } diff --git a/CRM/Mailing/MailStore/Pop3.php b/CRM/Mailing/MailStore/Pop3.php index 49b2b22e35..060df557dd 100644 --- a/CRM/Mailing/MailStore/Pop3.php +++ b/CRM/Mailing/MailStore/Pop3.php @@ -68,13 +68,13 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { 'CiviMail.ignored', date('Y'), date('m'), - date('d') + date('d'), ))); $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, array( 'CiviMail.processed', date('Y'), date('m'), - date('d') + date('d'), ))); } @@ -91,7 +91,7 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { print "fetching message $nr and putting it in the ignored mailbox\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_ignored); - $parser = new ezcMailParser; + $parser = new ezcMailParser(); $parser->parseMail($set); $this->_transport->delete($nr); } @@ -109,7 +109,7 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore { print "fetching message $nr and putting it in the processed mailbox\n"; } $set = new ezcMailStorageSet($this->_transport->fetchByMessageNr($nr), $this->_processed); - $parser = new ezcMailParser; + $parser = new ezcMailParser(); $parser->parseMail($set); $this->_transport->delete($nr); } diff --git a/CRM/Member/BAO/MembershipStatus.php b/CRM/Member/BAO/MembershipStatus.php index 8d1521c7c5..55d1f693fb 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -220,7 +220,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * @param string $joinDate * Join date of the member whose membership status is to be calculated. * @param \date|string $statusDate status date of the member whose membership status is to be calculated. - * @param bool $excludeIsAdminExclude the statuses those having is_admin = 1. + * @param bool $excludeIsAdmin the statuses those having is_admin = 1. * Exclude the statuses those having is_admin = 1. * @param int $membershipTypeID * @param array $membership @@ -228,7 +228,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus { * * @return array */ - static function getMembershipStatusByDate( + public static function getMembershipStatusByDate( $startDate, $endDate, $joinDate, $statusDate = 'today', $excludeIsAdmin = FALSE, $membershipTypeID, $membership = array() ) { diff --git a/CRM/Pledge/StateMachine/Search.php b/CRM/Pledge/StateMachine/Search.php index 52c31332bd..bd709c1e74 100644 --- a/CRM/Pledge/StateMachine/Search.php +++ b/CRM/Pledge/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Pledge_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/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 18b0c2918a..d03b8b2c7b 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -279,7 +279,7 @@ WHERE ct.id = cp.financial_type_id AND * @param int $id * Price Set id. * - * @return boolean + * @return bool * false if fields exist for this set, true if the * set could be deleted * @@ -903,7 +903,7 @@ WHERE id = %1"; $className = CRM_Utils_System::getClassName($form); if (in_array($className, array( 'CRM_Contribute_Form_Contribution', - 'CRM_Member_Form_Membership' + 'CRM_Member_Form_Membership', ))) { $validFieldsOnly = FALSE; } @@ -1310,7 +1310,7 @@ GROUP BY mt.member_of_contact_id"; * * @param int $id * Id of the database record. - * @param bool $isQuickConfigValue we want to set the is_quick_config field. + * @param bool $isQuickConfig we want to set the is_quick_config field. * Value we want to set the is_quick_config field. * * @return Object @@ -1326,9 +1326,8 @@ GROUP BY mt.member_of_contact_id"; * */ public static function checkMembershipPriceSet($id) { - $query = - " -SELECT pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew + $query + = "SELECT pfv.id, pfv.price_field_id, pfv.name, pfv.membership_type_id, pf.html_type, mt.auto_renew FROM civicrm_price_field_value pfv LEFT JOIN civicrm_price_field pf ON pf.id = pfv.price_field_id LEFT JOIN civicrm_price_set ps ON ps.id = pf.price_set_id diff --git a/CRM/Price/Page/Set.php b/CRM/Price/Page/Set.php index 68d0f273fc..84d377d1e9 100644 --- a/CRM/Price/Page/Set.php +++ b/CRM/Price/Page/Set.php @@ -53,12 +53,10 @@ class CRM_Price_Page_Set 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 */ - function &actionLinks() { + public function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { // helper variable for nicer formatting @@ -119,8 +117,6 @@ class CRM_Price_Page_Set 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/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 6fe5be7336..33b84a15d7 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -226,7 +226,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { 'date_format', 'time_format', 'default_value', - 'is_required' + 'is_required', ); foreach ($fieldIDs as $key => $fieldID) { $fieldIDs[$key] = !is_numeric($fieldID) ? CRM_Core_BAO_CustomField::getKeyID($fieldID) : $fieldID; @@ -249,8 +249,8 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $options[$fieldIDs[$key]]['attributes']['is_required'] = !empty($returnValues['is_required']); $options[$fieldIDs[$key]]['attributes']['default_value'] = CRM_Utils_Array::value('default_value', $returnValues); - $options[$fieldIDs[$key]]['attributes']['format'] = - $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues); + $options[$fieldIDs[$key]]['attributes']['format'] + = $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues); $options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues); } @@ -352,7 +352,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $actionParams = array( 'recordId' => $recId, 'gid' => $this->_profileId, - 'id' => $this->_contactId + 'id' => $this->_contactId, ); $op = 'profile.multiValue.row'; } diff --git a/CRM/Profile/Page/Router.php b/CRM/Profile/Page/Router.php index 36f1d9e093..cd989b5b87 100644 --- a/CRM/Profile/Page/Router.php +++ b/CRM/Profile/Page/Router.php @@ -48,7 +48,7 @@ class CRM_Profile_Page_Router extends CRM_Core_Page { */ public function run($args = NULL) { if ($args[1] !== 'profile') { - return; + return NULL; } $secondArg = CRM_Utils_Array::value(2, $args, ''); @@ -75,8 +75,7 @@ class CRM_Profile_Page_Router extends CRM_Core_Page { // make sure that this profile enables mapping // CRM-8609 - $isMap = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileGID, 'is_map'); + $isMap = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileGID, 'is_map'); if (!$isMap) { CRM_Core_Error::statusBounce(ts('This profile does not have the map feature turned on.')); } @@ -126,7 +125,6 @@ class CRM_Profile_Page_Router extends CRM_Core_Page { } CRM_Utils_System::permissionDenied(); - return; } } diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 65784d7e48..8c7ab85c5e 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -362,7 +362,7 @@ WHERE inst.report_id = %1"; * * @param int $instanceId * - * @return boolean + * @return bool * true if yes, else false */ public static function isInstanceGroupRoleAllowed($instanceId) { diff --git a/CRM/Utils/SQL/Select.php b/CRM/Utils/SQL/Select.php index b6db2df801..16f41ae96a 100644 --- a/CRM/Utils/SQL/Select.php +++ b/CRM/Utils/SQL/Select.php @@ -178,7 +178,7 @@ class CRM_Utils_SQL_Select { /** * Given a string like "field_name = @value", replace "@value" with an escaped SQL string * - * @param string SQL expression + * @param $expr SQL expression * @param null|array $args a list of values to insert into the SQL expression; keys are prefix-coded: * prefix '@' => escape SQL * prefix '#' => literal number, skip escaping but do validation diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index d486fa882b..a9874d4dd0 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -173,7 +173,7 @@ function _civicrm_api3_contribution_create_legacy_support_45(&$params) { * @param array $params * (reference ) input parameters. * - * @return boolean + * @return bool * true if success, else false */ function civicrm_api3_contribution_delete($params) { @@ -341,13 +341,12 @@ function civicrm_api3_contribution_transact($params) { * Input parameters. * * @throws Exception - * @return array - * Api result array + * Api result array. */ function civicrm_api3_contribution_sendconfirmation($params) { $contribution = new CRM_Contribute_BAO_Contribution(); $contribution->id = $params['id']; - if (! $contribution->find(TRUE)) { + if (!$contribution->find(TRUE)) { throw new Exception('Contribution does not exist'); } $input = $ids = $cvalues = array('receipt_from_email' => $params['receipt_from_email']); @@ -397,8 +396,7 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) { * {@getfields Contribution_completetransaction} * * @throws API_Exception - * @return array - * Api result array + * Api result array. */ function civicrm_api3_contribution_completetransaction(&$params) { diff --git a/api/v3/ContributionPage.php b/api/v3/ContributionPage.php index af878bdadf..bc2b5e6c41 100644 --- a/api/v3/ContributionPage.php +++ b/api/v3/ContributionPage.php @@ -44,7 +44,7 @@ * * @return array * api result array - * {@getfields contribution_page_create} + * {@getfields contribution_page_create} */ function civicrm_api3_contribution_page_create($params) { $result = _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -74,7 +74,7 @@ function _civicrm_api3_contribution_page_create_spec(&$params) { * * @return array * API Result array Array of matching contribution_pages - * {@getfields contribution_page_get} + * {@getfields contribution_page_get} */ function civicrm_api3_contribution_page_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -92,7 +92,7 @@ function civicrm_api3_contribution_page_get($params) { * * @return array * API result Array - * {@getfields contribution_page_delete} + * {@getfields contribution_page_delete} */ function civicrm_api3_contribution_page_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); @@ -110,7 +110,7 @@ function civicrm_api3_contribution_page_delete($params) { * * @return array * API result array - * {@getfields contribution_page_delete} + * {@getfields contribution_page_delete} */ function civicrm_api3_contribution_page_submit($params) { $result = CRM_Contribute_Form_Contribution_Confirm::submit($params); diff --git a/api/v3/Pledge.php b/api/v3/Pledge.php index c5b0e35754..ed72e2eee9 100644 --- a/api/v3/Pledge.php +++ b/api/v3/Pledge.php @@ -68,9 +68,9 @@ function civicrm_api3_pledge_create($params) { * @param array $params * Array included 'pledge_id' of pledge to delete. * - * @return boolean + * @return bool * true if success, else false - * {@getfields pledge_delete} + * {@getfields pledge_delete} * @example PledgeDelete.php */ function civicrm_api3_pledge_delete($params) { @@ -132,7 +132,7 @@ function _civicrm_api3_pledge_create_spec(&$params) { * * @return array * array of pledges, if error an array with an error id and error message - * {@getfields pledge_get} + * {@getfields pledge_get} * @example PledgeGet.php */ function civicrm_api3_pledge_get($params) { @@ -165,7 +165,6 @@ function _civicrm_api3_pledge_get_defaults() { * @param array $values * The reformatted properties that we can use internally. * - * @return array|CRM_Core_Error */ function _civicrm_api3_pledge_format_params(&$values) { diff --git a/api/v3/WordReplacement.php b/api/v3/WordReplacement.php index 37c2accb28..b25f63dd6f 100644 --- a/api/v3/WordReplacement.php +++ b/api/v3/WordReplacement.php @@ -59,7 +59,7 @@ function civicrm_api3_word_replacement_get($params) { * * @return array * - * {@getfields word_replacement_create} + * {@getfields word_replacement_create} */ function civicrm_api3_word_replacement_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/bin/csv/export.php b/bin/csv/export.php index 370c50dcbf..dcb4378e11 100644 --- a/bin/csv/export.php +++ b/bin/csv/export.php @@ -33,7 +33,7 @@ * php bin/csv/export.php -e [ --field=value --field=value ] [ -s site.org ] * e.g.: php bin/csv/export.php -e Contact --email=jamie@progressivetech.org * - **/ + */ require_once dirname(__DIR__) . '/cli.class.php'; $entityExporter = new civicrm_cli_csv_exporter(); diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 6a931ae8bb..f0ecc8f956 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -410,7 +410,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities // 8 schedule activities that should be shown on dashboard $count = 8; - $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities), 'In line ' . __LINE__); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -446,7 +446,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // 5 activities ( 2 scheduled, 3 Completed ), note that dashboard shows only scheduled activities $count = 2; - $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities), 'In line ' . __LINE__); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -489,7 +489,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // 5 activities, Contact Summary should show all activities $count = 5; - $this->assertEquals($count, sizeof($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities), 'In line ' . __LINE__); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -542,6 +542,6 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // This contact does not have any activities - $this->assertEquals(0, sizeof($activities), 'In line ' . __LINE__); + $this->assertEquals(0, count($activities), 'In line ' . __LINE__); } } diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index d96bc27c5a..d92a9a004f 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -11,7 +11,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { * @return CRM_Contact_BAO_QueryTestDataProvider */ public function dataProvider() { - return new CRM_Contact_BAO_QueryTestDataProvider; + return new CRM_Contact_BAO_QueryTestDataProvider(); } public function setUp() { @@ -75,7 +75,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { $this->callAPISuccess('address', 'create', array( 'contact_id' => $contactID, 'city' => 'Cool City', - 'location_type_id' => 1 + 'location_type_id' => 1, )); $params = array( 0 => array( @@ -117,7 +117,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { $this->callAPISuccess('address', 'create', array( 'contact_id' => $contactID, 'city' => 'Cool City', - 'location_type_id' => 1 + 'location_type_id' => 1, )); $params = array( 0 => array( @@ -160,7 +160,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { $this->callAPISuccess('address', 'create', array( 'contact_id' => $contactID, 'city' => 'Cool City', - 'location_type_id' => 1 + 'location_type_id' => 1, )); $params = array( 0 => array( diff --git a/tests/phpunit/CRM/Queue/Queue/AllTests.php b/tests/phpunit/CRM/Queue/Queue/AllTests.php index ea3675d9ec..10b6f70073 100644 --- a/tests/phpunit/CRM/Queue/Queue/AllTests.php +++ b/tests/phpunit/CRM/Queue/Queue/AllTests.php @@ -47,7 +47,7 @@ class CRM_Queue_Queue_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/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index ade04f9896..0b2879123d 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -384,7 +384,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->openCiviPage('admin/uf/group/field/add', array( 'action' => 'add', 'reset' => 1, - 'gid' => $gid + 'gid' => $gid, ), 'field_name[0]'); $this->select('field_name[0]', "value=Membership"); $this->select('field_name[1]', "label={$checkboxFieldLabel} :: {$customGroupTitle}"); diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index 761763706a..725ddc0227 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -174,10 +174,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { //Assertions $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'"); - $this->assertEquals($actualAmount,null,"Verify actual cost for changed premium"); + $this->assertEquals($actualAmount, NULL, "Verify actual cost for changed premium"); $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'"); - $this->assertEquals($deletedAmount, null, "Verify actual cost for deleted premium"); + $this->assertEquals($deletedAmount, NULL, "Verify actual cost for deleted premium"); } public function testDeletePremium() { @@ -239,7 +239,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { //Assertions $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'"); - $this->assertEquals($actualAmount, null, "Verify actual cost for deleted premium"); + $this->assertEquals($actualAmount, NULL, "Verify actual cost for deleted premium"); } public function testChangePaymentInstrument() { @@ -375,7 +375,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { * * @return null|string */ - function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") { + public function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") { $financialAccount = CRM_Contribute_PseudoConstant::financialAccount(); $query = "SELECT {$select} @@ -405,7 +405,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { * * @return null|string */ - function _getFinancialTrxnAmount($contId) { + public function _getFinancialTrxnAmount($contId) { $query = "SELECT SUM( ft.total_amount ) AS total FROM civicrm_financial_trxn AS ft @@ -421,7 +421,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { * * @return null|string */ - function _getFinancialItemAmount($contId) { + public function _getFinancialItemAmount($contId) { $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); $query = "SELECT SUM(amount) @@ -437,7 +437,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { * * @return null|string */ - function _getTotalContributedAmount($contId) { + public function _getTotalContributedAmount($contId) { $query = "SELECT SUM(amount) FROM civicrm_entity_financial_trxn diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index 6e284b1adf..423208911e 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -112,7 +112,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $this->quickCleanup($tablesToTruncate, TRUE); } - /* + /** * Test that custom fields is returned for correct contact type only */ public function testGetFields() { @@ -120,12 +120,12 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $this->assertArrayHasKey("custom_{$this->IndividualField['id']}", $result['values'], 'If This fails there is probably a caching issue - failure in line' . __LINE__ . print_r(array_keys($result['values']), TRUE)); $result = $this->callAPISuccess('Contact', 'getfields', array( 'action' => 'create', - 'contact_type' => 'Individual' + 'contact_type' => 'Individual', ), 'in line' . __LINE__); $this->assertArrayHasKey("custom_{$this->IndividualField['id']}", $result['values']); $result = $this->callAPISuccess('Contact', 'getfields', array( 'action' => 'create', - 'contact_type' => 'Organization' + 'contact_type' => 'Organization', )); $this->assertArrayNotHasKey("custom_{$this->IndividualField['id']}", $result['values'], 'in line' . __LINE__ . print_r(array_keys($result['values']), TRUE)); $result = $this->callAPISuccess('Relationship', 'getfields', array('action' => 'create'), 'in line' . __LINE__); @@ -233,8 +233,6 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $this->assertTrue(in_array("custom_{$this->IndiStudentField['id']}", $contact['undefined_fields']), __LINE__); } - - // Retrieve Methods /** diff --git a/tests/phpunit/api/v3/SurveyTest.php b/tests/phpunit/api/v3/SurveyTest.php index bb97263ba4..7a5dcbd777 100644 --- a/tests/phpunit/api/v3/SurveyTest.php +++ b/tests/phpunit/api/v3/SurveyTest.php @@ -57,7 +57,7 @@ class api_v3_SurveyTest extends CiviUnitTestCase { public function setUp() { $phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', array( 'label' => 'PhoneBank', - 'return' => 'value' + 'return' => 'value', ), 'integer'); $this->useTransaction(); $this->enableCiviCampaign(); -- 2.25.1