From 50bfb46054c0ccd0f836a569c5417969da3c1a53 Mon Sep 17 00:00:00 2001
From: Saurabh Batra .
- * An offset to check for.
- *
', $value[$element]), '"\\') . '"';
- //remove extra spaces and tab character that breaks dataTable CRM-12551
+ // remove extra spaces and tab character that breaks dataTable CRM-12551
$sOutput = preg_replace("/\s+/", " ", $sOutput);
$addcomma = TRUE;
}
diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php
index 7986f84eac..b7ea6dff01 100644
--- a/CRM/Utils/Mail.php
+++ b/CRM/Utils/Mail.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Utils_Mail {
@@ -218,7 +216,7 @@ class CRM_Utils_Mail {
$headers['Auto-Submitted'] = "Auto-Generated";
}
- //make sure we has to have space, CRM-6977
+ // make sure we has to have space, CRM-6977
foreach (array('From', 'To', 'Cc', 'Bcc', 'Reply-To', 'Return-Path') as $fld) {
if (isset($headers[$fld])) {
$headers[$fld] = str_replace('"<', '" <', $headers[$fld]);
@@ -265,8 +263,8 @@ class CRM_Utils_Mail {
// Mail_smtp and Mail_sendmail mailers require Bcc anc Cc emails
// be included in both $to and $headers['Cc', 'Bcc']
if (get_class($mailer) != "Mail_mail") {
- //get emails from headers, since these are
- //combination of name and email addresses.
+ // get emails from headers, since these are
+ // combination of name and email addresses.
if (!empty($headers['Cc'])) {
$to[] = CRM_Utils_Array::value('Cc', $headers);
}
@@ -471,6 +469,10 @@ class CRM_Utils_Mail {
* and if so does the needful and return the formatted name
*
* This code has been copied and adapted from ezc/Mail/src/tools.php
+ *
+ * @param string $name
+ *
+ * @return string
*/
public static function formatRFC2822Name($name) {
$name = trim($name);
@@ -499,10 +501,10 @@ class CRM_Utils_Mail {
public static function appendPDF($fileName, $html, $format = NULL) {
$pdf_filename = CRM_Core_Config::singleton()->templateCompileDir . CRM_Utils_File::makeFileName($fileName);
- //FIXME : CRM-7894
- //xmlns attribute is required in XHTML but it is invalid in HTML,
- //Also the namespace "xmlns=http://www.w3.org/1999/xhtml" is default,
- //and will be added to the tag even if you do not include it.
+ // FIXME : CRM-7894
+ // xmlns attribute is required in XHTML but it is invalid in HTML,
+ // Also the namespace "xmlns=http://www.w3.org/1999/xhtml" is default,
+ // and will be added to the tag even if you do not include it.
$html = preg_replace('/()/', '\1\3\4', $html);
file_put_contents($pdf_filename, CRM_Utils_PDF_Utils::html2pdf($html,
diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php
index ce1ff6878c..5b3ddb8219 100644
--- a/CRM/Utils/Mail/Incoming.php
+++ b/CRM/Utils/Mail/Incoming.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Utils_Mail_Incoming {
const
diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php
index f0e584cb9c..38d9edb0b3 100644
--- a/CRM/Utils/Migrate/Export.php
+++ b/CRM/Utils/Migrate/Export.php
@@ -50,8 +50,6 @@ class CRM_Utils_Migrate_Export {
*/
protected $_xml;
- /**
- */
public function __construct() {
$this->_xml = array(
'customGroup' => array(
diff --git a/CRM/Utils/Migrate/ExportJSON.php b/CRM/Utils/Migrate/ExportJSON.php
index 3b575a7a94..e205cd1a57 100644
--- a/CRM/Utils/Migrate/ExportJSON.php
+++ b/CRM/Utils/Migrate/ExportJSON.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Utils_Migrate_ExportJSON {
const CHUNK_SIZE = 128;
@@ -299,8 +297,10 @@ SELECT *
}
/**
- * TODO - support group inheritance
+ * @todo support group inheritance
+ *
* Parent child group ids are encoded in a text string
+ *
* @param $contactIDs
*/
public function group(&$contactIDs) {
@@ -330,7 +330,7 @@ WHERE contact_id IN ( $ids )
}
/**
- * TODO - support search builder and custom saved searches
+ * @todo support search builder and custom saved searches
* @param $groupIDs
*/
public function savedSearch(&$groupIDs) {
diff --git a/CRM/Utils/Migrate/Import.php b/CRM/Utils/Migrate/Import.php
index 9f09ccd938..b4fe967d97 100644
--- a/CRM/Utils/Migrate/Import.php
+++ b/CRM/Utils/Migrate/Import.php
@@ -83,7 +83,7 @@ class CRM_Utils_Migrate_Import {
$this->profileFields($xml, $idMap);
$this->profileJoins($xml, $idMap);
- //create DB Template String sample data
+ // create DB Template String sample data
$this->dbTemplateString($xml, $idMap);
// clean up all caches etc
diff --git a/CRM/Utils/Migrate/ImportJSON.php b/CRM/Utils/Migrate/ImportJSON.php
index a32db531cb..33ac324a22 100644
--- a/CRM/Utils/Migrate/ImportJSON.php
+++ b/CRM/Utils/Migrate/ImportJSON.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Utils_Migrate_ImportJSON {
@@ -38,8 +36,6 @@ class CRM_Utils_Migrate_ImportJSON {
protected $_saveMapping;
- /**
- */
public function __construct() {
$this->_lookupCache = array();
$this->_saveMapping = array();
@@ -53,7 +49,7 @@ class CRM_Utils_Migrate_ImportJSON {
$decodedContacts = json_decode($json);
- //migrate contact data
+ // migrate contact data
$this->contact($decodedContacts->civicrm_contact);
$this->email($decodedContacts->civicrm_email);
$this->phone($decodedContacts->civicrm_phone);
diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php
index 2a7bc976df..6064602454 100644
--- a/CRM/Utils/Money.php
+++ b/CRM/Utils/Money.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
diff --git a/CRM/Utils/Network.php b/CRM/Utils/Network.php
index ffd686c69e..a2c7b0f7ea 100644
--- a/CRM/Utils/Network.php
+++ b/CRM/Utils/Network.php
@@ -26,11 +26,8 @@
*/
/**
- *
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id: $
- *
*/
/**
diff --git a/CRM/Utils/Number.php b/CRM/Utils/Number.php
index f3e427acd2..d1858b3857 100644
--- a/CRM/Utils/Number.php
+++ b/CRM/Utils/Number.php
@@ -1,4 +1,34 @@
123456
- $val = substr($val, 0, $sigFigs); // ex: 123456 => 1234
+ $val = substr($val, 0, $sigFigs); // ex: 123456 => 1234
// Move any extra digits after decimal
$extraFigs = strlen($val) - ($sigFigs - $decFigs);
@@ -69,7 +100,7 @@ class CRM_Utils_Number {
if ($maxImportFileSize > $postMaxSize && $postMaxSize == $size) {
CRM_Core_Session::setStatus(ts("Note: Upload max filesize ('upload_max_filesize') should not exceed Post max size ('post_max_size') as defined in PHP.ini, please check with your system administrator."), ts("Warning"), "alert");
}
- //respect php.ini upload_max_filesize
+ // respect php.ini upload_max_filesize
if ($size > $maxImportFileSize && $size !== $postMaxSize) {
$size = $maxImportFileSize;
CRM_Core_Session::setStatus(ts("Note: Please verify your configuration for Maximum File Size (in MB) Administrator >> System Settings >> Misc. It should support 'upload_max_size' as defined in PHP.ini.Please check with your system administrator.", array(1 => CRM_Utils_System::url('civicrm/admin/setting/misc', 'reset=1'))), ts("Warning"), "alert");
diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php
index 6e24238321..1349902b4b 100644
--- a/CRM/Utils/OpenFlashChart.php
+++ b/CRM/Utils/OpenFlashChart.php
@@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
require_once 'packages/OpenFlashChart/php-ofc-library/open-flash-chart.php';
@@ -89,7 +87,7 @@ class CRM_Utils_OpenFlashChart {
$xValues = array_keys($values[0]);
$yValues = array_values($values[0]);
- //set y axis parameters.
+ // set y axis parameters.
$yMin = 0;
// calculate max scale for graph.
@@ -148,7 +146,7 @@ class CRM_Utils_OpenFlashChart {
$xAxis = new x_axis();
$xAxis->set_labels($xLabels);
- //create y axis and set range.
+ // create y axis and set range.
$yAxis = new y_axis();
$yAxis->set_range($yMin, $yMax, $ySteps);
@@ -215,7 +213,7 @@ class CRM_Utils_OpenFlashChart {
}
$graphTitle = !empty($params['legend']) ? $params['legend'] : ts('Pie Chart');
- //get the currency.
+ // get the currency.
$config = CRM_Core_Config::singleton();
$symbol = $config->defaultCurrencySymbol;
@@ -240,7 +238,7 @@ class CRM_Utils_OpenFlashChart {
$pie->set_values($values);
- //create chart.
+ // create chart.
$chart = new open_flash_chart();
// create chart title obj.
@@ -328,7 +326,7 @@ class CRM_Utils_OpenFlashChart {
$chartTitle = !empty($params['legend']) ? $params['legend'] : ts('Bar Chart');
- //set y axis parameters.
+ // set y axis parameters.
$yMin = 0;
// calculate max scale for graph.
@@ -359,7 +357,7 @@ class CRM_Utils_OpenFlashChart {
$xAxis = new x_axis();
$xAxis->set_labels($xLabels);
- //create y axis and set range.
+ // create y axis and set range.
$yAxis = new y_axis();
$yAxis->set_range($yMin, $yMax, $ySteps);
@@ -466,7 +464,7 @@ class CRM_Utils_OpenFlashChart {
$chartData['tip'] = $rows['tip'];
}
- //legend
+ // legend
$chartData['xname'] = CRM_Utils_Array::value('xname', $rows);
$chartData['yname'] = CRM_Utils_Array::value('yname', $rows);
@@ -544,7 +542,7 @@ class CRM_Utils_OpenFlashChart {
if ($chart == 'barChart') {
$ySize = CRM_Utils_Array::value('ySize', $params, 250);
$xSize = 60 * count($params['values']);
- //hack to show tooltip.
+ // hack to show tooltip.
if ($xSize < 200) {
$xSize = (count($params['values']) > 1) ? 100 * count($params['values']) : 170;
}
diff --git a/CRM/Utils/OptionBag.php b/CRM/Utils/OptionBag.php
index 4149cd272a..5c296520da 100644
--- a/CRM/Utils/OptionBag.php
+++ b/CRM/Utils/OptionBag.php
@@ -1,4 +1,35 @@
+ * (PHP 5 >= 5.0.0)
* Whether a offset exists
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
+ *
* @param mixed $offset
- *
* The return value will be casted to boolean if non-boolean was returned.
*/
public function offsetExists($offset) {
@@ -73,13 +102,13 @@ class CRM_Utils_OptionBag implements ArrayAccess, IteratorAggregate, Countable {
}
/**
- * (PHP 5 >= 5.0.0)
+ * (PHP 5 >= 5.0.0)
* Offset to retrieve
* @link http://php.net/manual/en/arrayaccess.offsetget.php
+ *
* @param mixed $offset
- *
. - * The offset to retrieve. - *
+ * The offset to retrieve. + * * @return mixed * Can return all value types. */ @@ -88,55 +117,52 @@ class CRM_Utils_OptionBag implements ArrayAccess, IteratorAggregate, Countable { } /** - * (PHP 5 >= 5.0.0). - * The offset to assign the value to. - *
+ * The offset to assign the value to. + * * @param mixed $value - *. - * The value to set. - *
+ * The value to set. */ public function offsetSet($offset, $value) { $this->data[$offset] = $value; } /** - * (PHP 5 >= 5.0.0). - * The offset to unset. - *
+ * The offset to unset. */ public function offsetUnset($offset) { unset($this->data[$offset]); } /** - * (PHP 5 >= 5.0.0)* The return value is cast to an integer. */ public function count() { diff --git a/CRM/Utils/PDF/Label.php b/CRM/Utils/PDF/Label.php index 5deab7b703..4dd4ffff00 100644 --- a/CRM/Utils/PDF/Label.php +++ b/CRM/Utils/PDF/Label.php @@ -26,12 +26,11 @@ */ /** - * Class to print labels in Avery or custom formats + * Class to print labels in Avery or custom formats * functionality and smarts to the base PDF_Label. * + * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * - * */ require_once 'tcpdf/tcpdf.php'; diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index 7507a664f6..9f103d72a8 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -33,8 +33,6 @@ define('DOMPDF_ENABLE_AUTOLOAD', FALSE); * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Utils_PDF_Utils { diff --git a/CRM/Utils/Pager.php b/CRM/Utils/Pager.php index 9f8d87e867..222222f675 100644 --- a/CRM/Utils/Pager.php +++ b/CRM/Utils/Pager.php @@ -26,13 +26,11 @@ */ /** - * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 */ /** - * * This class extends the PEAR pager object by substituting standard default pager arguments * We also extract the pageId from either the GET variables or the POST variable (since we * use a POST to jump to a specific page). At some point we should evaluate if we want @@ -55,6 +53,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * The output of the pager. This is a name/value array with various keys * that an application could use to display the pager + * * @var array */ public $_response; @@ -110,8 +109,7 @@ class CRM_Utils_Pager extends Pager_Sliding { /** * A page cannot have two variables with the same form name. Hence in the * pager display, we have a form submission at the top with the normal - * page variable, but a different form element for one at the bottom - * + * page variable, but a different form element for one at the bottom. */ $this->_response['titleTop'] = ts('Page %1 of %2', array( 1 => '', @@ -133,15 +131,15 @@ class CRM_Utils_Pager extends Pager_Sliding { * @return array */ public function initialize(&$params) { - /* set the mode for the pager to Sliding */ + // set the mode for the pager to Sliding $params['mode'] = 'Sliding'; - /* also set the urlVar to be a crm specific get variable */ + // also set the urlVar to be a crm specific get variable. $params['urlVar'] = self::PAGE_ID; - /* set this to a small value, since we dont use this functionality */ + // set this to a small value, since we dont use this functionality $params['delta'] = 1; diff --git a/CRM/Utils/PagerAToZ.php b/CRM/Utils/PagerAToZ.php index 22ba273bd7..ca73afc944 100644 --- a/CRM/Utils/PagerAToZ.php +++ b/CRM/Utils/PagerAToZ.php @@ -26,16 +26,12 @@ */ /** - * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** * This class is for displaying alphabetical bar - * */ class CRM_Utils_PagerAToZ { @@ -61,7 +57,7 @@ class CRM_Utils_PagerAToZ { * Return the all the static characters. * * @return array - * is a array of static characters + * is an array of static characters */ public static function getStaticCharacters() { $staticAlphabets = array( @@ -102,7 +98,7 @@ class CRM_Utils_PagerAToZ { * @param $isDAO * * @return array - * is a array of dynamic characters + * is an array of dynamic characters */ public static function getDynamicCharacters(&$query, $isDAO) { if ($isDAO) { @@ -147,7 +143,7 @@ class CRM_Utils_PagerAToZ { sort($AToZBar, SORT_STRING); $AToZBar = array_unique($AToZBar); - //get the current path + // get the current path $path = CRM_Utils_System::currentPath(); $qfKey = NULL; diff --git a/CRM/Utils/PseudoConstant.php b/CRM/Utils/PseudoConstant.php index be85fe6bde..9624239608 100644 --- a/CRM/Utils/PseudoConstant.php +++ b/CRM/Utils/PseudoConstant.php @@ -25,6 +25,11 @@ +--------------------------------------------------------------------+ */ +/** + * @package CRM + * @copyright CiviCRM LLC (c) 2004-2015 + */ + /** * Utilities for manipulating/inspecting CRM_*_PseudoConstant classes. */ @@ -40,7 +45,8 @@ class CRM_Utils_PseudoConstant { ); /** - * @var array ($name => $className) + * @var array + * ($name => $className) */ private static $constants = NULL; diff --git a/CRM/Utils/QueryFormatter.php b/CRM/Utils/QueryFormatter.php index d5ea4f7a04..e4d8af9e9f 100644 --- a/CRM/Utils/QueryFormatter.php +++ b/CRM/Utils/QueryFormatter.php @@ -25,6 +25,11 @@ +--------------------------------------------------------------------+ */ + /** + * @package CRM + * @copyright CiviCRM LLC (c) 2004-2015 + */ + /** * Class CRM_Utils_QueryFormatter * @@ -83,7 +88,8 @@ class CRM_Utils_QueryFormatter { } /** - * @var string eg MODE_NONE + * @var string + * eg MODE_NONE */ protected $mode; diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index b57714af65..bb82f5c440 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -30,7 +30,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * */ class CRM_Utils_REST { @@ -68,7 +67,7 @@ class CRM_Utils_REST { public static function ping($var = NULL) { $session = CRM_Core_Session::singleton(); $key = $session->get('key'); - //$session->set( 'key', $var ); + // $session->set( 'key', $var ); return self::simple(array('message' => "PONG: $key")); } @@ -317,7 +316,7 @@ class CRM_Utils_REST { } // Everyone should be required to provide the server key, so the whole - // interface can be disabled in more change to the configuration file. + // interface can be disabled in more change to the configuration file. // first check for civicrm site key if (!CRM_Utils_System::authenticateKey(FALSE)) { $docLink = CRM_Utils_System::docURL2("Managing Scheduled Jobs", TRUE, NULL, NULL, NULL, "wiki"); @@ -329,8 +328,7 @@ class CRM_Utils_REST { } // At this point we know we are not calling ping which does not require authentication. - // Therefore we now need a valid server key and API key - + // Therefore we now need a valid server key and API key. // Check and see if a valid secret API key is provided. $api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST'); if (!$api_key || strtolower($api_key) == 'null') { @@ -525,8 +523,9 @@ class CRM_Utils_REST { /** * This is a wrapper so you can call an api via json (it returns json too) - * http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals - * works for POST & GET (POST recommended) + * http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} + * to take all the emails from individuals. + * Works for POST & GET (POST recommended). */ public static function ajaxJson() { $requestParams = CRM_Utils_Request::exportValues(); diff --git a/CRM/Utils/ReCAPTCHA.php b/CRM/Utils/ReCAPTCHA.php index d2cbb51019..8d53f596ad 100644 --- a/CRM/Utils/ReCAPTCHA.php +++ b/CRM/Utils/ReCAPTCHA.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Utils_ReCAPTCHA { @@ -63,9 +61,8 @@ class CRM_Utils_ReCAPTCHA { return self::$_singleton; } - /** - */ public function __construct() { + // Empty function? } /** diff --git a/CRM/Utils/Recent.php b/CRM/Utils/Recent.php index d73825dbc5..969e254d18 100644 --- a/CRM/Utils/Recent.php +++ b/CRM/Utils/Recent.php @@ -26,7 +26,6 @@ */ /** - * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 */ @@ -39,7 +38,7 @@ class CRM_Utils_Recent { /** * Max number of items in queue. * - * @int + * @var int */ const MAX_ITEMS = 10, STORE_NAME = 'CRM_Utils_Recent'; diff --git a/CRM/Utils/Request.php b/CRM/Utils/Request.php index ad47d01ad6..fd0c8fe0e9 100644 --- a/CRM/Utils/Request.php +++ b/CRM/Utils/Request.php @@ -29,13 +29,10 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** - * class for managing a http request - * + * Class for managing a http request */ class CRM_Utils_Request { diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 5a0cf47a7c..12bcb6280f 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ require_once 'HTML/QuickForm/Rule/Email.php'; @@ -81,7 +79,7 @@ class CRM_Utils_Rule { return FALSE; } - // make sure it include valid characters, alpha numeric and underscores + // make sure it includes valid characters, alpha numeric and underscores if (!preg_match('/^[\w]+$/i', $str)) { return FALSE; } @@ -101,7 +99,7 @@ class CRM_Utils_Rule { return FALSE; } - // make sure it include valid characters, alpha numeric and underscores + // make sure it includes valid characters, alpha numeric and underscores // added (. and ,) option (CRM-1336) if (!preg_match('/^[\w\s\.\,]+$/i', $str)) { return FALSE; @@ -121,7 +119,7 @@ class CRM_Utils_Rule { return FALSE; } - // make sure it include valid characters, (, \s and numeric + // make sure it includes valid characters, (, \s and numeric if (preg_match('/^[\d\(\)\-\.\s]+$/', $phone)) { return TRUE; } @@ -139,7 +137,7 @@ class CRM_Utils_Rule { return FALSE; } - // make sure it include valid characters, alpha numeric and underscores + // make sure it includes valid characters, alpha numeric and underscores if (!preg_match('/^[\w\s\%\'\&\,\$\#]+$/i', $query)) { return FALSE; } @@ -481,11 +479,11 @@ class CRM_Utils_Rule { public static function money($value) { $config = CRM_Core_Config::singleton(); - //only edge case when we have a decimal point in the input money - //field and not defined in the decimal Point in config settings + // only edge case when we have a decimal point in the input money + // field and not defined in the decimal Point in config settings if ($config->monetaryDecimalPoint && $config->monetaryDecimalPoint != '.' && - /* CRM-7122 also check for Thousands Separator in config settings */ + // CRM-7122 also check for Thousands Separator in config settings $config->monetaryThousandSeparator != '.' && substr_count($value, '.') ) { diff --git a/CRM/Utils/Signer.php b/CRM/Utils/Signer.php index ef8f9cf926..18b2337fef 100644 --- a/CRM/Utils/Signer.php +++ b/CRM/Utils/Signer.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -99,7 +97,8 @@ class CRM_Utils_Signer { $params[$paramName] = (string) $params[$paramName]; } } - else {// $paramName is not included or ===NULL + else { + // $paramName is not included or ===NULL $params[$paramName] = ''; } $message['payload'][$paramName] = $params[$paramName]; diff --git a/CRM/Utils/SoapServer.php b/CRM/Utils/SoapServer.php index cdf85618a0..15b528b246 100644 --- a/CRM/Utils/SoapServer.php +++ b/CRM/Utils/SoapServer.php @@ -95,7 +95,7 @@ class CRM_Utils_SoapServer { throw new SoapFault('Client', 'Expired key'); } - /* otherwise, we're ok. update the timestamp */ + // otherwise, we're ok. update the timestamp $session->set('soap_time', $t); } diff --git a/CRM/Utils/Sort.php b/CRM/Utils/Sort.php index 098ef0e4e6..8ebc4289ee 100644 --- a/CRM/Utils/Sort.php +++ b/CRM/Utils/Sort.php @@ -25,12 +25,6 @@ +--------------------------------------------------------------------+ */ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2015 - */ - /** * * Base class to provide generic sort functionality. @@ -42,8 +36,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Utils_Sort { @@ -257,7 +249,6 @@ class CRM_Utils_Sort { * * @return int * returns of the current sort id - * @acccess public */ public function getCurrentSortID() { return $this->_currentSortID; @@ -268,7 +259,6 @@ class CRM_Utils_Sort { * * @return int * returns of the current sort direction - * @acccess public */ public function getCurrentSortDirection() { return $this->_currentSortDirection; @@ -295,7 +285,7 @@ class CRM_Utils_Sort { } // else: $a and $b are equal wrt to this attribute, try next... } } - // if we get here, $a and $b es equal for all we know + // if we get here, $a and $b are equal for all we know // however, as I understand we don't want equality here: return -1; } diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 77011a9135..fb99bfea70 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -29,14 +29,12 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ */ require_once 'HTML/QuickForm/Rule/Email.php'; /** * This class contains string functions. - * */ class CRM_Utils_String { const COMMA = ",", SEMICOLON = ";", SPACE = " ", TAB = "\t", LINEFEED = "\n", CARRIAGELINE = "\r\n", LINECARRIAGE = "\n\r", CARRIAGERETURN = "\r"; @@ -221,13 +219,13 @@ class CRM_Utils_String { $str = preg_replace('/\s+/', '', $str); // FIXME: This is a pretty brutal hack to make utf8 and 8859-1 work. - /* match low- or high-ascii characters */ + // match low- or high-ascii characters if (preg_match('/[\x00-\x20]|[\x7F-\xFF]/', $str)) { // || // low ascii characters // high ascii characters // preg_match( '/[\x7F-\xFF]/', $str ) ) { if ($utf8) { - /* if we did match, try for utf-8, or iso8859-1 */ + // if we did match, try for utf-8, or iso8859-1 return self::isUtf8($str); } @@ -260,7 +258,7 @@ class CRM_Utils_String { * array of strings w/ corresponding redacted outputs */ public static function regex($str, $regexRules) { - //redact the regular expressions + // redact the regular expressions if (!empty($regexRules) && isset($str)) { static $matches, $totalMatches, $match = array(); foreach ($regexRules as $pattern => $replacement) { @@ -298,14 +296,14 @@ class CRM_Utils_String { * @return mixed */ public static function redaction($str, $stringRules) { - //redact the strings + // redact the strings if (!empty($stringRules)) { foreach ($stringRules as $match => $replace) { $str = str_ireplace($match, $replace, $str); } } - //return the redacted output + // return the redacted output return $str; } @@ -322,11 +320,9 @@ class CRM_Utils_String { // eliminate all white space from the string $str = preg_replace('/\s+/', '', $str); - /* pattern stolen from the php.net function documentation for - * utf8decode(); - * comment by JF Sebastian, 30-Mar-2005 - */ - + // pattern stolen from the php.net function documentation for + // utf8decode(); + // comment by JF Sebastian, 30-Mar-2005 return preg_match('/^([\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xec][\x80-\xbf]{2}|\xed[\x80-\x9f][\x80-\xbf]|[\xee-\xef][\x80-\xbf]{2}|f0[\x90-\xbf][\x80-\xbf]{2}|[\xf1-\xf3][\x80-\xbf]{3}|\xf4[\x80-\x8f][\x80-\xbf]{2})*$/', $str); // || // iconv('ISO-8859-1', 'UTF-8', $str); @@ -338,7 +334,7 @@ class CRM_Utils_String { } /** - * Determine if two href's are equivalent (fuzzy match) + * Determine if two hrefs are equivalent (fuzzy match) * * @param string $url1 * The first url to be matched. diff --git a/CRM/Utils/Sunlight.php b/CRM/Utils/Sunlight.php index cbc80b150f..bffa1ed972 100644 --- a/CRM/Utils/Sunlight.php +++ b/CRM/Utils/Sunlight.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Utils_Sunlight { static $_apiURL = 'http://api.sunlightlabs.com/'; diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 5d5e7d0833..e9c171b5aa 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -39,7 +39,8 @@ class CRM_Utils_System { static $_callbacks = NULL; /** - * @var string Page title + * @var string + * Page title */ static $title = ''; @@ -114,7 +115,7 @@ class CRM_Utils_System { list($name, $value) = explode('=', $qs[$i]); if ($name != $urlVar) { $name = rawurldecode($name); - //check for arrays in parameters: site.php?foo[]=1&foo[]=2&foo[]=3 + // check for arrays in parameters: site.php?foo[]=1&foo[]=2&foo[]=3 if ((strpos($name, '[') !== FALSE) && (strpos($name, ']') !== FALSE) ) { @@ -347,7 +348,7 @@ class CRM_Utils_System { * Uses the referer if valid else uses the default. * * @param array $names - * Refererer should match any str in this array. + * Referrer should match any str in this array. * @param string $default * (optional) The default userContext if no match found. */ @@ -798,7 +799,7 @@ class CRM_Utils_System { self::setHttpHeader('Content-Type', $mimeType); self::setHttpHeader('Expires', $now); - // lem9 & loic1: IE need specific headers + // lem9 & loic1: IE needs specific headers $isIE = strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'); if ($ext) { $fileString = "filename=\"{$name}.{$ext}\""; @@ -862,7 +863,7 @@ class CRM_Utils_System { } // at some point we'll add code here to make sure the url is not - // something that will mess up up, so we need to clean it up here + // something that will mess up, so we need to clean it up here return $url; } @@ -1110,8 +1111,6 @@ class CRM_Utils_System { return $headers; } - /** - */ public static function getRequestHeaders() { if (function_exists('apache_request_headers')) { return apache_request_headers(); @@ -1134,8 +1133,6 @@ class CRM_Utils_System { strtolower($_SERVER['HTTPS']) != 'off') ? TRUE : FALSE; } - /** - */ public static function redirectToSSL($abort = FALSE) { $config = CRM_Core_Config::singleton(); $req_headers = self::getRequestHeaders(); @@ -1179,7 +1176,7 @@ class CRM_Utils_System { $config = CRM_Core_Config::singleton(); if ($config->userSystem->is_drupal && function_exists('ip_address')) { - //drupal function handles the server being behind a proxy securely. We still have legacy ipn methods + // drupal function handles the server being behind a proxy securely. We still have legacy ipn methods // that reach this point without bootstrapping hence the check that the fn exists $address = ip_address(); } @@ -1476,8 +1473,6 @@ class CRM_Utils_System { return $config->userSystem->getLoggedInUfID(); } - /** - */ public static function baseCMSURL() { static $_baseURL = NULL; if (!$_baseURL) { @@ -1673,7 +1668,6 @@ class CRM_Utils_System { } return $file_list; } - // listIncludeFiles() /** * Get a list of all "plugins" (PHP classes that implement a piece of @@ -1709,10 +1703,7 @@ class CRM_Utils_System { } return $plugins; } - // getPluginList() - /** - */ public static function executeScheduledJobs() { $facility = new CRM_Core_JobManager(); $facility->execute(FALSE); diff --git a/CRM/Utils/SystemLogger.php b/CRM/Utils/SystemLogger.php index f736a17f17..bfcdfe949c 100644 --- a/CRM/Utils/SystemLogger.php +++ b/CRM/Utils/SystemLogger.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ class CRM_Utils_SystemLogger extends Psr\Log\AbstractLogger implements \Psr\Log\LoggerInterface { /** @@ -39,7 +37,6 @@ class CRM_Utils_SystemLogger extends Psr\Log\AbstractLogger implements \Psr\Log\ * @param mixed $level * @param string $message * @param array $context - * */ public function log($level, $message, array $context = array()) { if (!isset($context['hostname'])) { diff --git a/CRM/Utils/Time.php b/CRM/Utils/Time.php index fddc018848..73e5dd39d4 100644 --- a/CRM/Utils/Time.php +++ b/CRM/Utils/Time.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -39,7 +37,8 @@ class CRM_Utils_Time { /** - * @var int, the seconds offset from the real world time + * @var int + * the seconds offset from the real world time */ static private $_delta = 0; @@ -50,7 +49,6 @@ class CRM_Utils_Time { * Format in which date is to be retrieved. * * @return date - * */ public static function getTime($returnFormat = 'YmdHis') { return date($returnFormat, self::getTimeRaw()); @@ -59,7 +57,8 @@ class CRM_Utils_Time { /** * Get the time. * - * @return int, seconds since epoch + * @return int + * seconds since epoch */ public static function getTimeRaw() { return time() + self::$_delta; @@ -74,7 +73,6 @@ class CRM_Utils_Time { * Format in which date is to be retrieved. * * @return date - * */ public static function setTime($newDateTime, $returnFormat = 'YmdHis') { self::$_delta = strtotime($newDateTime) - time(); diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index d6ade96ce1..e4eeb41fa1 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -288,7 +288,7 @@ class CRM_Utils_Token { } $value = NULL; - /* Construct the address token */ + // Construct the address token if (!empty($loc[$token])) { if ($html) { @@ -305,7 +305,7 @@ class CRM_Utils_Token { $value = $domain->$token; } elseif ($token == 'phone' || $token == 'email') { - /* Construct the phone and email tokens */ + // Construct the phone and email tokens $value = NULL; if (!empty($loc[$token])) { @@ -352,13 +352,13 @@ class CRM_Utils_Token { continue; } - /* If the string doesn't contain this token, skip it. */ + // If the string doesn't contain this token, skip it. if (!self::token_match('org', $token, $str)) { continue; } - /* Construct value from $token and $contact */ + // Construct value from $token and $contact $value = NULL; @@ -379,7 +379,7 @@ class CRM_Utils_Token { $value = "cs={$cs}"; } elseif ($token == 'address') { - /* Build the location values array */ + // Build the location values array $loc = array(); $loc['display_name'] = CRM_Utils_Array::retrieveValueRecursive($org, 'display_name'); @@ -388,7 +388,7 @@ class CRM_Utils_Token { $loc['state_province'] = CRM_Utils_Array::retrieveValueRecursive($org, 'state_province'); $loc['postal_code'] = CRM_Utils_Array::retrieveValueRecursive($org, 'postal_code'); - /* Construct the address token */ + // Construct the address token $value = CRM_Utils_Address::format($loc); if ($html) { @@ -419,7 +419,7 @@ class CRM_Utils_Token { * @param bool $escapeSmarty * * @return string - * The processed sstring + * The processed string */ public static function &replaceMailingTokens( $str, @@ -594,8 +594,8 @@ class CRM_Utils_Token { $html = FALSE, $escapeSmarty = FALSE ) { - /* If the token is an email action, use it. Otherwise, find the - * appropriate URL */ + // If the token is an email action, use it. Otherwise, find the + // appropriate URL. if (!in_array($token, self::$_tokens['action'])) { $value = "{action.$token}"; @@ -608,7 +608,7 @@ class CRM_Utils_Token { } if ($value && $html) { - //fix for CRM-2318 + // fix for CRM-2318 if ((substr($token, -3) != 'Url') && ($token != 'forward')) { $value = "mailto:$value"; } @@ -654,7 +654,7 @@ class CRM_Utils_Token { ) { $key = 'contact'; if (self::$_tokens[$key] == NULL) { - /* This should come from UF */ + // This should come from UF self::$_tokens[$key] = array_merge( @@ -709,7 +709,7 @@ class CRM_Utils_Token { ); } - /* Construct value from $token and $contact */ + // Construct value from $token and $contact $value = NULL; $noReplace = FALSE; @@ -858,10 +858,10 @@ class CRM_Utils_Token { } /** - * unescapeTokens removes any characters that caused the replacement routines to skip token replacement - * for example {{token}} or \{token} will result in {token} in the final email + * unescapeTokens removes any characters that caused the replacement routines to skip token replacement + * for example {{token}} or \{token} will result in {token} in the final email * - * this routine will remove the extra backslashes and braces + * this routine will remove the extra backslashes and braces * * @param $str ref to the string that will be scanned and modified */ @@ -1247,7 +1247,7 @@ class CRM_Utils_Token { ) { $pcm = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'preferred_communication_method'); - // communication Prefferance + // communication Preference $contactPcm = explode(CRM_Core_DAO::VALUE_SEPARATOR, $contactDetails[$contactID]['preferred_communication_method'] ); @@ -1268,7 +1268,7 @@ class CRM_Utils_Token { } } - //special case for greeting replacement + // special case for greeting replacement foreach (array( 'email_greeting', 'postal_greeting', @@ -1352,8 +1352,8 @@ class CRM_Utils_Token { $tokens = array(), $className = NULL ) { - //@todo - this function basically replicates calling - //civicrm_api3('contribution', 'get', array('id' => array('IN' => array()) + // @todo this function basically replicates calling + // civicrm_api3('contribution', 'get', array('id' => array('IN' => array()) if (empty($contributionIDs)) { // putting a fatal here so we can track if/when this happens CRM_Core_Error::fatal(); @@ -1390,7 +1390,7 @@ class CRM_Utils_Token { $details[$dao->id]['financial_type'] = $ftis[$financialtypeId]; } - // TODO: call a hook to get token contribution details + // @todo call a hook to get token contribution details } } @@ -1411,7 +1411,7 @@ class CRM_Utils_Token { } /** - * Replace greeting tokens exists in message/subject + * Replace existing greeting tokens in message/subject. */ public static function replaceGreetingTokens(&$tokenString, $contactDetails = NULL, $contactId = NULL, $className = NULL, $escapeSmarty = FALSE) { @@ -1573,8 +1573,6 @@ class CRM_Utils_Token { return $value; } - /** - */ protected static function _buildContributionTokens() { $key = 'contribution'; if (self::$_tokens[$key] == NULL) { @@ -1618,7 +1616,7 @@ class CRM_Utils_Token { } $fn = 'get' . ucfirst($entity) . 'tokenReplacement'; - //since we already know the tokens lets just use them & do str_replace which is faster & simpler than preg_replace + // since we already know the tokens lets just use them & do str_replace which is faster & simpler than preg_replace foreach ($knownTokens[$entity] as $token) { $replaceMent = CRM_Utils_Token::$fn($token, $entityArray, $escapeSmarty); $str = str_replace('{' . $entity . '.' . $token . '}', $replaceMent, $str); @@ -1740,7 +1738,7 @@ class CRM_Utils_Token { $value = $membership[$token]; } else { - //ie unchanged + // ie unchanged $value = "{$entity}.{$token}"; } break; @@ -1818,7 +1816,7 @@ class CRM_Utils_Token { natcasesort($tokens); // Attempt to place tokens into optgroups - // TODO: These groupings could be better and less hackish. Getting them pre-grouped from upstream would be nice. + // @todo These groupings could be better and less hackish. Getting them pre-grouped from upstream would be nice. foreach ($tokens as $k => $v) { // Check to see if this token is already in a group e.g. for custom fields $split = explode(' :: ', $v); diff --git a/CRM/Utils/Tree.php b/CRM/Utils/Tree.php index cc526ae474..819e7a1487 100644 --- a/CRM/Utils/Tree.php +++ b/CRM/Utils/Tree.php @@ -69,12 +69,6 @@ * 'name' - string * 'children' - array * 'data' - array - * - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2015 - * $Id: $ - * */ class CRM_Utils_Tree { diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 5e12acd9ba..5cb4b831cd 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id: $ - * */ class CRM_Utils_Type { const diff --git a/CRM/Utils/Verp.php b/CRM/Utils/Verp.php index 71a59b9136..0c77f2dd95 100644 --- a/CRM/Utils/Verp.php +++ b/CRM/Utils/Verp.php @@ -31,8 +31,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id: $ - * */ class CRM_Utils_Verp { /* Mapping of reserved characters to hex codes */ diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index c04e6310a9..380c4b61db 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id: $ - * */ class CRM_Utils_VersionCheck { const diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index 419105d171..c5d01a6598 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -46,7 +46,7 @@ class CRM_Utils_Weight { * @param array $fieldValues * Field => value to be used in the WHERE. * @param string $weightField - * Field which contains the weight value,. + * Field which contains the weight value. * defaults to 'weight' * * @return bool @@ -70,7 +70,7 @@ class CRM_Utils_Weight { } if ($minDupeID->dupeId && $status) { - //recursive call to correct all duplicate weight entries. + // recursive call to correct all duplicate weight entries. return CRM_Utils_Weight::correctDuplicateWeights($daoName, $fieldValues, $weightField); } elseif (!$minDupeID->dupeId) { @@ -93,7 +93,7 @@ class CRM_Utils_Weight { * @param array $fieldValues * Field => value to be used in the WHERE. * @param string $weightField - * Field which contains the weight value,. + * Field which contains the weight value. * defaults to 'weight' * * @return bool @@ -146,10 +146,10 @@ class CRM_Utils_Weight { } if ($newWeight > $maxWeight) { - //calculate new weight, CRM-4133 + // calculate new weight, CRM-4133 $calNewWeight = CRM_Utils_Weight::getNewWeight($daoName, $fieldValues, $weightField); - //no need to update weight for other fields. + // no need to update weight for other fields. if ($calNewWeight > $maxWeight) { return $calNewWeight; } @@ -217,7 +217,7 @@ class CRM_Utils_Weight { if ($sameWeightCount) { $newWeight = max($weights) + 1; - //check for max wt should not greater than cal max wt. + // check for max wt, should not greater than cal max wt. $calMaxWt = min($weights) + count($weights) - 1; if ($newWeight > $calMaxWt) { $newWeight = $calMaxWt; @@ -238,7 +238,7 @@ class CRM_Utils_Weight { * @param array $fieldValues * Field => value to be used in the WHERE. * @param string $weightField - * Field which contains the weight value,. + * Field which contains the weight value. * defaults to 'weight' * * @return int @@ -261,7 +261,7 @@ class CRM_Utils_Weight { * @param array $fieldValues * Field => value to be used in the WHERE. * @param string $weightField - * Field which contains the weight value,. + * Field which contains the weight value. * defaults to 'weight' * * @return int diff --git a/CRM/Utils/XML.php b/CRM/Utils/XML.php index 5df6df81ae..c5fb7669ce 100644 --- a/CRM/Utils/XML.php +++ b/CRM/Utils/XML.php @@ -28,7 +28,6 @@ /** * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ */ class CRM_Utils_XML { diff --git a/CRM/Utils/Zip.php b/CRM/Utils/Zip.php index 03e02cb537..ad5ee42b98 100644 --- a/CRM/Utils/Zip.php +++ b/CRM/Utils/Zip.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -43,7 +41,8 @@ class CRM_Utils_Zip { * * @param ZipArchive $zip * - * @return mixed; FALSE if #root level items !=1; otherwise, the name of base dir + * @return mixed + * FALSE if #root level items !=1; otherwise, the name of base dir */ static public function findBaseDirName(ZipArchive $zip) { $cnt = $zip->numFiles; @@ -75,7 +74,8 @@ class CRM_Utils_Zip { * * @param ZipArchive $zip * - * @return array(string), no trailing / + * @return array(string) + * no trailing / */ static public function findBaseDirs(ZipArchive $zip) { $cnt = $zip->numFiles; @@ -98,8 +98,8 @@ class CRM_Utils_Zip { * @param ZipArchive $zip * @param $expected * - * @return string - * or FALSE + * @return string|bool + * Return string or FALSE */ static public function guessBasedir(ZipArchive $zip, $expected) { $candidate = FALSE; -- 2.25.1