Commit a3e55d9c authored by totten's avatar totten
Browse files

INFRA-132 - CRM/Utils - Misc

parent 4e66d748
......@@ -111,7 +111,8 @@ abstract class CRM_Utils_Hook {
*
* @return mixed
*/
abstract function invoke($numParams,
abstract function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
);
......@@ -129,7 +130,8 @@ abstract class CRM_Utils_Hook {
*
* @return array|bool
*/
function commonInvoke($numParams,
function commonInvoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix, $fnPrefix
) {
......@@ -179,7 +181,8 @@ abstract class CRM_Utils_Hook {
*
* @return array|bool
*/
function runHooks($civiModules, $fnSuffix, $numParams,
function runHooks(
$civiModules, $fnSuffix, $numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6
) {
// $civiModules is *not* passed by reference because runHooks
......@@ -654,7 +657,8 @@ abstract class CRM_Utils_Hook {
*
* @return null
*/
static function tokenValues(&$details,
static function tokenValues(
&$details,
$contactIDs,
$jobID = NULL,
$tokens = array(),
......@@ -893,7 +897,8 @@ abstract class CRM_Utils_Hook {
*
* @return mixed
*/
static function alterPaymentProcessorParams($paymentObj,
static function alterPaymentProcessorParams(
$paymentObj,
&$rawParams,
&$cookedParams
) {
......
......@@ -75,7 +75,8 @@ class CRM_Utils_Hook_DrupalBase extends CRM_Utils_Hook {
*
* @return array|bool
*/
function invoke($numParams,
function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix) {
......
......@@ -68,7 +68,8 @@ class CRM_Utils_Hook_Joomla extends CRM_Utils_Hook {
*
* @return mixed
*/
function invoke($numParams,
function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
) {
......
......@@ -68,7 +68,8 @@ class CRM_Utils_Hook_Soap extends CRM_Utils_Hook {
*
* @return mixed
*/
function invoke($numParams,
function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
) {
......
......@@ -106,7 +106,8 @@ class CRM_Utils_Hook_UnitTests extends CRM_Utils_Hook {
*
* @return mixed
*/
function invoke($numParams,
function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix) {
......
......@@ -185,11 +185,12 @@ WHERE g.name IN ( $nameString )
* @param $whereField
* @param null $additionalWhereCond
*/
function table(&$ids,
$tableName,
&$fields,
$whereField,
$additionalWhereCond = NULL
function table(
&$ids,
$tableName,
&$fields,
$whereField,
$additionalWhereCond = NULL
) {
if (empty($ids)) {
return;
......@@ -589,9 +590,10 @@ WHERE ac.contact_id IN ( $ids )
* @param null $lastExportTime
* @param bool $discoverContacts
*/
function run($fileName,
$lastExportTime = NULL,
$discoverContacts = FALSE
function run(
$fileName,
$lastExportTime = NULL,
$discoverContacts = FALSE
) {
$this->_discoverContacts = $discoverContacts;
......@@ -615,7 +617,7 @@ WHERE date >= $lastExportTime
";
}
$dao = & CRM_Core_DAO::executeQuery($sql);
$dao = &CRM_Core_DAO::executeQuery($sql);
$contactIDs = array();
while ($dao->fetch()) {
......
......@@ -302,7 +302,8 @@ class CRM_Utils_PDF_Utils {
* @param string $author
* @param string $title
*/
static function &pdflib($fileName,
static function &pdflib(
$fileName,
$searchPath,
&$values,
$numPages = 1,
......
......@@ -158,7 +158,8 @@ class CRM_Utils_REST {
if (isset($result['count'])) {
$count = ' count="' . $result['count'] . '" ';
}
else { $count = "";
else {
$count = "";
}
$xml = "<?xml version=\"1.0\"?>
<ResultSet xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" $count>
......@@ -227,7 +228,8 @@ class CRM_Utils_REST {
if ($inquote || $inarray) {
$result .= $char;
}
else { $result .= $char . $newline . str_repeat($tab, $tabcount);
else {
$result .= $char . $newline . str_repeat($tab, $tabcount);
}
break;
......@@ -426,7 +428,8 @@ class CRM_Utils_REST {
}
}
if (array_key_exists('return', $requestParams) && is_array($requestParams['return'])) {
foreach ($requestParams['return'] as $key => $v) { $params['return.' . $key] = 1;
foreach ($requestParams['return'] as $key => $v) {
$params['return.' . $key] = 1;
}
}
return $params;
......
......@@ -98,7 +98,8 @@ class CRM_Utils_Recent {
* @return void
* @static
*/
static function add($title,
static function add(
$title,
$url,
$id,
$type,
......
......@@ -576,7 +576,8 @@ class CRM_Utils_String {
* @return string the sanitized string
* @static
*/
static function stripPathChars($string,
static function stripPathChars(
$string,
$search = NULL,
$replace = NULL
) {
......
......@@ -262,7 +262,8 @@ class CRM_Utils_System {
*
* @return string
*/
static function href($text, $path = NULL, $query = NULL, $absolute = TRUE,
static function href(
$text, $path = NULL, $query = NULL, $absolute = TRUE,
$fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE
) {
$url = self::url($path, $query, $absolute, $fragment, $htmlize, $frontend, $forceBackend);
......@@ -805,7 +806,8 @@ class CRM_Utils_System {
* @param bool $output
* @param string $disposition
*/
static function download($name, $mimeType, &$buffer,
static function download(
$name, $mimeType, &$buffer,
$ext = NULL,
$output = TRUE,
$disposition = 'attachment'
......@@ -1646,7 +1648,8 @@ class CRM_Utils_System {
*
* @return string $url, formatted url.
*/
static function languageNegotiationURL($url,
static function languageNegotiationURL(
$url,
$addLanguagePart = TRUE,
$removeLanguagePart = FALSE
) {
......@@ -1667,7 +1670,8 @@ class CRM_Utils_System {
* (optional) Sent by contribution/event reg/profile pages which uses a id
* specific extra file name if present.
*/
static function appendTPLFile($fileName,
static function appendTPLFile(
$fileName,
&$content,
$overideFileName = NULL
) {
......
......@@ -563,8 +563,10 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
*/
public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) {
static $run_once = FALSE;
if ($run_once) { return TRUE;
} else { $run_once = TRUE;
if ($run_once) {
return TRUE;
} else {
$run_once = TRUE;
}
if (!($root = $this->cmsRootPath())) {
......
......@@ -163,7 +163,8 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
* @return string an HTML string containing a link to the given path.
*
*/
function url($path = NULL, $query = NULL, $absolute = FALSE,
function url(
$path = NULL, $query = NULL, $absolute = FALSE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
) {
......
......@@ -357,7 +357,8 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
*
* @return string an HTML string containing a link to the given path.
*/
function url($path = NULL, $query = NULL, $absolute = TRUE,
function url(
$path = NULL, $query = NULL, $absolute = TRUE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
) {
......
......@@ -183,7 +183,8 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
*
* @return string
*/
function url($path = NULL, $query = NULL, $absolute = FALSE,
function url(
$path = NULL, $query = NULL, $absolute = FALSE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
) {
......
......@@ -928,7 +928,8 @@ class CRM_Utils_Token {
* @return string The processed string
* @static
*/
public static function &replaceResubscribeTokens($str, &$domain, &$groups, $html,
public static function &replaceResubscribeTokens(
$str, &$domain, &$groups, $html,
$contact_id, $hash
) {
if (self::token_match('resubscribe', 'group', $str)) {
......@@ -1162,7 +1163,8 @@ class CRM_Utils_Token {
* @return array
* @static
*/
static function getTokenDetails($contactIDs,
static function getTokenDetails(
$contactIDs,
$returnProperties = NULL,
$skipOnHold = TRUE,
$skipDeceased = TRUE,
......@@ -1289,7 +1291,8 @@ class CRM_Utils_Token {
* @param string $jobID
* @return array contactDetails with hooks swapped out
*/
public function getAnonymousTokenDetails($contactIDs = array(0),
public function getAnonymousTokenDetails($contactIDs = array(
0),
$returnProperties = NULL,
$skipOnHold = TRUE,
$skipDeceased = TRUE,
......@@ -1324,7 +1327,8 @@ class CRM_Utils_Token {
* @return array
* @static
*/
static function getContributionTokenDetails($contributionIDs,
static function getContributionTokenDetails(
$contributionIDs,
$returnProperties = NULL,
$extraParams = NULL,
$tokens = array(),
......
......@@ -290,7 +290,8 @@ class CRM_Utils_Weight {
*
* @return CRM_Core_DAO objet that holds the results of the query
*/
static function &query($queryType,
static function &query(
$queryType,
$daoName,
$fieldValues = NULL,
$queryData,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment