Add comment blocks
authoreileen <emcnaughton@wikimedia.org>
Tue, 10 Jan 2017 00:14:52 +0000 (13:14 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 10 Jan 2017 01:21:13 +0000 (14:21 +1300)
24 files changed:
CRM/Activity/Tokens.php
CRM/Admin/Form/Setting/Localization.php
CRM/Campaign/Form/Search.php
CRM/Case/Form/Task/PDF.php
CRM/Core/CodeGen/Reflection.php
CRM/Core/CodeGen/Util/Template.php
CRM/Core/Config/MagicMerge.php
CRM/Core/DAO/AllCoreTables.php
CRM/Core/Error/Log.php
CRM/Core/Page/AJAX.php
CRM/Core/Page/File.php
CRM/Core/Payment/eWAY.php
CRM/Event/Tokens.php
CRM/Extension/Manager/Report.php
CRM/Extension/Manager/Search.php
CRM/Financial/Page/Batch.php
CRM/Logging/Reverter.php
CRM/Mailing/Tokens.php
CRM/Utils/File.php
CRM/Utils/PDF/Document.php
CRM/Utils/System/Backdrop.php
CRM/Utils/System/Base.php
CRM/Utils/System/Drupal6.php
xml/templates/civicrm_version.tpl

index 990e2af5499ae4bc840c9eaa49d6db8020e75f40..ed487e2f114e9c1b90dabfce3ee899f94eea3024 100644 (file)
@@ -45,6 +45,9 @@
  */
 class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
 
+  /**
+   * CRM_Activity_Tokens constructor.
+   */
   public function __construct() {
     parent::__construct('activity', array(
       'activity_id' => ts('Activity ID'),
index 6101fd33b7855aa46f2266225e15a61794112bf4..bb7b40d87eab587e86335ccc960fce05ec3766aa 100644 (file)
@@ -277,6 +277,8 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
   }
 
   /**
+   * Get the default locale options.
+   *
    * @return array
    */
   public static function getDefaultLocaleOptions() {
index 67084701bb285c581cf9ac85b931a610fa254e43..da3d9fafbcb15522f5d3929c056f83bddbe232ff 100644 (file)
@@ -175,8 +175,12 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
     CRM_Utils_System::setTitle(ts('Find Respondents To %1', array(1 => ucfirst($this->_operation))));
   }
 
+  /**
+   * Load the default survey for all actions.
+   *
+   * @return array
+   */
   public function setDefaultValues() {
-    //load the default survey for all actions.
     if (empty($this->_defaults)) {
       $defaultSurveyId = key(CRM_Campaign_BAO_Survey::getSurveys(TRUE, TRUE));
       if ($defaultSurveyId) {
index 42cbfc803310b44ab948bc22a42e9f1046bc1db3..0a2434bc586b0aa8dbb0455037aea25c7b90113d 100644 (file)
@@ -56,6 +56,11 @@ class CRM_Case_Form_Task_PDF extends CRM_Case_Form_Task {
     CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
   }
 
+  /**
+   * Set defaults for the pdf.
+   *
+   * @return array
+   */
   public function setDefaultValues() {
     return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
   }
index 8741e2a0cd23af647b6248fe8767207661e2010c..2b022ffefbaf2822e0d3cf7716f68f14fa21f34e 100644 (file)
@@ -31,6 +31,9 @@ class CRM_Core_CodeGen_Reflection extends CRM_Core_CodeGen_BaseTask {
   }
 
 
+  /**
+   * Run generator.
+   */
   public function run() {
     echo "Generating table list\n";
     $template = new CRM_Core_CodeGen_Util_Template('php');
@@ -55,12 +58,19 @@ class CRM_Core_CodeGen_Reflection extends CRM_Core_CodeGen_BaseTask {
   }
 
   /**
+   * Get absolute file name.
+   *
    * @return string
    */
   protected function getAbsFileName() {
     return $this->config->CoreDAOCodePath . "AllCoreTables.data.php";
   }
 
+  /**
+   * Get the checksum for the schema.
+   *
+   * @return string
+   */
   protected function getSchemaChecksum() {
     if (!$this->checksum) {
       CRM_Utils_Array::flatten($this->tables, $flat);
index 36af880bf63ef050f93a6fdda83ab5622cd526c5..b7d2bf00019e6531fed014091fcc277f5e6a6536 100644 (file)
@@ -49,6 +49,8 @@ class CRM_Core_CodeGen_Util_Template {
   }
 
   /**
+   * Run template generator.
+   *
    * @param string $infile
    *   Filename of the template, without a path.
    * @param string $outpath
@@ -68,6 +70,13 @@ class CRM_Core_CodeGen_Util_Template {
     }
   }
 
+  /**
+   * Fetch via Smarty.
+   *
+   * @param string $infile
+   *
+   * @return string
+   */
   public function fetch($infile) {
     return $this->smarty->fetch($infile);
   }
index 2e02db292bd49a73e4529f842a89b574fd4f990f..72fe7827ed6ccad5b1f9f2edd91b1b7972c78455 100644 (file)
@@ -58,10 +58,16 @@ class CRM_Core_Config_MagicMerge {
 
   private $cache = array();
 
+  /**
+   * CRM_Core_Config_MagicMerge constructor.
+   */
   public function __construct() {
     $this->map = self::getPropertyMap();
   }
 
+  /**
+   * Set the map to the property map.
+   */
   public function __wakeup() {
     $this->map = self::getPropertyMap();
   }
@@ -204,6 +210,14 @@ class CRM_Core_Config_MagicMerge {
     );
   }
 
+  /**
+   * Get value.
+   *
+   * @param string $k
+   *
+   * @return mixed
+   * @throws \CRM_Core_Exception
+   */
   public function __get($k) {
     if (!isset($this->map[$k])) {
       throw new \CRM_Core_Exception("Cannot read unrecognized property CRM_Core_Config::\${$k}.");
@@ -281,6 +295,14 @@ class CRM_Core_Config_MagicMerge {
     }
   }
 
+  /**
+   * Set value.
+   *
+   * @param string $k
+   * @param mixed $v
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function __set($k, $v) {
     if (!isset($this->map[$k])) {
       throw new \CRM_Core_Exception("Cannot set unrecognized property CRM_Core_Config::\${$k}");
@@ -311,10 +333,24 @@ class CRM_Core_Config_MagicMerge {
     }
   }
 
+  /**
+   * Is value set.
+   *
+   * @param string $k
+   *
+   * @return bool
+   */
   public function __isset($k) {
     return isset($this->map[$k]);
   }
 
+  /**
+   * Unset value.
+   *
+   * @param string $k
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function __unset($k) {
     if (!isset($this->map[$k])) {
       throw new \CRM_Core_Exception("Cannot unset unrecognized property CRM_Core_Config::\${$k}");
@@ -358,6 +394,9 @@ class CRM_Core_Config_MagicMerge {
     return $this->settings;
   }
 
+  /**
+   * Initialise local settings.
+   */
   private function initLocals() {
     if ($this->locals === NULL) {
       $this->locals = array(
index edbfd1efc64b19a08ffe9235108517976a2d0737..31987ffa43c734377401861664e3c0f0cee6d847 100644 (file)
@@ -30,8 +30,6 @@
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2017
- * $Id$
- *
  */
 class CRM_Core_DAO_AllCoreTables {
 
@@ -39,6 +37,11 @@ class CRM_Core_DAO_AllCoreTables {
   private static $daoToClass = NULL;
   private static $entityTypes = NULL;
 
+  /**
+   * Initialise.
+   *
+   * @param bool $fresh
+   */
   public static function init($fresh = FALSE) {
     static $init = FALSE;
     if ($init && !$fresh) {
@@ -68,6 +71,12 @@ class CRM_Core_DAO_AllCoreTables {
 
   /**
    * (Quasi-Private) Do not call externally (except for unit-testing)
+   *
+   * @param string $daoName
+   * @param string $className
+   * @param string $tableName
+   * @param string $fields_callback
+   * @param string $links_callback
    */
   public static function registerEntityType($daoName, $className, $tableName, $fields_callback = NULL, $links_callback = NULL) {
     self::$daoToClass[$daoName] = $className;
@@ -128,11 +137,20 @@ class CRM_Core_DAO_AllCoreTables {
     return FALSE !== array_search($tableName, self::tables());
   }
 
+  /**
+   * Get the DAO for the class.
+   *
+   * @param string $className
+   *
+   * @return string
+   */
   public static function getCanonicalClassName($className) {
     return str_replace('_BAO_', '_DAO_', $className);
   }
 
   /**
+   * Get a list of all DAO classes.
+   *
    * @return array
    *   List of class names.
    */
@@ -140,6 +158,12 @@ class CRM_Core_DAO_AllCoreTables {
     return array_values(self::daoToClass());
   }
 
+  /**
+   * Get the classname for the table.
+   *
+   * @param string $tableName
+   * @return string
+   */
   public static function getClassForTable($tableName) {
     //CRM-19677: on multilingual setup, trim locale from $tableName to fetch class name
     if (CRM_Core_I18n::isMultilingual()) {
@@ -182,6 +206,11 @@ class CRM_Core_DAO_AllCoreTables {
       self::tables());
   }
 
+  /**
+   * Reinitialise cache.
+   *
+   * @param bool $fresh
+   */
   public static function reinitializeCache($fresh = FALSE) {
     self::init($fresh);
   }
@@ -206,11 +235,12 @@ class CRM_Core_DAO_AllCoreTables {
       $exports = array();
       $fields = $dao::fields();
 
-      foreach($fields as $name => $field) {
+      foreach ($fields as $name => $field) {
         if (CRM_Utils_Array::value('export', $field)) {
           if ($prefix) {
             $exports[$labelName] = & $fields[$name];
-          } else {
+          }
+          else {
             $exports[$name] = & $fields[$name];
           }
         }
@@ -245,11 +275,12 @@ class CRM_Core_DAO_AllCoreTables {
       $imports = array();
       $fields = $dao::fields();
 
-      foreach($fields as $name => $field) {
+      foreach ($fields as $name => $field) {
         if (CRM_Utils_Array::value('import', $field)) {
           if ($prefix) {
             $imports[$labelName] = & $fields[$name];
-          } else {
+          }
+          else {
             $imports[$name] = & $fields[$name];
           }
         }
index 3e301981a1d3f73d26797a45b8d10c28e3018f9d..80a28cba02615827209e3ad64bc4c0da6dbe854d 100644 (file)
@@ -33,6 +33,9 @@
  */
 class CRM_Core_Error_Log extends \Psr\Log\AbstractLogger {
 
+  /**
+   * CRM_Core_Error_Log constructor.
+   */
   public function __construct() {
     $this->map = array(
       \Psr\Log\LogLevel::DEBUG => PEAR_LOG_DEBUG,
index 8d6add8e283105d8cfedc8199769e9e88d1ecfc0..f52b7a0f318b4bf419c5e8e7a16f75442303ad0d 100644 (file)
@@ -214,6 +214,16 @@ class CRM_Core_Page_AJAX {
     CRM_Utils_System::setHttpHeader('Cache-Control', "max-age=$ttl, public");
   }
 
+  /**
+   * Set defaults for sort and pager.
+   *
+   * @param int $defaultOffset
+   * @param int $defaultRowCount
+   * @param string $defaultSort
+   * @param string $defaultsortOrder
+   *
+   * @return array
+   */
   public static function defaultSortAndPagerParams($defaultOffset = 0, $defaultRowCount = 25, $defaultSort = NULL, $defaultsortOrder = 'asc') {
     $params = array(
       '_raw_values' => array(),
index 98fc0fa142289f0b5a228950f270311fb2ad5d97..a04428b603532cccd2e698c1fffb671ba39da690 100644 (file)
@@ -34,6 +34,9 @@
  */
 class CRM_Core_Page_File extends CRM_Core_Page {
 
+  /**
+   * Run page.
+   */
   public function run() {
     $fileName = CRM_Utils_Request::retrieve('filename', 'String', $this);
     $path = CRM_Core_Config::singleton()->customFileUploadDir . $fileName;
index f1b4e733361c2ee854ba0aecf469560aa4a1aba1..10be2be366210eb063cf93af9e44ce76ba8c6b13 100644 (file)
@@ -95,6 +95,9 @@
 require_once 'eWAY/eWAY_GatewayRequest.php';
 require_once 'eWAY/eWAY_GatewayResponse.php';
 
+/**
+ * Class CRM_Core_Payment_eWAY.
+ */
 class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
   # (not used, implicit in the API, might need to convert?)
   const CHARSET = 'UTF-8';
index 0f96ef0138eba8022f5987da392a907a9010beac..2a502554405813ced5cf36641c7bf85184760b48 100644 (file)
@@ -72,6 +72,11 @@ class CRM_Event_Tokens extends \Civi\Token\AbstractTokenSubscriber {
       && $processor->context['actionMapping']->getEntity() === 'civicrm_participant';
   }
 
+  /**
+   * Alter action schedule query.
+   *
+   * @param \Civi\ActionSchedule\Event\MailingQueryEvent $e
+   */
   public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e) {
     if ($e->mapping->getEntity() !== 'civicrm_participant') {
       return;
index b7e579c13dcd572d1513a6a1be76ddafece7fa72..8f92b9a7cdf963cbb289514b70123ef238226ad9 100644 (file)
@@ -35,6 +35,9 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base {
 
   const REPORT_GROUP_NAME = 'report_template';
 
+  /**
+   * CRM_Extension_Manager_Report constructor.
+   */
   public function __construct() {
     parent::__construct(TRUE);
     $this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
index 0735f41921612f3336e415e3b5f1f8055cffac6e..684d1027ca38a2ed5875d393a4c3859b03d142e6 100644 (file)
@@ -35,6 +35,9 @@ class CRM_Extension_Manager_Search extends CRM_Extension_Manager_Base {
 
   const CUSTOM_SEARCH_GROUP_NAME = 'custom_search';
 
+  /**
+   * CRM_Extension_Manager_Search constructor.
+   */
   public function __construct() {
     parent::__construct(TRUE);
     $this->groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
index 05741098cd0dd01b0875b549eab03a0f2dc07b45..58126d73d6fb0e6175e5b326711ac10ea49aaf95 100644 (file)
@@ -53,6 +53,9 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic {
     return 'CRM_Batch_BAO_Batch';
   }
 
+  /**
+   * Get links.
+   */
   public function &links() {
   }
 
index 79ffb51a9f269d00794aca61c2765b0e431f3eb9..7d838dc641d251bb2a30a4befbf60febac5bb987 100644 (file)
@@ -66,6 +66,11 @@ class CRM_Logging_Reverter {
     $this->diffs = $differ->diffsInTables($tables);
   }
 
+  /**
+   * Setter for diffs.
+   *
+   * @param array $diffs
+   */
   public function setDiffs($diffs) {
     $this->diffs = $diffs;
   }
index 1c777ae05bf8bec3721ed25b89d0a4a97f44a43d..53271bc3ef629737e40d7528e2aecbd6b451c1a6 100644 (file)
@@ -64,6 +64,14 @@ class CRM_Mailing_Tokens extends \Civi\Token\AbstractTokenSubscriber {
     return !empty($processor->context['mailingId']) || !empty($processor->context['mailing']);
   }
 
+  /**
+   * Prefetch tokens.
+   *
+   * @param \Civi\Token\Event\TokenValueEvent $e
+   *
+   * @return array
+   * @throws \Exception
+   */
   public function prefetch(\Civi\Token\Event\TokenValueEvent $e) {
     $processor = $e->getTokenProcessor();
     $mailing = isset($processor->context['mailing'])
index 18ad0ff7990c0b4e3ba4ea592dae802c4b76f30e..a465f9fedb2b0bd9c5e6f54713916a3cdcc5ae85 100644 (file)
@@ -438,6 +438,8 @@ class CRM_Utils_File {
   }
 
   /**
+   * Make a valid file name.
+   *
    * @param string $name
    *
    * @return string
@@ -460,8 +462,10 @@ class CRM_Utils_File {
   }
 
   /**
-   * @param $path
-   * @param $ext
+   * Get files for the extension.
+   *
+   * @param string $path
+   * @param string $ext
    *
    * @return array
    */
@@ -801,6 +805,13 @@ HTACCESS;
     return TRUE;
   }
 
+  /**
+   * Format file.
+   *
+   * @param array $param
+   * @param string $fileName
+   * @param array $extraParams
+   */
   public static function formatFile(&$param, $fileName, $extraParams = array()) {
     if (empty($param[$fileName])) {
       return;
index 89a0ad83227a6f7758a3ffea874d96f2178b2c01..ff98f858b7b0c2a2a17e6beebb75f8b8c439301b 100644 (file)
@@ -33,6 +33,9 @@
 
 require_once 'TbsZip/tbszip.php';
 
+/**
+ * Class CRM_Utils_PDF_Document.
+ */
 class CRM_Utils_PDF_Document {
 
   public static $ooxmlMap = array(
@@ -51,6 +54,8 @@ class CRM_Utils_PDF_Document {
   );
 
   /**
+   * Convert html to a Doc file.
+   *
    * @param array $pages
    * @param string $fileName
    * @param array|int $format
index 34669975db6f8f859333752f2405c4a2b9abf41e..88ab5c43863a342712b5a84af630de0af4aed9a7 100644 (file)
@@ -288,6 +288,11 @@ class CRM_Utils_System_Backdrop extends CRM_Utils_System_DrupalBase {
     $base_url = str_replace('http://', 'https://', $base_url);
   }
 
+  /**
+   * Get the name of the table that stores the user details.
+   *
+   * @return string
+   */
   protected function getUsersTableName() {
     $userFrameworkUsersTableName = Civi::settings()->get('userFrameworkUsersTableName');
     if (empty($userFrameworkUsersTableName)) {
index 652a0f5bafd379266c482cfd59f7906c8ae6bded..a66fba129e948b69ddf5b2c1a4254167cac3de7f 100644 (file)
@@ -287,6 +287,11 @@ abstract class CRM_Utils_System_Base {
     return 'left';
   }
 
+  /**
+   * Get the absolute path to the site's base url.
+   *
+   * @return bool|mixed|string
+   */
   public function getAbsoluteBaseURL() {
     if (!defined('CIVICRM_UF_BASEURL')) {
       return FALSE;
@@ -304,6 +309,11 @@ abstract class CRM_Utils_System_Base {
     return $url;
   }
 
+  /**
+   * Get the relative path to the sites base url.
+   *
+   * @return bool
+   */
   public function getRelativeBaseURL() {
     $absoluteBaseURL = $this->getAbsoluteBaseURL();
     if ($absoluteBaseURL === FALSE) {
index 8cd0f307630b7005c1ba0a8e6854613070b2fc02..54a3d0c007edc430ee35490aba8174fea40b7f61 100644 (file)
@@ -288,6 +288,11 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
     $base_url = str_replace('http://', 'https://', $base_url);
   }
 
+  /**
+   * Get the name of the table that stores the user details.
+   *
+   * @return string
+   */
   protected function getUsersTableName() {
     $userFrameworkUsersTableName = Civi::settings()->get('userFrameworkUsersTableName');
     if (empty($userFrameworkUsersTableName)) {
index a6778a2b44af501bfad425acc36999d37d812660..93a062ea78825bed86c455a85055e4c0880ad926 100644 (file)
@@ -1,10 +1,12 @@
 <?php
-
+/**
+ * Get the CiviCRM version.
+ */
 function civicrmVersion( ) {ldelim}
 {include file="../../templates/CRM/common/version.tpl" assign=svnrevision}
   return array( 'version'  => '{$db_version}',
                 'cms'      => '{$cms}',
-                'revision' => '{$svnrevision}' );
+                'revision' => '{$svnrevision}', );
 {rdelim}