Add comment blocks
authoreileen <emcnaughton@wikimedia.org>
Mon, 9 Jan 2017 23:45:32 +0000 (12:45 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 9 Jan 2017 23:46:04 +0000 (12:46 +1300)
16 files changed:
CRM/Admin/Page/ExtensionsUpgrade.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/Form/Task.php
CRM/Contribute/Form/Task/Status.php
CRM/Contribute/Tokens.php
CRM/Core/BAO/UFGroup.php
CRM/Core/CodeGen/DAO.php
CRM/Core/Payment/PayJunction.php
CRM/Dedupe/Merger.php
CRM/Mailing/Selector/Event.php
CRM/Report/Form/ActivitySummary.php
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Utils/Array.php
CRM/Utils/SQL/Select.php
CRM/Utils/System/Base.php
CRM/Utils/System/DrupalBase.php

index 1c7d0d861c41fb5d7a07e5c5340fdaee46e47d10..2b5c610503a82cfbb97e97561a96388c4bb996dc 100644 (file)
@@ -10,6 +10,9 @@ class CRM_Admin_Page_ExtensionsUpgrade extends CRM_Core_Page {
   const END_URL = 'civicrm/admin/extensions';
   const END_PARAMS = 'reset=1';
 
+  /**
+   * Run Page.
+   */
   public function run() {
     $queue = CRM_Extension_Upgrades::createQueue();
     $runner = new CRM_Queue_Runner(array(
index 6aad349a2aa7af954a2b6b6c88b65992b60d4f10..e74a29f2f0c2a6555f304905d375c51e1a0c99e6 100644 (file)
@@ -3769,6 +3769,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
    * @param string $paymentType
    *   'owed' for purpose of recording partial payments, 'refund' for purpose of recording refund payments.
    * @param int $participantId
+   * @param bool $updateStatus
    *
    * @return null|object
    */
@@ -4330,9 +4331,11 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
   /**
    * Compute the stats values
    *
-   * @param $stat either 'mode' or 'median'
-   * @param $sql
-   * @param $alias of civicrm_contribution
+   * @param string $stat either 'mode' or 'median'
+   * @param string $sql
+   * @param string $alias of civicrm_contribution
+   *
+   * @return array|null
    */
   public static function computeStats($stat, $sql, $alias = NULL) {
     $mode = $median = array();
@@ -4385,7 +4388,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
         return $median;
 
       default:
-        return;
+        return NULL;
     }
   }
 
@@ -4422,6 +4425,8 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
    *   Duplication of param needs review. Only used by AuthorizeNetIPN
    * @param int $isFirstOrLastRecurringPayment
    *   Deprecated param only used by AuthorizeNetIPN.
+   *
+   * @return array
    */
   public static function completeOrder(&$input, &$ids, $objects, $transaction, $recur, $contribution, $isRecurring, $isFirstOrLastRecurringPayment) {
     $primaryContributionID = isset($contribution->id) ? $contribution->id : $objects['first_contribution']->id;
@@ -4946,11 +4951,12 @@ LIMIT 1;";
   }
 
   /**
-   * Function to check line items
+   * Function to check line items.
    *
    * @param array $params
    *  array of order params.
    *
+   * @throws \API_Exception
    */
   public static function checkLineItems(&$params) {
     $totalAmount = CRM_Utils_Array::value('total_amount', $params);
@@ -5392,8 +5398,9 @@ LEFT JOIN  civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co
   /**
    * Create array of last financial item id's.
    *
-   * @param array $contributionId
+   * @param int $contributionId
    *
+   * @return array
    */
   public static function getLastFinancialItemIds($contributionId) {
     $sql = "SELECT fi.id, li.price_field_value_id, li.tax_amount, fi.financial_account_id
index 6127a5d243ce442fad9da0630a4d9d242f90b103..fdbcbd18d0db92e5a93a86003fb011de8da4ddba 100644 (file)
@@ -186,6 +186,8 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form {
 
   /**
    * Sets contribution Ids for unit test.
+   *
+   * @param array $contributionIds
    */
   public function setContributionIds($contributionIds) {
     $this->_contributionIds = $contributionIds;
index 18cb54305d8404abbac011fde475ff034d850256..a3535e5cbefede41db3c62bef48012acf06ad3b2 100644 (file)
@@ -218,7 +218,13 @@ AND    co.id IN ( $contribIDs )";
 
   /**
    * Process the form with submitted params.
+   *
    * Also supports unit test.
+   *
+   * @param CRM_Core_Form $form
+   * @param array $params
+   *
+   * @throws \Exception
    */
   public static function processForm($form, $params) {
     $statusID = CRM_Utils_Array::value('contribution_status_id', $params);
index 0a30239c0eb7cabf3a17e0ddbdea1231329210e5..c7fe1fdbda9a5aaf92677774a6359ad661398318 100644 (file)
@@ -88,12 +88,24 @@ class CRM_Contribute_Tokens extends \Civi\Token\AbstractTokenSubscriber {
     parent::__construct('contribution', $tokens);
   }
 
+  /**
+   * Check if the token processor is active.
+   *
+   * @param \Civi\Token\TokenProcessor $processor
+   *
+   * @return bool
+   */
   public function checkActive(\Civi\Token\TokenProcessor $processor) {
     return
       !empty($processor->context['actionMapping'])
       && $processor->context['actionMapping']->getEntity() === 'civicrm_contribution';
   }
 
+  /**
+   * Alter action schedule query.
+   *
+   * @param \Civi\ActionSchedule\Event\MailingQueryEvent $e
+   */
   public function alterActionScheduleQuery(\Civi\ActionSchedule\Event\MailingQueryEvent $e) {
     if ($e->mapping->getEntity() !== 'civicrm_contribution') {
       return;
index efb0015336b3a1091864ff5fea3c886c2bad6a5e..4910f4ad711cd6e8e33d27b3dc897d0accd9c9ea 100644 (file)
@@ -666,6 +666,11 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
     return $importableFields;
   }
 
+  /**
+   * Get the fields relating to locations.
+   *
+   * @return array
+   */
   public static function getLocationFields() {
     static $locationFields = array(
       'street_address',
index 503ba3eb240c0812df837375000ff3a10b541b08..65dd5b82e46d549e9cb89f5a93d367d195c162e6 100644 (file)
@@ -20,6 +20,12 @@ class CRM_Core_CodeGen_DAO extends CRM_Core_CodeGen_BaseTask {
    */
   private $raw;
 
+  /**
+   * CRM_Core_CodeGen_DAO constructor.
+   *
+   * @param \CRM_Core_CodeGen_Main $config
+   * @param string $name
+   */
   public function __construct($config, $name) {
     parent::__construct($config);
     $this->name = $name;
index 81b113b1f585ad92d7b495414e35791e54f0ea30..3b70daea06501af70b30de53a1a90f0f8da80f88 100644 (file)
  *
  * @package CRM
  * @author Michael Morris and Gene Chi @ Phase2 Technology <mmorris@phase2technology.com>
- * $Id$
- *
  */
 require_once 'PayJunction/pjClasses.php';
 
+/**
+ * Class CRM_Core_Payment_PayJunction.
+ */
 class CRM_Core_Payment_PayJunction extends CRM_Core_Payment {
   # (not used, implicit in the API, might need to convert?)
   const CHARSET = 'UFT-8';
index a61b66ce4a9fd103b48514c0659a54f4a87be549..183dd63b7dd1ab527a7a4cfce5803eaadac079be 100644 (file)
@@ -651,6 +651,12 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
     return $where;
   }
 
+  /**
+   * Update the statistics for the merge set.
+   *
+   * @param string $cacheKeyString
+   * @param array $result
+   */
   public static function updateMergeStats($cacheKeyString, $result = array()) {
     // gather latest stats
     $merged  = count($result['merged']);
@@ -695,6 +701,14 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
     CRM_Core_BAO_PrevNextCache::deleteItem(NULL, "{$cacheKeyString}_stats");
   }
 
+  /**
+   * Get merge outcome statistics.
+   *
+   * @param string $cacheKeyString
+   *
+   * @return array
+   *   Array of how many were merged and how many were skipped.
+   */
   public static function getMergeStats($cacheKeyString) {
     $stats = CRM_Core_BAO_PrevNextCache::retrieve("{$cacheKeyString}_stats");
     if (!empty($stats)) {
@@ -703,6 +717,13 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
     return $stats;
   }
 
+  /**
+   * Get merge statistics message.
+   *
+   * @param string $cacheKeyString
+   *
+   * @return string
+   */
   public static function getMergeStatsMsg($cacheKeyString) {
     $msg   = '';
     $stats = CRM_Dedupe_Merger::getMergeStats($cacheKeyString);
index 7983727a2b17a2ffd43fdc2c034a88cd1a768e12..c7db96ca4c0eb150d5abf1e27241375fa0c898c8 100644 (file)
@@ -439,6 +439,11 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
     return NULL;
   }
 
+  /**
+   * Get the title for the mailing event type.
+   *
+   * @return string
+   */
   public function eventToTitle() {
     static $events = NULL;
 
@@ -458,6 +463,11 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
     return $events[$this->_event_type];
   }
 
+  /**
+   * Get the title of the event.
+   *
+   * @return string
+   */
   public function getTitle() {
     return $this->eventToTitle();
   }
index a3a4bd75e4b02cf9475fbb6be4bcb5068ba86e71..e6041b1901657abca67426fc2fe70c83b5a458f3 100644 (file)
@@ -417,6 +417,11 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form {
     }
   }
 
+  /**
+   * Group the fields.
+   *
+   * @param bool $includeSelectCol
+   */
   public function groupBy($includeSelectCol = TRUE) {
     $this->_groupBy = array();
     if (!empty($this->_params['group_bys']) &&
index 2743465d058e1ce5a020f6dd63466d6c999d37c3..a1a3c58152a8edc27272882bd483cbd777a42d45 100644 (file)
@@ -895,6 +895,11 @@ FROM `civicrm_dashboard_contact` JOIN `civicrm_contact` WHERE civicrm_dashboard_
     return TRUE;
   }
 
+  /**
+   * Add mailing template type.
+   *
+   * @return bool
+   */
   public static function addMailingTemplateType() {
     if (!CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'template_type', FALSE)) {
       CRM_Core_DAO::executeQuery('
index 3a8bca6ddf97b4eb6111c894d534034caf11a3c0..54c567e9e1cad38ddb791dd31a308575ffb191f5 100644 (file)
@@ -1098,6 +1098,14 @@ class CRM_Utils_Array {
     return $array;
   }
 
+  /**
+   * Build tree of elements.
+   *
+   * @param array $elements
+   * @param int|null $parentId
+   *
+   * @return array
+   */
   public static function buildTree($elements, $parentId = NULL) {
     $branch = array();
 
@@ -1114,6 +1122,15 @@ class CRM_Utils_Array {
     return $branch;
   }
 
+  /**
+   * Find search string in tree.
+   *
+   * @param string $search
+   * @param array $tree
+   * @param string $field
+   *
+   * @return array|null
+   */
   public static function findInTree($search, $tree, $field = 'id') {
     foreach ($tree as $item) {
       if ($item[$field] == $search) {
index 24ca2587d5b433f8106a7c6cb67dbc5e0549ee2b..8d0db8a74fc15872c3018172d58793195ddbbbf9 100644 (file)
@@ -585,6 +585,13 @@ class CRM_Utils_SQL_Select implements ArrayAccess {
     return $sql;
   }
 
+  /**
+   * Has an offset been set.
+   *
+   * @param string $offset
+   *
+   * @return bool
+   */
   public function offsetExists($offset) {
     return isset($this->params[$offset]);
   }
index b3f8dcb4435bd0d70dadc74ea61f3787d5e7960f..652a0f5bafd379266c482cfd59f7906c8ae6bded 100644 (file)
@@ -423,6 +423,13 @@ abstract class CRM_Utils_System_Base {
     throw new CRM_Core_Exception("Not implemented: {$className}->getUfId");
   }
 
+  /**
+   * Set the localisation from the user framework.
+   *
+   * @param string $civicrm_language
+   *
+   * @return bool
+   */
   public function setUFLocale($civicrm_language) {
     return TRUE;
   }
index 4edfb7687ec0790d59ae1dc9f67294ce1d9a6c9a..54beb6fedfde22856f6819b934aaf6e928000b4d 100644 (file)
@@ -545,6 +545,13 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
     return user_load($userID);
   }
 
+  /**
+   * Parse the name of the drupal site.
+   *
+   * @param string $civicrm_root
+   *
+   * @return null|string
+   */
   public function parseDrupalSiteName($civicrm_root) {
     $siteName = NULL;
     if (strpos($civicrm_root,