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 0ceb4b124da8..4a85ba1dda54 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 @@ public static function groupPermission( //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 c1fdd6014ab6..6ce40979d397 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -72,7 +72,7 @@ public function preProcess() { 'activity_type_id', 'activity_label', 'target_contact_id', - 'activity_subject' + 'activity_subject', ); foreach ($requiredFields as $val) { $highlightedFields[] = $val; @@ -195,7 +195,7 @@ public function buildQuickForm() { $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 0673689d4478..854ca2ba7581 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -202,7 +202,7 @@ public function buildQuickForm() { 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 @@ public function buildQuickForm() { '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 a36fb93d6d35..5d16dfc5de30 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 @@ function preProcess() { if (!in_array($this->_operation, array( 'reserve', 'release', - 'interview' + 'interview', )) ) { $this->_operation = 'reserve'; @@ -232,7 +232,7 @@ public function buildQuickForm() { $taskValue = array( $currentTaskValue => ts('Record %1 Responses', array(1 => $activityTypes[$surveyTypeId]) - ) + ), ); } @@ -356,7 +356,7 @@ public function formatParams() { $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 84ab2f6a47a4..8163555c9865 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -104,8 +104,6 @@ public function preProcess() { * 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 @@ public function setDefaultValues() { /** * Build the form object * - * @param null - * * @return void */ public function buildQuickForm() { @@ -190,8 +186,6 @@ public function buildQuickForm() { /** * Process the form * - * @param null - * * @return void */ public function postProcess() { @@ -229,7 +223,7 @@ public function postProcess() { 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 99f77408d3a9..e742e619c406 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -108,8 +108,8 @@ public function preProcess() { $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 @@ public function validateIds() { 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 @@ public function setDefaultValues() { } 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 @@ public function setDefaultValues() { ); } 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 d5dded61d2b2..5408b52a98f2 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -68,7 +68,7 @@ public function run($clientID, $caseID, $activitySetName, $params) { public function &getRedactionRules() { foreach (array( 'redactionStringRules', - 'redactionRegexRules' + 'redactionRegexRules', ) as $key => $rule) { $$rule = CRM_Case_PseudoConstant::redactionRule($key); @@ -96,7 +96,7 @@ public function &getRedactionRules() { * * @return array */ - function &caseInfo( + public function &caseInfo( $clientID, $caseID ) { @@ -323,7 +323,7 @@ public function &getActivity($clientID, $activityDAO, &$activityTypeInfo) { $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 @@ public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) { 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 e9b4355b03d3..04f36414bd4b 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 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force 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 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force * @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 35818a546651..fe1f399a78e0 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -254,8 +254,6 @@ public function buildClause() { $this->where_tables = serialize($whereTables); } } - - return; } public function save() { diff --git a/CRM/Contact/Form/Location.php b/CRM/Contact/Form/Location.php index 008291f0418e..8c2f938740bd 100644 --- a/CRM/Contact/Form/Location.php +++ b/CRM/Contact/Form/Location.php @@ -56,7 +56,7 @@ public static function preProcess(&$form) { $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 cca35084f212..dd1d45bc3ac4 100644 --- a/CRM/Contact/Form/Search/Custom/Base.php +++ b/CRM/Contact/Form/Search/Custom/Base.php @@ -95,7 +95,7 @@ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL * * @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 a1f3153f859a..814360b6a336 100644 --- a/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php +++ b/CRM/Contact/Form/Search/Custom/FullText/AbstractPartialQuery.php @@ -161,9 +161,9 @@ public function runQueries($queryText, &$tables, $entityIDTableName, $limit) { } $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 53ebf0e47b14..66ea3e178604 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -68,8 +68,6 @@ public function __construct(&$formValues) { $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 @@ public function setDefaultValues() { * * @return string */ - function all( + public function all( $offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE ) { @@ -354,8 +352,6 @@ public function from() { 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 7ac5c0a5f4a5..5d88beabe14d 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 a14f730d4c59..c769dc5a37f0 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -176,7 +176,7 @@ public function buildUserDashBoard() { '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 @@ public function run() { * @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 96aa20b062f4..806e5062ebd1 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -161,7 +161,7 @@ public function preProcess() { */ 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 @@ public function buildQuickForm() { ), ) ); - - $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'mailing_backend' ); @@ -429,8 +427,8 @@ public function processCreditCard($submittedValues) { //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 66cf5f3cb7b1..446e2ad7cb0b 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -664,7 +664,7 @@ public function buildQuickForm() { 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 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem ); //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 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem $this->_id, 'Contribution' ); - - if (empty($paymentParams['is_recur'])) { $contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($this, $this->_params, @@ -1818,7 +1816,6 @@ public function processCreditCard($submittedValues, $config, $session, $lineItem /** * @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 7a5ceec45dc2..be4ce875002a 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -152,7 +152,7 @@ public function buildQuickForm() { } $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 @@ public function setDefaultValues() { '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 @@ public function postProcess() { 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 d34a4ae25e3a..9f50f5cccf32 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 @@ public function postProcess() { 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 @@ public function postProcess() { '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 3ac33c18556f..40ed6325ebc1 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -140,7 +140,7 @@ public function init() { * @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 @@ public function mapField(&$values) { * @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 @@ public function preview(&$values) { * @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 @@ public function summary(&$values) { * @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 1d1ba4f993b2..12a8f68c06d6 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -104,7 +104,6 @@ public static function &recurLinks($recurID = FALSE, $context = 'contribution') /** * called when action is browse * - * @return null */ public function browse() { // add annual contribution @@ -252,7 +251,7 @@ public function preProcess() { 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 9e5b1788fbe4..2371436d10a0 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -63,9 +63,9 @@ public static function add(&$params) { * 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 @@ public static function allEntityIMs(&$entityElements) { 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 aed679ab98c9..33f234af3be4 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -109,7 +109,7 @@ public static function createLocBlock(&$location, &$entityElements) { '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 @@ public static function deleteLocBlock($locBlockId) { * @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 @@ public static function checkPrimaryBlocks($contactId) { '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 28b1f5b4482b..b12eb19051f9 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -84,7 +84,7 @@ public static function getMenus() { /** * 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 @@ public static function buildNavigationTree(&$navigationTree, $parentID, $navigat 'parentID' => $navigation->parent_id, 'navID' => $navigation->id, 'active' => $navigation->is_active, - ) + ), ); self::buildNavigationTree($navigationTree[$navigation->id]['child'], $navigation->id, $navigationMenu); } @@ -493,7 +493,7 @@ public static function getMenuName(&$value, &$skipMenuItems) { //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 8a323498a6c5..2608314c1965 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 @@ private static function _getGid() { * @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 @@ public static function &getList($namesOnly = FALSE) { /** * 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 166bf8a4069e..c13df3de6ec1 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 @@ public static function getPageOrientations() { /** * 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 @@ public static function getUnits() { /** * 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 @@ public static function &getList($namesOnly = FALSE) { /** * 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 82527f3b7f12..eee35c7b5d81 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -60,7 +60,6 @@ public function __construct() { * * @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 f6f09d398064..c1b528cc780a 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -47,8 +47,8 @@ public function parse($schemaPath, $buildVersion) { 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 @@ public function getTable($tableXML, &$database, &$tables) { } $tables[$name] = &$table; - return; } /** @@ -303,7 +302,7 @@ public function getField(&$fieldXML, &$fields) { $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 edf530427c1c..6b7b5c4e3900 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -159,9 +159,9 @@ static protected function setBillingDetailsFields(&$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 @@ public static function buildPaymentForm($form, $processor, $isBillingDataOptiona // 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 9b4ca59a0708..23969c6ca5a8 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -114,7 +114,7 @@ public static function getPermission() { * array('access CiviEvent', 'access CiviContribute') * ), * - * @return boolean + * @return bool * true if yes, else false */ public static function check($permissions) { @@ -162,7 +162,7 @@ public static function checkAnyPerm($perms) { * @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 @@ public static function getCorePermissions() { * 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 7f7749190b22..d7c40e1a6d56 100644 --- a/CRM/Event/BAO/ParticipantPayment.php +++ b/CRM/Event/BAO/ParticipantPayment.php @@ -76,8 +76,8 @@ public static function create(&$params, &$ids) { $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 @@ public static function create(&$params, &$ids) { 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 @@ public static function create(&$params, &$ids) { * @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 59d1d18231c3..a8200887bf5c 100644 --- a/CRM/Event/Badge/Logo5395.php +++ b/CRM/Event/Badge/Logo5395.php @@ -44,7 +44,7 @@ public function generateLabel($participant) { '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 f6c45b5e4e02..53c2ad11bc5f 100644 --- a/CRM/Event/Form/Task/PickProfile.php +++ b/CRM/Event/Form/Task/PickProfile.php @@ -99,7 +99,7 @@ public function buildQuickForm() { $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 e4ac8a1f39eb..192c5adafd8a 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -87,7 +87,7 @@ public function preProcess() { 'first_name', 'last_name', 'external_identifier', - 'participant_status_id' + 'participant_status_id', ); foreach ($highlightedFieldsArray as $name) { $highlightedFields[] = $name; @@ -158,8 +158,6 @@ public function buildQuickForm() { $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 @@ public static function formRule($fields, $files, $self) { } 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 0b03eaf08be3..e613cd4773bf 100644 --- a/CRM/Financial/Page/BatchTransaction.php +++ b/CRM/Financial/Page/BatchTransaction.php @@ -104,8 +104,8 @@ public function run() { 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 2b39759e4722..71f8c27c0a0c 100644 --- a/CRM/Mailing/MailStore/Mbox.php +++ b/CRM/Mailing/MailStore/Mbox.php @@ -59,13 +59,13 @@ public function __construct($file) { '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 @@ public function markIgnored($nr) { 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 @@ public function markProcessed($nr) { 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 49b2b22e353c..060df557dd75 100644 --- a/CRM/Mailing/MailStore/Pop3.php +++ b/CRM/Mailing/MailStore/Pop3.php @@ -68,13 +68,13 @@ public function __construct($host, $username, $password, $ssl = TRUE) { '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 @@ public function markIgnored($nr) { 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 @@ public function markProcessed($nr) { 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 8d1521c7c50a..55d1f693fbf8 100644 --- a/CRM/Member/BAO/MembershipStatus.php +++ b/CRM/Member/BAO/MembershipStatus.php @@ -220,7 +220,7 @@ public static function del($membershipStatusId) { * @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 @@ public static function del($membershipStatusId) { * * @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 52c31332bd89..bd709c1e7425 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 18b0c2918af4..d03b8b2c7b5a 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -279,7 +279,7 @@ public static function &getUsedBy($id, $simpleReturn = FALSE) { * @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 @@ public static function buildPriceSet(&$form) { $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 @@ public static function eventPriceSetDomainID() { * * @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 @@ public static function setIsQuickConfig($id, $isQuickConfig) { * */ 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 68d0f273fc9c..84d377d1e913 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 @@ function &actionLinks() { * 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 6fe5be7336ff..33b84a15d720 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -226,7 +226,7 @@ public function browse() { '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 @@ public function browse() { $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 @@ public function browse() { $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 36f1d9e093dd..cd989b5b8732 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 @@ public function run($args = NULL) { // 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 @@ public function run($args = NULL) { } CRM_Utils_System::permissionDenied(); - return; } } diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 65784d7e4828..8c7ab85c5eb7 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -362,7 +362,7 @@ public static function isInstancePermissioned($instanceId) { * * @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 b6db2df8019f..16f41ae96a32 100644 --- a/CRM/Utils/SQL/Select.php +++ b/CRM/Utils/SQL/Select.php @@ -178,7 +178,7 @@ public function limit($limit, $offset = 0) { /** * 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 d486fa882b93..a9874d4dd05e 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 af878bdadf8c..bc2b5e6c416a 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 c5b0e3575493..ed72e2eee94c 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 37c2accb2842..b25f63dd6fff 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 370c50dcbf02..dcb4378e1137 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 6a931ae8bb96..f0ecc8f956b7 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -410,7 +410,7 @@ public function testGetActivitiesforAdminDashboard() { //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 @@ public function testGetActivitiesforNonAdminDashboard() { //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 @@ public function testGetActivitiesforContactSummary() { //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 @@ public function testGetActivitiesforContactSummaryWithNoActivities() { //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 d96bc27c5a45..d92a9a004fd8 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 @@ public function testSearchProfileHomeCityCRM14263() { $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 @@ public function testSearchProfileHomeCityNoResultsCRM14263() { $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 @@ public function testSearchProfilePrimaryCityCRM14263() { $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 ea3675d9ecef..10b6f700730e 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 ade04f989659..0b2879123dfb 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -384,7 +384,7 @@ public function testOnBehalfOfOrganizationWithMembershipData() { $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 761763706a68..725ddc02277e 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -174,10 +174,10 @@ public function testChangePremium() { //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 @@ public function testDeletePremium() { //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 @@ public function testChangeFinancialType() { * * @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 @@ function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL * * @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 @@ function _getFinancialTrxnAmount($contId) { * * @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 @@ function _getFinancialItemAmount($contId) { * * @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 6e284b1adf06..423208911e4d 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -112,7 +112,7 @@ public function tearDown() { $this->quickCleanup($tablesToTruncate, TRUE); } - /* + /** * Test that custom fields is returned for correct contact type only */ public function testGetFields() { @@ -120,12 +120,12 @@ public function testGetFields() { $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 @@ public function testAddIndividualStudentCustomDataToIndividualParent() { $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 bb97263ba4a6..7a5dcbd7777f 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();