From f2ac86d185136af9151df43c8a1fa71990c4471e Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 10 Jan 2017 14:20:56 +1300 Subject: [PATCH] Further comment fixes --- CRM/Activity/Page/AJAX.php | 5 ++++ CRM/Admin/Form/Setting/Localization.php | 13 +++++++++ CRM/Contact/Form/DedupeFind.php | 5 ++++ CRM/Core/BAO/Country.php | 7 +++++ CRM/Core/BAO/PrevNextCache.php | 10 +++++++ CRM/Core/CodeGen/DAO.php | 10 +++++++ CRM/Core/Config/Runtime.php | 5 ++++ CRM/Core/I18n.php | 17 ++++++++++-- CRM/Core/Page/AJAX.php | 8 ++++++ CRM/Core/Smarty.php | 5 ++++ CRM/Cxn/CiviCxnHttp.php | 11 ++++++++ CRM/Event/Form/ParticipantFeeSelection.php | 5 ++++ CRM/Event/Page/ParticipantListing.php | 5 ++++ CRM/Financial/Form/BatchTransaction.php | 3 ++ CRM/Member/Tokens.php | 5 ++++ CRM/PCP/Form/Campaign.php | 21 +++++++------- CRM/Tag/Form/Edit.php | 5 ++++ CRM/Utils/Hook.php | 3 ++ CRM/Utils/PDF/Label.php | 5 ++++ CRM/Utils/System/Drupal.php | 5 ++++ xml/templates/schema_structure.tpl | 32 ++++++++++++++++++++-- 21 files changed, 171 insertions(+), 14 deletions(-) diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 21388f998e..b7f4e14624 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -389,6 +389,11 @@ class CRM_Activity_Page_AJAX { return (array('error_msg' => $error_msg, 'newId' => $mainActivity->id)); } + /** + * Get activities for the contact. + * + * @return array + */ public static function getContactActivity() { $requiredParameters = array( 'cid' => 'Integer', diff --git a/CRM/Admin/Form/Setting/Localization.php b/CRM/Admin/Form/Setting/Localization.php index bb7b40d87e..bae910d9ff 100644 --- a/CRM/Admin/Form/Setting/Localization.php +++ b/CRM/Admin/Form/Setting/Localization.php @@ -158,6 +158,11 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting { return empty($errors) ? TRUE : $errors; } + /** + * Set the default values for the form. + * + * @return array + */ public function setDefaultValues() { parent::setDefaultValues(); @@ -321,6 +326,14 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting { return $_currencySymbols; } + /** + * Update session and uf_match table when the locale is updated. + * + * @param string $oldLocale + * @param string $newLocale + * @param array $metadata + * @param int $domainID + */ public static function onChangeLcMessages($oldLocale, $newLocale, $metadata, $domainID) { if ($oldLocale == $newLocale) { return; diff --git a/CRM/Contact/Form/DedupeFind.php b/CRM/Contact/Form/DedupeFind.php index efed4257c9..155862b7a7 100644 --- a/CRM/Contact/Form/DedupeFind.php +++ b/CRM/Contact/Form/DedupeFind.php @@ -71,6 +71,11 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { ); } + /** + * Set the default values for the form. + * + * @return array + */ public function setDefaultValues() { $this->_defaults['limit'] = Civi::settings()->get('dedupe_default_limit'); return $this->_defaults; diff --git a/CRM/Core/BAO/Country.php b/CRM/Core/BAO/Country.php index dd0af4daf8..23b3d64eae 100644 --- a/CRM/Core/BAO/Country.php +++ b/CRM/Core/BAO/Country.php @@ -152,6 +152,13 @@ class CRM_Core_BAO_Country extends CRM_Core_DAO_Country { return $cachedSymbol; } + /** + * Get the default currency symbol. + * + * @param string $k Unused variable + * + * @return string + */ public static function getDefaultCurrencySymbol($k = NULL) { $config = CRM_Core_Config::singleton(); return $config->defaultCurrencySymbol(Civi::settings()->get('defaultCurrency')); diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 27bc212eed..ed1e367bd4 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -159,6 +159,16 @@ WHERE cacheKey = %3 AND CRM_Core_DAO::executeQuery($sql, $params); } + /** + * Mark contacts as being in conflict. + * + * @param int $id1 + * @param int $id2 + * @param string $cacheKey + * @param array $conflicts + * + * @return bool + */ public static function markConflict($id1, $id2, $cacheKey, $conflicts) { if (empty($cacheKey) || empty($conflicts)) { return FALSE; diff --git a/CRM/Core/CodeGen/DAO.php b/CRM/Core/CodeGen/DAO.php index 65dd5b82e4..8db0b9d36b 100644 --- a/CRM/Core/CodeGen/DAO.php +++ b/CRM/Core/CodeGen/DAO.php @@ -49,6 +49,9 @@ class CRM_Core_CodeGen_DAO extends CRM_Core_CodeGen_BaseTask { $this->getRaw()); } + /** + * Run generator. + */ public function run() { echo "Generating {$this->name} as " . $this->getRelFileName() . "\n"; @@ -78,11 +81,18 @@ class CRM_Core_CodeGen_DAO extends CRM_Core_CodeGen_BaseTask { return $this->raw; } + /** + * Get relative file name. + * + * @return string + */ public function getRelFileName() { return $this->tables[$this->name]['fileName']; } /** + * Get the absolute file name. + * * @return string */ public function getAbsFileName() { diff --git a/CRM/Core/Config/Runtime.php b/CRM/Core/Config/Runtime.php index 6c9afc8e5b..3282de2d81 100644 --- a/CRM/Core/Config/Runtime.php +++ b/CRM/Core/Config/Runtime.php @@ -138,6 +138,11 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { $this->initialized = 1; } + /** + * Exit processing after a fatal event, outputting the message. + * + * @param string $message + */ private function fatal($message) { echo $message; exit(); diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index de62c3e5cb..ca7706cd9d 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -97,7 +97,11 @@ class CRM_Core_I18n { return $this->_nativegettext; } - + /** + * Set native locale for getText. + * + * @param string $locale + */ protected function setNativeGettextLocale($locale) { $locale .= '.utf8'; @@ -117,6 +121,11 @@ class CRM_Core_I18n { } + /** + * Set getText locale. + * + * @param string $locale + */ protected function setPhpGettextLocale($locale) { // we support both the old file hierarchy format and the new: @@ -138,7 +147,6 @@ class CRM_Core_I18n { } - /** * Return languages available in this instance of CiviCRM. * @@ -221,6 +229,11 @@ class CRM_Core_I18n { return strtr($str, $tr); } + /** + * Get the directory for l10n resources. + * + * @return string + */ public static function getResourceDir() { static $dir = NULL; if ($dir === NULL) { diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php index f52b7a0f31..357b54466e 100644 --- a/CRM/Core/Page/AJAX.php +++ b/CRM/Core/Page/AJAX.php @@ -256,6 +256,14 @@ class CRM_Core_Page_AJAX { return $params; } + /** + * Validate ajax input parameters. + * + * @param array $requiredParams + * @param array $optionalParams + * + * @return array + */ public static function validateParams($requiredParams = array(), $optionalParams = array()) { $params = array(); diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index f3d34eff10..258f1abb47 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -317,6 +317,11 @@ class CRM_Core_Smarty extends Smarty { return $this; } + /** + * Get the locale for translation. + * + * @return string + */ private function getLocale() { $tsLocale = CRM_Core_I18n::getLocale(); if (!empty($tsLocale)) { diff --git a/CRM/Cxn/CiviCxnHttp.php b/CRM/Cxn/CiviCxnHttp.php index da03e65167..f2b2c6357c 100644 --- a/CRM/Cxn/CiviCxnHttp.php +++ b/CRM/Cxn/CiviCxnHttp.php @@ -79,6 +79,17 @@ class CRM_Cxn_CiviCxnHttp extends \Civi\Cxn\Rpc\Http\PhpHttp { return $result; } + /** + * Create stream options. + * + * @param string $verb + * @param string $url + * @param string $blob + * @param array $headers + * + * @return array + * @throws \Exception + */ protected function createStreamOpts($verb, $url, $blob, $headers) { $result = parent::createStreamOpts($verb, $url, $blob, $headers); diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 92658df305..3687471942 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -117,6 +117,11 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { } } + /** + * Set default values for the form. + * + * @return array + */ public function setDefaultValues() { $params = array('id' => $this->_participantId); diff --git a/CRM/Event/Page/ParticipantListing.php b/CRM/Event/Page/ParticipantListing.php index 30a61114df..abaf12c7c6 100644 --- a/CRM/Event/Page/ParticipantListing.php +++ b/CRM/Event/Page/ParticipantListing.php @@ -65,6 +65,11 @@ class CRM_Event_Page_ParticipantListing extends CRM_Core_Page { $this->assign('displayRecent', FALSE); } + /** + * Run listing page. + * + * @throws \Exception + */ public function run() { $this->preProcess(); diff --git a/CRM/Financial/Form/BatchTransaction.php b/CRM/Financial/Form/BatchTransaction.php index f42302243b..457a739b52 100644 --- a/CRM/Financial/Form/BatchTransaction.php +++ b/CRM/Financial/Form/BatchTransaction.php @@ -171,6 +171,9 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { $this->add('text', 'name', ts('Batch Name')); } + /** + * Set the default values for the form. + */ public function setDefaultValues() { // do not setdefault unless it is open/reopened batch if (!in_array($this->_batchStatus, array('Open', 'Reopened'))) { diff --git a/CRM/Member/Tokens.php b/CRM/Member/Tokens.php index c4e8723db4..983ae10035 100644 --- a/CRM/Member/Tokens.php +++ b/CRM/Member/Tokens.php @@ -65,6 +65,11 @@ class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber { && $processor->context['actionMapping']->getEntity() === 'civicrm_membership'; } + /** + * Alter action schedule query. + * + * @param \Civi\ActionSchedule\Event\MailingQueryEvent $e + */ public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e) { if ($e->mapping->getEntity() !== 'civicrm_membership') { return; diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php index f14e59ecb8..8e5ea5fd93 100644 --- a/CRM/PCP/Form/Campaign.php +++ b/CRM/PCP/Form/Campaign.php @@ -29,18 +29,18 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2017 - * $Id$ - * */ /** - * This class generates form components for processing a pcp page creati - * + * This class generates form components for processing a pcp page. */ class CRM_PCP_Form_Campaign extends CRM_Core_Form { public $_context; public $_component; + /** + * Pre-process form. + */ public function preProcess() { // we do not want to display recently viewed items, so turn off $this->assign('displayRecent', FALSE); @@ -64,8 +64,14 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { parent::preProcess(); } + /** + * Set default form values. + * + * @return array + * Default values for the form. + */ public function setDefaultValues() { - $dafaults = array(); + $defaults = array(); $dao = new CRM_PCP_DAO_PCP(); if ($this->_pageId) { @@ -97,8 +103,6 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { $this->add('text', 'pcp_title', ts('Title'), NULL, TRUE); @@ -188,9 +192,6 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form { /** * Process the form submission. - * - * - * @return void */ public function postProcess() { $params = $this->controller->exportValues($this->_name); diff --git a/CRM/Tag/Form/Edit.php b/CRM/Tag/Form/Edit.php index 5c6d7a7cee..2bfa777b86 100644 --- a/CRM/Tag/Form/Edit.php +++ b/CRM/Tag/Form/Edit.php @@ -128,6 +128,11 @@ class CRM_Tag_Form_Edit extends CRM_Admin_Form { parent::buildQuickForm(); } + /** + * Set default values for the form. + * + * @return array + */ public function setDefaultValues() { $defaults = parent::setDefaultValues(); if (empty($this->_id) || !CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $this->_id, 'color')) { diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 889302950e..3f45a8fb71 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -89,6 +89,9 @@ abstract class CRM_Utils_Hook { return self::$_singleton; } + /** + * CRM_Utils_Hook constructor. + */ public function __construct() { $this->cache = CRM_Utils_Cache::create(array( 'name' => 'hooks', diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index 68f7925c4b..e9a504004f 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -255,6 +255,11 @@ class CRM_Utils_PDF_Label extends TCPDF { } } + /** + * Get the available font names. + * + * @return array + */ public function getFontNames() { // Define labels for TCPDF core fonts $fontLabel = array( diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 2ce3eeeb4c..963e7f2d9c 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -299,6 +299,11 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { $base_url = str_replace('http://', 'https://', $base_url); } + /** + * Get the name of the users table. + * + * @return string + */ protected function getUsersTableName() { $userFrameworkUsersTableName = Civi::settings()->get('userFrameworkUsersTableName'); if (empty($userFrameworkUsersTableName)) { diff --git a/xml/templates/schema_structure.tpl b/xml/templates/schema_structure.tpl index 353b004ecf..b52bb6bef2 100644 --- a/xml/templates/schema_structure.tpl +++ b/xml/templates/schema_structure.tpl @@ -36,7 +36,14 @@ */ class CRM_Core_I18n_SchemaStructure {ldelim} - static function &columns() + + /** + * Get translatable columns. + * + * @return array + * A table-indexed array of translatable columns. + */ + public static function &columns() {ldelim} static $result = null; if (!$result) {ldelim} @@ -52,7 +59,14 @@ class CRM_Core_I18n_SchemaStructure {rdelim} return $result; {rdelim} - static function &indices() + + /** + * Get a table indexed array of the indices for translatable fields. + * + * @return array + * Indices for translatable fields. + */ + public static function &indices() {ldelim} static $result = null; if (!$result) {ldelim} @@ -76,6 +90,13 @@ class CRM_Core_I18n_SchemaStructure {rdelim} return $result; {rdelim} + + /** + * Get tables with translatable fields. + * + * @return array + * Array of names of tables with fields that can be translated. + */ static function &tables() {ldelim} static $result = null; @@ -84,6 +105,13 @@ class CRM_Core_I18n_SchemaStructure {rdelim} return $result; {rdelim} + + /** + * Get a list of widgets for editing translatable fields. + * + * @return array + * Array of the widgets for editing translatable fields. + */ static function &widgets() {ldelim} static $result = null; -- 2.25.1