From 688d37c657b452762efb2eb08382a266d0c2c3c3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 11 Jan 2015 22:52:42 -0500 Subject: [PATCH] INFRA-132 - Docblock fixes --- CRM/Member/BAO/Membership.php | 26 ++++---- CRM/Report/Form.php | 35 +++++------ CRM/Report/Form/Extended.php | 109 +++++++++++++++------------------- 3 files changed, 73 insertions(+), 97 deletions(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index a840e575ee..396b7565e7 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1191,9 +1191,8 @@ INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty * * @return int * the number of members of type $membershipTypeId whose - * start_date is between $startDate and $endDate + * start_date is between $startDate and $endDate */ - //LCD public static function getMembershipStarts($membershipTypeId, $startDate, $endDate, $isTest = 0, $isOwner = 0) { $testClause = 'membership.is_test = 1'; @@ -1586,12 +1585,12 @@ AND civicrm_membership.is_test = %2"; * * @param array $currentMembership * Reference to the array. - * containing all values of - * the current membership + * containing all values of + * the current membership * @param array $changeToday * Array of month, day, year. - * values in case today needs - * to be customised, null otherwise + * values in case today needs + * to be customised, null otherwise * * @return void * @static @@ -1674,10 +1673,10 @@ AND civicrm_membership.is_test = %2"; /** * Get the contribution page id from the membership record * - * @param int membershipId membership id + * @param int $membershipID * * @return int - * $contributionPageId contribution page id + * contribution page id * @static */ public static function getContributionPageId($membershipID) { @@ -1725,6 +1724,7 @@ SELECT c.contribution_page_id as pageID * profile * * @param null $mode + * FIXME: This param is ignored * * @return array * the list of membership fields @@ -1944,7 +1944,6 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * Delete the record that are associated with this Membership Payment * * @param int $membershipId - * Membsership id. * * @return boolean * true if deleted false otherwise @@ -2175,8 +2174,8 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @return int * returns the number of members of type $membershipTypeId - * whose join_date is before $startDate and - * whose start_date is between $startDate and $endDate + * whose join_date is before $startDate and + * whose start_date is between $startDate and $endDate */ public static function getMembershipRenewals($membershipTypeId, $startDate, $endDate, $isTest = 0) { $testClause = 'membership.is_test = 1'; @@ -2339,7 +2338,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * * @param array $errors * - * * @return string */ public static function compileErrorMessage($errors) { @@ -2353,6 +2351,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND /** * Extract relevant values from the form so we can separate form logic from BAO logcis + * * @param CRM_Core_Form $form * @param $changeToday * @param $membershipTypeDetails @@ -2663,7 +2662,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND /** * Process price set and line items. * - * * @param int $membershipId * @param $lineItem * @@ -2882,7 +2880,7 @@ WHERE civicrm_membership.is_test = 0"; } /** - * The function returns the membershiptypes for a particular contact + * Returns the membership types for a particular contact * who has lifetime membership without end date. * * @param int $contactID diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 881730e608..789e165b01 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -96,7 +96,7 @@ class CRM_Report_Form extends CRM_Core_Form { protected $_defaults = array(); - /* + /** * By default most reports hide contact id. * Setting this to true makes it available */ @@ -1341,7 +1341,7 @@ class CRM_Report_Form extends CRM_Core_Form { } } - /* + /** * Adds group filters to _columns (called from _Constuct */ public function buildGroupFilter() { @@ -2447,7 +2447,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->assign('sections', $this->_sections); } - /* + /** * In some cases other functions want to know which fields are selected for ordering by * Separating this into a separate function allows it to be called separately from constructing * the order by clause @@ -2942,17 +2942,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return $this->_resultSet; } - /* - * Get Template file name - use default form template if a specific one has not been set up for this report - */ /** * Use the form name to create the tpl file name * * @return string */ - /** - * @return string - */ public function getTemplateFileName() { $defaultTpl = parent::getTemplateFileName(); $template = CRM_Core_Smarty::singleton(); @@ -2962,12 +2956,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return $defaultTpl; } - /* + /** * Compile the report content + * Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes. * - * Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes. - */ - /** * @return string */ public function compileContent() { @@ -3002,6 +2994,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND /** * @param int $rowCount + * @return array */ public function limit($rowCount = self::ROW_COUNT_LIMIT) { // lets do the pager if in html mode @@ -3764,10 +3757,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a return $addressFields; } - /* - * Do AlterDisplay processing on Address Fields - */ /** + * Do AlterDisplay processing on Address Fields + * * @param $row * @param $rows * @param $rowNum @@ -3831,10 +3823,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a return $entryFound; } - /* - * Adjusts dates passed in to YEAR() for fiscal year. - */ /** + * Adjusts dates passed in to YEAR() for fiscal year. + * * @param string $fieldName * * @return string @@ -3851,7 +3842,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a ($fy['d'] > 1 ? (" - INTERVAL " . ($fy['d'] - 1) . " DAY") : '') . " )"; } - /* + /** * Add Address into From Table if required */ public function addAddressFromClause() { @@ -3972,7 +3963,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a } } - /* function used for showing charts on print screen */ + /** + * function used for showing charts on print screen + */ public static function uploadChartImage() { // upload strictly for '.png' images $name = trim(basename(CRM_Utils_Request::retrieve('name', 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET'))); diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index c38422d8b1..2ae6e145ef 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -43,23 +43,28 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { protected $_baseTable = 'civicrm_contact'; /** - */ - /** + * */ public function __construct() { parent::__construct(); } + /** + * + */ public function preProcess() { parent::preProcess(); } + /** + * + */ public function select() { parent::select(); } - /* + /** * From clause build where baseTable & fromClauses are defined */ public function from() { @@ -77,10 +82,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { } } - /* - * Define any from clauses in use (child classes to override) - */ /** + * Define any from clauses in use (child classes to override) + * * @return array */ public function fromClauses() { @@ -108,7 +112,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { } /** - * @param $rows + * @param array $rows * * @return array */ @@ -124,7 +128,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { } /** - * @param $rows + * @param array $rows */ public function alterDisplay(&$rows) { parent::alterDisplay($rows); @@ -694,34 +698,21 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } - /* - * adding address fields to construct function in reports - * @param array $options - * Options for the report. - * - prefix prefix to add (e.g. 'honor' when getting address details for honor contact - * - prefix_label optional prefix lable eg. "Honoree " for front end - * - group_by enable these fields for group by - default false - * - order_by enable these fields for order by - * - filters enable these fields for filtering - * - defaults - (is this working?) values to pre-populate - * @return array - * address fields for construct clause - */ /** * Get address columns to add to array * * @param array $options - * - prefix Prefix to add to table (in case of more than one instance of the table) - * - prefix_label Label to give columns from this address table instance + * Options for the report. + * - prefix prefix to add (e.g. 'honor' when getting address details for honor contact + * - prefix_label optional prefix lable eg. "Honoree " for front end + * - group_by enable these fields for group by - default false + * - order_by enable these fields for order by + * - filters enable these fields for filtering + * - defaults - (is this working?) values to pre-populate * * @return array * address columns definition */ - /** - * @param array $options - * - * @return array - */ public function getAddressColumns($options = array()) { $defaultOptions = array( 'prefix' => '', @@ -921,10 +912,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { return $addressFields; } - /* - * Get Information about advertised Joins - */ /** + * Get Information about advertised Joins + * * @return array */ public function getAvailableJoins() { @@ -1012,11 +1002,10 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } - /* + /** * Add join from contact table to address. Prefix will be added to both tables * as it's assumed you are using it to get address of a secondary contact - */ - /** + * * @param string $prefix */ public function joinAddressFromContact($prefix = '') { @@ -1039,7 +1028,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { "; } - /* + /** * Define join from line item table to participant table */ public function joinParticipantFromLineItem() { @@ -1049,7 +1038,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { "; } - /* + /** * Define join from line item table to Membership table. Seems to be still via contribution * as the entity. Have made 'inner' to restrict does that make sense? */ @@ -1064,7 +1053,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { "; } - /* + /** * Define join from Participant to Contribution table */ public function joinContributionFromParticipant() { @@ -1075,7 +1064,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { "; } - /* + /** * Define join from Membership to Contribution table */ public function joinContributionFromMembership() { @@ -1226,12 +1215,11 @@ WHERE line_item_civireport.id IS NOT NULL {$this->_aliases['civicrm_event']}.is_template = 0)"; } - /* - * Retrieve text for financial type from pseudoconstant - */ /** + * Retrieve text for financial type from pseudoconstant + * * @param $value - * @param $row + * @param array $row * * @return string */ @@ -1245,12 +1233,11 @@ WHERE line_item_civireport.id IS NOT NULL " . $value . ""; } - /* - * Retrieve text for contribution type from pseudoconstant - */ /** + * Retrieve text for contribution type from pseudoconstant + * * @param $value - * @param $row + * @param array $row * * @return array|string */ @@ -1258,12 +1245,11 @@ WHERE line_item_civireport.id IS NOT NULL return is_string(CRM_Contribute_PseudoConstant::financialType($value, FALSE)) ? CRM_Contribute_PseudoConstant::financialType($value, FALSE) : ''; } - /* - * Retrieve text for contribution status from pseudoconstant - */ /** + * Retrieve text for contribution status from pseudoconstant + * * @param $value - * @param $row + * @param array $row * * @return array */ @@ -1271,12 +1257,11 @@ WHERE line_item_civireport.id IS NOT NULL return CRM_Contribute_PseudoConstant::contributionStatus($value); } - /* - * Retrieve text for payment instrument from pseudoconstant - */ /** + * Retrieve text for payment instrument from pseudoconstant + * * @param $value - * @param $row + * @param array $row * * @return array */ @@ -1286,7 +1271,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * * @return array|string */ @@ -1296,7 +1281,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * * @return array|string */ @@ -1306,7 +1291,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * * @return array|string */ @@ -1316,7 +1301,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * @param $selectedfield * @param string $criteriaFieldName * @@ -1335,7 +1320,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * @param $selectedfield * @param string $criteriaFieldName * @@ -1354,7 +1339,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * @param $selectedfield * @param string $criteriaFieldName * @@ -1374,7 +1359,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value - * @param $row + * @param array $row * @param string $fieldname * * @return mixed @@ -1400,7 +1385,7 @@ WHERE line_item_civireport.id IS NOT NULL /** * @param $value * - * @return string + * @return string|void */ public function alterParticipantRole($value) { if (empty($value)) { -- 2.25.1