comment fixes
authoreileenmcnaugton <eileen@fuzion.co.nz>
Fri, 23 Oct 2015 05:09:14 +0000 (18:09 +1300)
committereileenmcnaugton <eileen@fuzion.co.nz>
Fri, 23 Oct 2015 19:00:54 +0000 (08:00 +1300)
13 files changed:
CRM/Event/BAO/Event.php
CRM/Logging/Schema.php
CRM/Member/Selector/Search.php
CRM/UF/Form/Inline/Preview.php
CRM/Utils/API/AbstractFieldCoder.php
CRM/Utils/API/HTMLInputCoder.php
CRM/Utils/API/MatchOption.php
CRM/Utils/Hook/UnitTests.php
CRM/Utils/Hook/WordPress.php
CRM/Utils/SQL/Select.php
CRM/Utils/System.php
tests/phpunit/CRM/Utils/Cache/AllTests.php
tests/phpunit/CRM/Utils/FileTest.php

index cd8a27bb0b1458a1268b64df929ee0a6a82ee724..cce8709032b7ae91207d307cdb729d15db04fb61 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Event_BAO_ManageEvent
+   * @return CRM_Event_DAO_Event
    */
   public static function retrieve(&$params, &$defaults) {
     $event = new CRM_Event_DAO_Event();
@@ -80,8 +80,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    * @param array $params
    *   Reference array contains the values submitted by the form.
    *
-   *
-   * @return object
+   * @return CRM_Event_DAO_Event
    */
   public static function add(&$params) {
     CRM_Utils_System::flushCache();
@@ -228,7 +227,6 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    *   Location block id to be deleted.
    * @param int $eventId
    *   Event with which loc block is associated.
-   *
    */
   public static function deleteEventLocBlock($locBlockId, $eventId = NULL) {
     $query = "SELECT count(ce.id) FROM civicrm_event ce WHERE ce.loc_block_id = $locBlockId";
@@ -597,7 +595,6 @@ $event_summary_limit
    * @param bool $role consider counted( is filter role) participant.
    *   Consider counted( is filter role) participant.
    *
-   *
    * @return array
    *   array with count of participants for each event based on status/role
    */
@@ -1035,7 +1032,7 @@ WHERE civicrm_event.is_active = 1
    *
    * @param int $id
    *
-   * @return
+   * @return bool
    */
   public static function isMonetary($id) {
     static $isMonetary = array();
@@ -1256,17 +1253,18 @@ WHERE civicrm_event.is_active = 1
   }
 
   /**
-   * Add the custom fields OR array of participant's
-   * profile info
+   * Add the custom fields OR array of participant's profile info.
    *
    * @param int $id
    * @param string $name
    * @param int $cid
-   * @param $template
+   * @param string $template
    * @param int $participantId
-   * @param $isTest
+   * @param bool $isTest
    * @param bool $isCustomProfile
    * @param array $participantParams
+   *
+   * @return array|null
    */
   public static function buildCustomDisplay(
     $id,
@@ -1713,7 +1711,7 @@ WHERE  id = $cfID
   }
 
   /**
-   * Build the array for Additional participant's information  array of priamry and additional Ids
+   * Build the array for Additional participant's information  array of primary and additional Ids.
    *
    * @param int $participantId
    *   Id of Primary participant.
index 0725ae270b14efc2adb662a76ffade4321a0a336..0861dd468976779519b74591b76012541a17fe07 100644 (file)
@@ -29,8 +29,6 @@
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 class CRM_Logging_Schema {
   private $logs = array();
@@ -53,10 +51,11 @@ class CRM_Logging_Schema {
   );
 
   /**
-   * (Setting Callback - Validate)
+   * Setting Callback - Validate.
    *
    * @param mixed $value
    * @param array $fieldSpec
+   *
    * @return bool
    * @throws API_Exception
    */
@@ -70,7 +69,8 @@ class CRM_Logging_Schema {
   }
 
   /**
-   * (Setting Callback - On Change)
+   * Setting Callback - On Change.
+   *
    * Respond to changes in the "logging" setting. Set up or destroy
    * triggers, etal.
    *
@@ -118,7 +118,8 @@ AND    TABLE_NAME LIKE 'civicrm_%'
     $this->tables = preg_grep('/_cache$/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/_log/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/^civicrm_queue_/', $this->tables, PREG_GREP_INVERT);
-    $this->tables = preg_grep('/^civicrm_menu/', $this->tables, PREG_GREP_INVERT); //CRM-14672
+    //CRM-14672
+    $this->tables = preg_grep('/^civicrm_menu/', $this->tables, PREG_GREP_INVERT);
     $this->tables = preg_grep('/_temp_/', $this->tables, PREG_GREP_INVERT);
 
     // do not log civicrm_mailing_event* tables, CRM-12300
@@ -234,9 +235,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   }
 
   /**
-   * Enable sitewide logging.
-   *
-   * @return void
+   * Enable site-wide logging.
    */
   public function enableLogging() {
     $this->fixSchemaDifferences(TRUE);
@@ -247,8 +246,6 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
    * Sync log tables and rebuild triggers.
    *
    * @param bool $enableLogging : Ensure logging is enabled
-   *
-   * @return void
    */
   public function fixSchemaDifferences($enableLogging = FALSE) {
     $config = CRM_Core_Config::singleton();
@@ -272,7 +269,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
    * @param bool $rebuildTrigger
    *   should we rebuild the triggers.
    *
-   * @return void
+   * @return bool
    */
   public function fixSchemaDifferencesFor($table, $cols = array(), $rebuildTrigger = FALSE) {
     if (empty($table)) {
@@ -316,7 +313,9 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   }
 
   /**
-   * @param $table
+   * Get query table.
+   *
+   * @param string $table
    *
    * @return array
    */
@@ -328,8 +327,10 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   }
 
   /**
-   * @param $col
-   * @param $createQuery
+   * Get column query.
+   *
+   * @param string $col
+   * @param bool $createQuery
    *
    * @return array|mixed|string
    */
@@ -342,6 +343,8 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   }
 
   /**
+   * Fix schema differences.
+   *
    * @param bool $rebuildTrigger
    */
   public function fixSchemaDifferencesForAll($rebuildTrigger = FALSE) {
@@ -366,11 +369,13 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   }
 
   /**
+   * Fix timestamp.
+   *
    * Log_civicrm_contact.modified_date for example would always be copied from civicrm_contact.modified_date,
    * so there's no need for a default timestamp and therefore we remove such default timestamps
    * also eliminate the NOT NULL constraint, since we always copy and schema can change down the road)
    *
-   * @param $query
+   * @param string $query
    *
    * @return mixed
    */
@@ -382,6 +387,9 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     return $query;
   }
 
+  /**
+   * Add reports.
+   */
   private function addReports() {
     $titles = array(
       'logging/contact/detail' => ts('Logging Details'),
@@ -414,7 +422,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
   /**
    * Get an array of column names of the given table.
    *
-   * @param string$table
+   * @param string $table
    * @param bool $force
    *
    * @return array
@@ -484,8 +492,10 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
   }
 
   /**
-   * @param $civiTable
-   * @param $logTable
+   * Get columns that have changed.
+   *
+   * @param string $civiTable
+   * @param string $logTable
    *
    * @return array
    */
@@ -588,6 +598,9 @@ COLS;
     $this->logs[$table] = "log_$table";
   }
 
+  /**
+   * Delete reports.
+   */
   private function deleteReports() {
     // disable logging templates
     CRM_Core_DAO::executeQuery("
@@ -635,7 +648,9 @@ COLS;
   }
 
   /**
-   * @param $info
+   * Get trigger info.
+   *
+   * @param array $info
    * @param null $tableName
    * @param bool $force
    */
@@ -724,10 +739,11 @@ COLS;
   }
 
   /**
+   * Disable logging temporarily.
+   *
    * This allow logging to be temporarily disabled for certain cases
    * where we want to do a mass cleanup but dont want to bother with
    * an audit trail
-   *
    */
   public static function disableLoggingForThisConnection() {
     // do this only if logging is enabled
index 9bb9f496bbc11a1941a2eb2af969f156ad8a5596..6bfb3a6a581394d5baa6efa6188710acb718c911 100644 (file)
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $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_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_Core_Selector_API {
 
@@ -176,13 +173,14 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
 
   /**
    * 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
    *
    * @param string $status
-   * @param null $isPaymentProcessor
+   * @param bool $isPaymentProcessor
    * @param null $accessContribution
    * @param null $qfKey
    * @param null $context
@@ -270,7 +268,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   /**
    * Getter for array of the parameters required for creating pager.
    *
-   * @param $action
+   * @param int $action
    * @param array $params
    */
   public function getPagerParams($action, &$params) {
@@ -290,7 +288,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   /**
    * Returns total number of rows for the query.
    *
-   * @param int $action.
+   * @param int $action
    *
    * @return int
    *   Total number of rows
@@ -472,7 +470,8 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   }
 
   /**
-   * Returns the column headers as an array of tuples:
+   * Returns the column headers as an array of tuples.
+   *
    * (name, sortName (key to the sort array))
    *
    * @param string $action
@@ -538,6 +537,8 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   }
 
   /**
+   * Alphabet query.
+   *
    * @return mixed
    */
   public function alphabetQuery() {
@@ -545,6 +546,8 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C
   }
 
   /**
+   * Get query.
+   *
    * @return string
    */
   public function &getQuery() {
index a8982fc09e0596ea5dd11135f218788aa19bd561..07e3b644571071eabb95bbfb07cb17bc32a1b439 100644 (file)
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
  * This class generates form components
  * for previewing Civicrm Profile Group
- *
  */
 class CRM_UF_Form_Inline_Preview extends CRM_UF_Form_AbstractPreview {
 
@@ -44,10 +41,6 @@ class CRM_UF_Form_Inline_Preview extends CRM_UF_Form_AbstractPreview {
    * Pre processing work done here.
    *
    * gets session variables for group or field id
-   *
-   * @param
-   *
-   * @return void
    */
   public function preProcess() {
     if ($_SERVER['REQUEST_METHOD'] != 'POST') {
index 2101844d1dcc214f0d5275facb0ed947bc4379d8..7108fbab85dc217861b083136a12fad4be8c3264 100644 (file)
 require_once 'api/Wrapper.php';
 
 /**
- * Class CRM_Utils_API_AbstractFieldCoder
+ * Class CRM_Utils_API_AbstractFieldCoder.
  */
 abstract class CRM_Utils_API_AbstractFieldCoder implements API_Wrapper {
 
   /**
-   * @return array<string> list of field names
+   * Get skipped fields.
+   *
+   * @return array<string>
+   *   List of field names
    */
   public function getSkipFields() {
     return NULL;
   }
 
   /**
+   * Is field skipped.
+   *
    * @param string $fldName
    * @return bool
    *   TRUE if encoding should be skipped for this field
@@ -77,15 +82,16 @@ abstract class CRM_Utils_API_AbstractFieldCoder implements API_Wrapper {
   }
 
   /**
-   * going to filter the
-   * submitted values.
+   * Going to filter the submitted values.
    *
    * @param array|string $values the field value from the API
    */
   public abstract function encodeInput(&$values);
 
   /**
-   * @param $values
+   * Decode output.
+   *
+   * @param string $values
    *
    * @return mixed
    */
index 309ddf6829cb2debee9a8fbd579a5c52d8c1a912..c7534415a2461281aa6a94cf266a0775c439c5d3 100644 (file)
@@ -56,7 +56,10 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
   }
 
   /**
-   * @return array<string> list of field names
+   * Get skipped fields.
+   *
+   * @return array<string>
+   *   list of field names
    */
   public function getSkipFields() {
     if ($this->skipFields === NULL) {
index d1549668d1bf9bab7578d2623232cefa551e1782..43f5a57ee647ae99268a585928d812d5fb5058a1 100644 (file)
@@ -65,6 +65,8 @@ class CRM_Utils_API_MatchOption implements API_Wrapper {
   private static $_singleton = NULL;
 
   /**
+   * Singleton function.
+   *
    * @return CRM_Utils_API_MatchOption
    */
   public static function singleton() {
index 60a03581ebf6946ad7aa57a689fabf9442b24ec2..5105476d04d352b095d1f51dbdbbc897a40227fa 100644 (file)
@@ -49,8 +49,10 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook {
   }
 
   /**
-   * Use a unit-testing mock object to handle hook invocations
+   * Use a unit-testing mock object to handle hook invocations.
+   *
    * e.g. hook_civicrm_foo === $mockObject->foo()
+   *
    * @param object $mockObject
    */
   public function setMock($mockObject) {
index 765830560ff009e30fbabedf8f1017aa469e1dec..f92dcc8b7c26d902964e21479b95fe8376bd8729 100644 (file)
@@ -163,6 +163,7 @@ class CRM_Utils_Hook_WordPress extends CRM_Utils_Hook {
 
   /**
    * Build the list of plugins ("modules" in CiviCRM terminology) to be processed for hooks.
+   *
    * We need to do this to preserve the CiviCRM hook signatures for hooks that require
    * a return value, since the WordPress Plugin API seems to be incompatible with them.
    *
index 70c9f32fc8d3d85f6c884485b5626b2afa774686..f7e1777e646cc606a80ae7026d07cff79d32f290 100644 (file)
@@ -145,6 +145,8 @@ class CRM_Utils_SQL_Select implements ArrayAccess {
   }
 
   /**
+   * Merge something or other.
+   *
    * @param CRM_Utils_SQL_Select $other
    * @param array|NULL $parts
    *   ex: 'joins', 'wheres'
index f9071770d135ad06a00fe4c21c493db6345713b2..2ca8294c6291de4ac97268e75e7a6a10b6810755 100644 (file)
@@ -1111,7 +1111,7 @@ class CRM_Utils_System {
   }
 
   /**
-   * Gives the first two parts of the version string E.g. 6.1
+   * Gives the first two parts of the version string E.g. 6.1.
    *
    * @return string
    */
@@ -1125,6 +1125,7 @@ class CRM_Utils_System {
    *
    * @param string $version
    *   Version string to be checked.
+   *
    * @return bool
    */
   public static function isVersionFormatValid($version) {
@@ -1157,6 +1158,11 @@ class CRM_Utils_System {
     return $headers;
   }
 
+  /**
+   * Get request headers.
+   *
+   * @return array|false
+   */
   public static function getRequestHeaders() {
     if (function_exists('apache_request_headers')) {
       return apache_request_headers();
@@ -1179,6 +1185,13 @@ class CRM_Utils_System {
         strtolower($_SERVER['HTTPS']) != 'off') ? TRUE : FALSE;
   }
 
+  /**
+   * Redirect to SSL.
+   *
+   * @param bool|FALSE $abort
+   *
+   * @throws \Exception
+   */
   public static function redirectToSSL($abort = FALSE) {
     $config = CRM_Core_Config::singleton();
     $req_headers = self::getRequestHeaders();
@@ -1488,7 +1501,7 @@ class CRM_Utils_System {
    * @param bool $loadUser
    *   Boolean load user or not.
    * @param bool $throwError
-   * @param $realPath
+   * @param string $realPath
    */
   public static function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) {
     if (!is_array($params)) {
@@ -1569,6 +1582,7 @@ class CRM_Utils_System {
    * Given a URL, return a relative URL if possible.
    *
    * @param string $url
+   *
    * @return string
    */
   public static function relativeURL($url) {
@@ -1617,7 +1631,7 @@ class CRM_Utils_System {
   }
 
   /**
-   * Clean url, replaces first '&' with '?'
+   * Clean url, replaces first '&' with '?'.
    *
    * @param string $url
    *
@@ -1657,8 +1671,9 @@ class CRM_Utils_System {
   }
 
   /**
-   * Append the contents of an 'extra' smarty template file if it is present in
-   * the custom template directory. This does not work if there are
+   * Append the contents of an 'extra' smarty template file.
+   *
+   * It must be present in the custom template directory. This does not work if there are
    * multiple custom template directories
    *
    * @param string $fileName
@@ -1688,8 +1703,9 @@ class CRM_Utils_System {
   }
 
   /**
-   * Get a list of all files that are found within the directories
-   * that are the result of appending the provided relative path to
+   * Get a list of all files that are found within the directories.
+   *
+   * Files must be the result of appending the provided relative path to
    * each component of the PHP include path.
    *
    * @author Ken Zalewski
@@ -1721,7 +1737,9 @@ class CRM_Utils_System {
   }
 
   /**
-   * Get a list of all "plugins" (PHP classes that implement a piece of
+   * Get a list of all "plugins".
+   *
+   * (PHP classes that implement a piece of
    * functionality using a well-defined interface) that are found in a
    * particular CiviCRM directory (both custom and core are searched).
    *
@@ -1755,6 +1773,9 @@ class CRM_Utils_System {
     return $plugins;
   }
 
+  /**
+   * Execute scheduled jobs.
+   */
   public static function executeScheduledJobs() {
     $facility = new CRM_Core_JobManager();
     $facility->execute(FALSE);
@@ -1772,6 +1793,7 @@ class CRM_Utils_System {
    * Evaluate any tokens in a URL.
    *
    * @param string|FALSE $url
+   *
    * @return string|FALSE
    */
   public static function evalUrl($url) {
@@ -1825,6 +1847,8 @@ class CRM_Utils_System {
   }
 
   /**
+   * Is in upgrade mode.
+   *
    * @return bool
    */
   public static function isInUpgradeMode() {
@@ -1849,6 +1873,7 @@ class CRM_Utils_System {
    *   - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
    *   - entity_table: string, eg "civicrm_contact"
    *   - entity_id: int
+   *
    * @return array|NULL
    *   NULL if unavailable, or an array. array has keys:
    *   - path: string
@@ -1891,6 +1916,8 @@ class CRM_Utils_System {
   }
 
   /**
+   * Set http header.
+   *
    * @param string $name
    * @param string $value
    */
index 7c092bbef85ef4cd49896820178a0b05810e7623..bb523abcf50682be8acf350b86051ef45a554226 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- *  File for the CRM_Utils_Cache_AllTests class
+ * @file
+ *
+ * File for the CRM_Utils_Cache_AllTests class
  *
  *  (PHP 5)
  *
index 5b8912a28ad5a413df66775e15aa810004fd12b4..c50345ae107d2150a7500b659c4777bcd273db7f 100644 (file)
@@ -5,6 +5,10 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class CRM_Utils_FileTest
  */
 class CRM_Utils_FileTest extends CiviUnitTestCase {
+
+  /**
+   * Test is child path.
+   */
   public function testIsChildPath() {
     $testCases = array();
     $testCases[] = array('/ab/cd/ef', '/ab/cd', FALSE);