From c5a11b8322a41bc665a828b686290e1a5f135355 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 23 Jun 2015 10:40:15 +1200 Subject: [PATCH] phpcs fixes --- CRM/Contribute/BAO/Query.php | 3 +-- CRM/Contribute/Form/Search.php | 41 +++++++++++++--------------------- CRM/Core/Controller.php | 2 -- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index ca5c26abe2..d25b65b14d 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -65,8 +65,6 @@ class CRM_Contribute_BAO_Query { * If contributions are involved, add the specific contribute fields. * * @param $query - * - * @return void */ public static function select(&$query) { // if contribute mode add contribution id @@ -344,6 +342,7 @@ class CRM_Contribute_BAO_Query { case (strpos($name, '_date') !== FALSE && $name != 'contribution_fulfilled_date'): $qillName = $name; $pseudoExtraParam = NULL; + // @todo including names using a switch statement & then using an 'if' to filter them out is ... odd! if ((strpos($name, '_amount') !== FALSE) || (strpos($name, '_date') !== FALSE) || in_array($name, array( 'contribution_id', diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index c087449267..3539619338 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -29,16 +29,10 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * - */ - -/** - * Files required */ /** - * advanced search, extends basic search + * Advanced search, extends basic search. */ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { @@ -72,19 +66,15 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { /** * Processing needed for buildForm and later. - * - * @return void */ public function preProcess() { $this->set('searchFormName', 'Search'); - /** - * set the button names - */ $this->_searchButtonName = $this->getButtonName('refresh'); $this->_actionButtonName = $this->getButtonName('next', 'action'); $this->_done = FALSE; + // @todo - is this an error - $this->_defaults is used. $this->defaults = array(); /* @@ -161,6 +151,11 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $this->assign('contributionSummary', $this->get('summary')); } + /** + * Set defaults. + * + * @return array + */ public function setDefaultValues() { if (empty($this->_defaults['contribution_status'])) { $this->_defaults['contribution_status'][1] = 1; @@ -170,9 +165,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { /** * Build the form object. - * - * - * @return void */ public function buildQuickForm() { parent::buildQuickForm(); @@ -228,17 +220,13 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { * The post processing of the form gets done here. * * Key things done during post processing are - * - check for reset or next request. if present, skip post procesing. + * - check for reset or next request. if present, skip post processing. * - now check if user requested running a saved search, if so, then * the form values associated with the saved search are used for searching. - * - if user has done a submit with new values the regular post submissing is + * - if user has done a submit with new values the regular post submission is * done. * The processing consists of using a Selector / Controller framework for getting the * search results. - * - * @param - * - * @return void */ public function postProcess() { if ($this->_done) { @@ -377,10 +365,12 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $controller->run(); } + /** + * Use values from $_GET if force is set to TRUE. + * + * Note that this means that GET over-rides POST. This was a historical decision & the reasoning is not explained. + */ public function fixFormValues() { - // if this search has been forced - // then see if there are any get values, and if so over-ride the post values - // note that this means that GET over-rides POST :) if (!$this->_force) { return; } @@ -399,6 +389,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $cid = CRM_Utils_Type::escape($cid, 'Integer'); if ($cid > 0) { $this->_formValues['contact_id'] = $cid; + // @todo - why do we retrieve these when they are not used? list($display, $image) = CRM_Contact_BAO_Contact::getDisplayAndImage($cid); $this->_defaults['sort_name'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'sort_name' @@ -460,7 +451,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { } /** - * Return a descriptive name for the page, used in wizard header + * Return a descriptive name for the page, used in wizard header. * * @return string */ diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index fd5e00da81..7744c60d1f 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -420,8 +420,6 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { * Setter method for stateMachine. * * @param CRM_Core_StateMachine $stateMachine - * - * @return void */ public function setStateMachine($stateMachine) { $this->_stateMachine = $stateMachine; -- 2.25.1