From: Eileen McNaughton Date: Thu, 15 Jan 2015 02:55:34 +0000 (+1300) Subject: more file tidy-ups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0965e98806cb72aaf2d4d726cf78e485f137b292;p=civicrm-core.git more file tidy-ups --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index a7ba162374..71d9810cb6 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -613,8 +613,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { } /** - * @param $activity - * @param null $logMessage + * Create an activity. + * + * @todo elaborate on what this does. + * + * @param CRM_Core_DAO_Activity $activity + * @param string $logMessage * * @return bool */ @@ -638,7 +642,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { } /** - * Get the list Activities + * Get the list Activities. * * @param array $input * Array of parameters. @@ -653,8 +657,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { * - activity_type_id int|string the activitiy types we want to restrict by * * @return array - * (reference) $values the relevant data object values of open activities - * + * Relevant data object values of open activities */ public static function &getActivities($input) { //step 1: Get the basic activity data @@ -897,9 +900,12 @@ ORDER BY fixed_sort_order } /** - * Get the component id and name those are enabled and logged in - * user has permission. To decide whether we are going to include - * component related activities w/ core activity retrieve process. + * Get the component id and name if those are enabled and allowed. + * + * Checks whether logged in user has permission. + * To decide whether we are going to include + * component related activities with core activity retrieve process. + * (what did that just mean?) * * @return array * Array of component id and name. @@ -930,7 +936,7 @@ ORDER BY fixed_sort_order } /** - * Get the activity Count + * Get the activity Count. * * @param array $input * Array of parameters. @@ -943,7 +949,6 @@ ORDER BY fixed_sort_order * * @return int * count of activities - * */ public static function &getActivitiesCount($input) { $input['count'] = TRUE; @@ -966,7 +971,7 @@ LEFT JOIN civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a } /** - * Get the activity sql clause to pick activities + * Get the activity sql clause to pick activities. * * @param array $input * Array of parameters. @@ -980,7 +985,6 @@ LEFT JOIN civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a * * @return int * count of activities - * */ public static function getActivitySQLClause($input) { $params = array(); @@ -1145,8 +1149,9 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND } /** - * Send the message to all the contacts and also insert a - * contact activity in each contacts record + * Send the message to all the contacts. + * + * Also insert a contact activity in each contacts record. * * @param array $contactDetails * The array of contact details to send the email. @@ -1357,6 +1362,8 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND } /** + * Send SMS. + * * @param array $contactDetails * @param array $activityParams * @param array $smsParams diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 506c958f96..2689c3ed56 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -689,7 +689,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); } /** - * Fetch object based on array of properties + * Fetch object based on array of properties. * * @param array $params * (reference ) an assoc array of name/value pairs. @@ -741,7 +741,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); } /** - * Get the display name of a contact + * Get the display name of a contact. * * @param int $id * Id of the contact. @@ -916,13 +916,14 @@ WHERE id={$id}; "; } /** - * Return relative path + * Return relative path. + * * @todo make this a method of $config->userSystem (i.e. UF classes) rather than a static function * * @param string $absolutePath * Absolute path. * - * @return String + * @return string * Relative url of uploaded image */ public static function getRelativePath($absolutePath) { @@ -956,7 +957,7 @@ WHERE id={$id}; "; } /** - * Return proportional height and width of the image + * Return proportional height and width of the image. * * @param int $imageWidth * Width of image. @@ -964,8 +965,8 @@ WHERE id={$id}; "; * @param int $imageHeight * Height of image. * - * @return Array - * thumb dimension of image + * @return array + * Thumb dimension of image */ public static function getThumbSize($imageWidth, $imageHeight) { $thumbWidth = 100; @@ -988,7 +989,7 @@ WHERE id={$id}; "; } /** - * Validate type of contact image + * Validate type of contact image. * * @param array $params * @param string $imageIndex @@ -998,7 +999,7 @@ WHERE id={$id}; "; * @param string $opType * Type of operation like fatal, bounce etc. * - * @return boolean + * @return bool * true if valid image extension */ public static function processImageParams( @@ -1036,7 +1037,7 @@ WHERE id={$id}; "; } /** - * Extract contact id from url for deleting contact image + * Extract contact id from url for deleting contact image. */ public static function processImage() { @@ -1057,15 +1058,13 @@ WHERE id={$id}; "; } /** - * Function to set is_delete true or restore deleted contact + * Function to set is_delete true or restore deleted contact. * * @param int $contact * Contact DAO object. * @param bool $restore * True to set the is_delete = 1 else false to restore deleted contact, * i.e. is_delete = 0 - * - * @return void */ public static function contactTrashRestore($contact, $restore = FALSE) { $op = ($restore ? 'restore' : 'trash'); @@ -1096,8 +1095,6 @@ WHERE id={$id}; "; * * @return string * contact_type if $id found else null "" - * - * */ public static function getContactType($id) { return CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $id, 'contact_type'); @@ -1113,8 +1110,6 @@ WHERE id={$id}; "; * * @return string * contact_sub_type if $id found else null "" - * - * */ public static function getContactSubType($id, $implodeDelimiter = NULL) { $subtype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $id, 'contact_sub_type'); @@ -1137,8 +1132,6 @@ WHERE id={$id}; "; * Id of the contact whose contact sub/contact type is needed. * * @return array - * - * */ public static function getContactTypes($id) { $params = array('id' => $id); @@ -1151,8 +1144,9 @@ WHERE id={$id}; "; if ($contact) { $contactTypes = array(); - if ($contact->contact_sub_type) + if ($contact->contact_sub_type) { $contactTypes = explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($contact->contact_sub_type, CRM_Core_DAO::VALUE_SEPARATOR)); + } array_unshift($contactTypes, $contact->contact_type); return $contactTypes; @@ -1163,7 +1157,7 @@ WHERE id={$id}; "; } /** - * Combine all the importable fields from the lower levels object + * Combine all the importable fields from the lower levels object. * * The ordering is important, since currently we do not have a weight * scheme. Adding weight is super important @@ -1365,9 +1359,9 @@ WHERE id={$id}; "; } /** - * Combine all the exportable fields from the lower levels object + * Combine all the exportable fields from the lower levels object. * - * currentlty we are using importable fields as exportable fields + * Currently we are using importable fields as exportable fields * * @param int|string $contactType contact Type * @param bool $status @@ -1460,7 +1454,6 @@ WHERE id={$id}; "; CRM_Core_DAO_Worldregion::export() ); - $fields = array_merge($fields, CRM_Contact_DAO_Contact::export() ); @@ -1606,14 +1599,15 @@ WHERE id={$id}; "; } /** - * Get the all contact details(Hierarchical) + * Get the all contact details (Hierarchical). * * @param int $contactId * Contact id. * @param array $fields * Fields array. * - * @return $values array contains the contact details + * @return array + * Contact details */ public static function getHierContactDetails($contactId, &$fields) { $params = array(array('contact_id', '=', $contactId, 0, 0)); diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index b0a8cf111e..7cefaae357 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -412,6 +412,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** + * Generate contact ID query. + * * @param array $params * @param $action * @param int $sortID @@ -420,7 +422,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { * * @return Object */ - public function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { + public function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') { $params = array(); $sql = $this->_search->contactIDs($params); @@ -428,7 +430,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** - * @param $rows + * Add actions. + * + * @param array $rows */ public function addActions(&$rows) { $links = self::links($this->_key); @@ -453,7 +457,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** - * @param $rows + * Remove actions. + * + * @param array $rows */ public function removeActions(&$rows) { foreach ($rows as $rid => & $rValue) { diff --git a/CRM/Core/QuickForm/Action/Upload.php b/CRM/Core/QuickForm/Action/Upload.php index a4fea83a62..9c58bdaec6 100644 --- a/CRM/Core/QuickForm/Action/Upload.php +++ b/CRM/Core/QuickForm/Action/Upload.php @@ -31,7 +31,6 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { @@ -67,7 +66,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { } /** - * Upload and move the file if valid to the uploaded directory + * Upload and move the file if valid to the uploaded directory. * * @param CRM_Core_Form $page * The CRM_Core_Form object. @@ -77,8 +76,6 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * The name of the page which index the data container with. * @param string $uploadName * The name of the uploaded file. - * - * @return void */ public function upload(&$page, &$data, $pageName, $uploadName) { // make sure uploadName exists in the QF array @@ -101,7 +98,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { if (!$status) { CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array( 1 => $value['name'], - 2 => $this->_uploadDir + 2 => $this->_uploadDir, ))); } if (!empty($data['values'][$pageName][$uploadName]['name'])) { @@ -123,8 +120,6 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { * CRM_Core_Form the current form-page. * @param string $actionName * Current action name, as one Action object can serve multiple actions. - * - * @return void */ public function perform(&$page, $actionName) { // like in Action_Next @@ -134,11 +129,13 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { // the above buildForm potentially changes the action function with different args // so basically the rug might have been pulled from us, so we actually just check // and potentially call the right one - // this allows standalong form uploads to work nicely + // this allows standalone form uploads to work nicely $page->controller->_actions['upload']->realPerform($page, $actionName); } /** + * @todo what do I do? + * * @param CRM_Core_Form $page * @param string $actionName * diff --git a/CRM/Event/Form/Task/Email.php b/CRM/Event/Form/Task/Email.php index 37f62567b1..8480b2dc69 100644 --- a/CRM/Event/Form/Task/Email.php +++ b/CRM/Event/Form/Task/Email.php @@ -30,7 +30,6 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2014 * $Id: Email.php 45499 2013-02-08 12:31:05Z kurund $ - * */ /** @@ -64,8 +63,6 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { /** * Build all the data structures needed to build the form - * - * @return void */ function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); @@ -78,10 +75,7 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { } /** - * Build the form object - * - * - * @return void + * Build the form object. */ public function buildQuickForm() { //enable form element @@ -91,10 +85,7 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { } /** - * Process the form after the input has been submitted and validated - * - * - * @return void + * Process the form after the input has been submitted and validated. */ public function postProcess() { CRM_Contact_Form_Task_EmailCommon::postProcess($this); diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index d1407fe50a..8a0c98e397 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -30,14 +30,12 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ /** * This class is used to retrieve and display a range of * contacts that match the given criteria (specifically for * results of advanced search options. - * */ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { @@ -130,7 +128,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { protected $_query; /** - * Class constructor + * Class constructor. * * @param array $queryParams * Array of parameters for query. @@ -176,8 +174,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { /** * This method returns the links that are given for each search row. - * currently the links added for each row are * + * Currently the links added for each row are: * - View * - Edit * @@ -249,7 +247,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { /** * Returns total number of rows for the query. * - * @param + * @param int $action * * @return int * Total number of rows @@ -264,7 +262,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { } /** - * Returns all the rows in the given offset and rowCount + * Returns all the rows in the given offset and rowCount. * * @param string $action * The action being performed. @@ -362,6 +360,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { } /** + * Get qill (display what was searched on). + * * @inheritDoc */ public function getQILL() { @@ -369,8 +369,9 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { } /** - * Returns the column headers as an array of tuples: - * (name, sortName (key to the sort array)) + * Returns the column headers as an array of tuples. + * + * Keys are name, sortName, key to the sort array * * @param string $action * The action being performed. @@ -441,6 +442,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base { } /** + * Get sql query string. + * * @return string */ public function &getQuery() { diff --git a/api/v3/EntityTag.php b/api/v3/EntityTag.php index 249515640d..a39ded5c2d 100644 --- a/api/v3/EntityTag.php +++ b/api/v3/EntityTag.php @@ -40,8 +40,7 @@ */ /** - * {@getfields EntityTag_get} - * @example EntityTagGet.php + * Get entity tags. * * @param array $params * @@ -64,9 +63,10 @@ function civicrm_api3_entity_tag_get($params) { } /** - * Adjust Metadata for Get action + * Adjust Metadata for Get action. + * + * The metadata is used for setting defaults, documentation & validation. * - * The metadata is used for setting defaults, documentation & validation * @param array $params * Array or parameters determined by getfields. */ @@ -76,20 +76,18 @@ function _civicrm_api3_entity_tag_get_spec(&$params) { } /** + * Create an entity tag. * * @param array $params * * @return array - * {@getfields EntityTag_create} - * @example EntityTagCreate.php */ function civicrm_api3_entity_tag_create($params) { return _civicrm_api3_entity_tag_common($params, 'add'); } /** - * {@getfields EntityTag_delete} - * @example EntityTagGet.php + * Mark entity tag as removed. * * @param array $params * @@ -101,7 +99,8 @@ function civicrm_api3_entity_tag_delete($params) { } /** - * modify metadata + * Modify metadata. + * * @param array $params */ function _civicrm_api3_entity_tag_delete_spec(&$params) { @@ -110,12 +109,12 @@ function _civicrm_api3_entity_tag_delete_spec(&$params) { } /** + * Helper function for formatting tags (part of api v2 legacy). * * @param array $params * @param string $op * * @return array - * */ function _civicrm_api3_entity_tag_common($params, $op = 'add') { diff --git a/api/v3/MailingEventConfirm.php b/api/v3/MailingEventConfirm.php index eca1e34032..902ab77489 100644 --- a/api/v3/MailingEventConfirm.php +++ b/api/v3/MailingEventConfirm.php @@ -33,7 +33,6 @@ * @subpackage API_MailerGroup * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ /** @@ -63,9 +62,10 @@ function civicrm_api3_mailing_event_confirm_create($params) { } /** - * Adjust Metadata for Create action + * Adjust Metadata for Create action. + * + * The metadata is used for setting defaults, documentation & validation. * - * The metadata is used for setting defaults, documentation & validation * @param array $params * Array or parameters determined by getfields. */ diff --git a/api/v3/MailingEventResubscribe.php b/api/v3/MailingEventResubscribe.php index aa3bdf7d89..d0db0ed977 100644 --- a/api/v3/MailingEventResubscribe.php +++ b/api/v3/MailingEventResubscribe.php @@ -33,19 +33,15 @@ * @subpackage API_MailerGroup * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ /** - * Subscribe from mailing group + * Subscribe from mailing group. * * @param array $params - * Associative array of property. - * name/value pairs to insert in new 'survey' * * @return array * api result array - * {@getfields mailing_event_subscribe_create} */ function civicrm_api3_mailing_event_resubscribe_create($params) { @@ -67,9 +63,10 @@ function civicrm_api3_mailing_event_resubscribe_create($params) { } /** - * Adjust Metadata for Create action + * Adjust Metadata for Create action. + * + * The metadata is used for setting defaults, documentation & validation. * - * The metadata is used for setting defaults, documentation & validation * @param array $params * Array or parameters determined by getfields. */