From f4aaa82a04876fea07ca47f9498e4caaddf2810b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 9 May 2014 10:54:05 +1200 Subject: [PATCH] Comment block fixes --- CRM/Contact/BAO/ContactType.php | 93 ++++++++++++++----- CRM/Contribute/BAO/Premium.php | 26 ++++-- CRM/Contribute/Form/Contribution/ThankYou.php | 2 +- CRM/Contribute/Form/ContributionBase.php | 12 +++ CRM/Utils/Address.php | 12 ++- CRM/Utils/Api.php | 2 + CRM/Utils/Array.php | 22 +++-- CRM/Utils/Cache.php | 4 +- CRM/Utils/Check.php | 4 +- CRM/Utils/Date.php | 56 +++++++---- CRM/Utils/DeprecatedUtils.php | 44 +++++---- CRM/Utils/File.php | 20 +++- CRM/Utils/Hook.php | 64 ++++++++----- CRM/Utils/HttpClient.php | 4 +- CRM/Utils/ICalendar.php | 15 +-- CRM/Utils/JSON.php | 7 +- CRM/Utils/Money.php | 11 ++- CRM/Utils/Network.php | 3 + CRM/Utils/Number.php | 4 +- CRM/Utils/Pager.php | 22 ++--- CRM/Utils/PagerAToZ.php | 11 ++- CRM/Utils/PseudoConstant.php | 10 +- CRM/Utils/REST.php | 2 +- CRM/Utils/Recent.php | 13 ++- CRM/Utils/Signer.php | 2 + CRM/Utils/SoapServer.php | 12 ++- CRM/Utils/Sort.php | 9 +- CRM/Utils/String.php | 9 +- CRM/Utils/System.php | 28 +++++- CRM/Utils/System/Base.php | 5 + CRM/Utils/System/Drupal.php | 17 +++- CRM/Utils/System/Drupal6.php | 21 ++++- CRM/Utils/System/Joomla.php | 34 +++++-- CRM/Utils/System/Soap.php | 3 + CRM/Utils/System/UnitTests.php | 1 + CRM/Utils/System/WordPress.php | 22 +++-- CRM/Utils/Tree.php | 6 +- CRM/Utils/Weight.php | 6 +- CRM/Utils/XML.php | 6 ++ CRM/Utils/Zip.php | 7 ++ 40 files changed, 471 insertions(+), 180 deletions(-) diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index 26b2a711d3..747a2dec5c 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -202,11 +202,14 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * *function to retrieve all subtypes * - *@param array $contactType. - *@return list of all subtypes OR list of subtypes associated to - *a given basic contact type - *@static + * @param array $contactType . + * @param bool $all + * @param string $columnName + * @param bool $ignoreCache * + * @return array of all subtypes OR list of subtypes associated to + *a given basic contact type + * @static */ static function subTypes($contactType = NULL, $all = FALSE, $columnName = 'name', $ignoreCache = FALSE) { if ($columnName == 'name') { @@ -221,10 +224,13 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * *function to retrieve subtype pairs with name as 'subtype-name' and 'label' as value * - *@param array $contactType. - *@return list of subtypes with name as 'subtype-name' and 'label' as value - *@static + * @param array $contactType . + * @param bool $all + * @param string $labelPrefix + * @param bool $ignoreCache * + * @return list of subtypes with name as 'subtype-name' and 'label' as value + * @static */ static function subTypePairs($contactType = NULL, $all = FALSE, $labelPrefix = '- ', $ignoreCache = FALSE) { $subtypes = self::subTypeInfo($contactType, $all, $ignoreCache); @@ -240,9 +246,10 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * *function to retrieve list of all types i.e basic + subtypes. * - *@return array of basic types + all subtypes. - *@static + * @param bool $all * + * @return array of basic types + all subtypes. + * @static */ static function contactTypes($all = FALSE) { return array_keys(self::contactTypeInfo($all)); @@ -252,9 +259,11 @@ WHERE subtype.name IS NOT NULL AND subtype.parent_id IS NOT NULL {$ctWHERE} * *function to retrieve info array about all types i.e basic + subtypes. * - *@return array of basic types + all subtypes. - *@static + * @param bool $all + * @param bool $reset * + * @return array of basic types + all subtypes. + * @static */ static function contactTypeInfo($all = FALSE, $reset = FALSE) { static $_cache = NULL; @@ -310,10 +319,13 @@ WHERE type.name IS NOT NULL * *function to retrieve basic type pairs with name as 'built-in name' and 'label' as value * - *@param array $contactType. - *@return list of basictypes with name as 'built-in name' and 'label' as value - *@static + * @param bool $all + * @param null $typeName + * @param null $delimiter * + * @internal param array $contactType . + * @return list of basictypes with name as 'built-in name' and 'label' as value + * @static */ static function contactTypePairs($all = FALSE, $typeName = NULL, $delimiter = NULL) { $types = self::contactTypeInfo($all); @@ -423,10 +435,11 @@ AND ( p.is_active = 1 OR p.id IS NULL ) /** * function to check if a given type is a subtype * - *@param string $subType contact subType. - *@return boolean true if subType, false otherwise. - *@static + * @param string $subType contact subType. + * @param bool $ignoreCache * + * @return boolean true if subType, false otherwise. + * @static */ static function isaSubType($subType, $ignoreCache = FALSE) { return in_array($subType, self::subTypes(NULL, TRUE, 'name', $ignoreCache)); @@ -478,10 +491,12 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * *function to suppress all subtypes present in given array. * - *@param array $subType contact subType. - *@return array of suppresssubTypes . - *@static + * @param $subTypes + * @param bool $ignoreCache * + * @internal param array $subType contact subType. + * @return array of suppresssubTypes . + * @static */ static function suppressSubTypes(&$subTypes, $ignoreCache = FALSE) { $subTypes = array_diff($subTypes, self::subTypes(NULL, TRUE, 'name', $ignoreCache)); @@ -492,11 +507,13 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; * *function to verify if a given subtype is associated with a given basic contact type. * - *@param string $subType contact subType - *@param string $contactType contact Type - *@return boolean true if contact extends, false otherwise. - *@static + * @param string $subType contact subType + * @param string $contactType contact Type + * @param bool $ignoreCache + * @param string $columnName * + * @return boolean true if contact extends, false otherwise. + * @static */ static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') { if (!is_array($subType)) { @@ -549,8 +566,9 @@ WHERE subtype.name IN ('" . implode("','", $subType) . "' )"; /** * Function to delete Contact SubTypes * - * @param int $contactTypeId ID of the Contact Subtype to be deleted. + * @param int $contactTypeId ID of the Contact Subtype to be deleted. * + * @return bool * @access public * @static */ @@ -755,6 +773,13 @@ WHERE name = %1"; return FALSE; } + /** + * @todo what does this function do? + * @param $contactId + * @param $contactType + * + * @return bool + */ static function hasRelationships($contactId, $contactType) { $subTypeClause = NULL; if (self::isaSubType($contactType)) { @@ -784,6 +809,13 @@ LIMIT 1"; return FALSE; } + /** + * @todo what does this function do? + * @param $contactType + * @param array $subtypeSet + * + * @return array + */ static function getSubtypeCustomPair($contactType, $subtypeSet = array( )) { if (empty($subtypeSet)) { @@ -806,6 +838,17 @@ WHERE extends = %1 AND " . implode(" OR ", $subTypeClause); return array_unique($customSet); } + /** + * Function that does something + * @todo what does this function do? + * + * @param $contactID + * @param $contactType + * @param array $oldSubtypeSet + * @param array $newSubtypeSet + * + * @return bool + */ static function deleteCustomSetForSubtypeMigration($contactID, $contactType, $oldSubtypeSet = array(), diff --git a/CRM/Contribute/BAO/Premium.php b/CRM/Contribute/BAO/Premium.php index f4bea6f8de..3fd5384172 100644 --- a/CRM/Contribute/BAO/Premium.php +++ b/CRM/Contribute/BAO/Premium.php @@ -86,9 +86,11 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { } /** - * Function to delete financial Types + * Function to delete financial Types * - * @param int $contributionTypeId + * @param $premiumID + * + * @internal param int $contributionTypeId * @static */ static function del($premiumID) { @@ -103,7 +105,13 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { /** * Function to build Premium Block im Contribution Pages * - * @param int $pageId + * @param $form CRM_Core_Form + * @param $pageID + * @param bool $formItems + * @param null $selectedProductID + * @param null $selectedOption + * + * @internal param int $pageId * @static */ static function buildPremiumBlock(&$form, $pageID, $formItems = FALSE, $selectedProductID = NULL, $selectedOption = NULL) { @@ -167,7 +175,11 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { /** * Function to build Premium B im Contribution Pages * - * @param int $pageId + * @param $form CRM_Core_Form + * @param $productID + * @param null $premiumProductID + * + * @internal param int $pageId * @static */ function buildPremiumPreviewBlock($form, $productID, $premiumProductID = NULL) { @@ -205,7 +217,9 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { /** * Function to delete premium associated w/ contribution page. * - * @param int $contribution page id + * @param $contributionPageID + * + * @internal param int $contribution page id * @static */ static function deletePremium($contributionPageID) { @@ -236,7 +250,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { } /** - * Funtion to retrieve premium product and their options + * Function to retrieve premium product and their options * * @return array product and option arrays * @static diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 6247f0a87e..1597730d54 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -63,7 +63,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont $this->assign('max_reminders', CRM_Utils_Array::value('max_reminders', $this->_values)); $this->assign('initial_reminder_day', CRM_Utils_Array::value('initial_reminder_day', $this->_values)); CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title', $this->_values)); - // Make the contributionPageID avilable to the template + // Make the contributionPageID available to the template $this->assign('contributionPageID', $this->_id); $this->assign('isShare', $this->_values['is_share']); diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index e9535cae9a..4d953bc1b8 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -664,6 +664,12 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { /** * Function to add the custom fields * + * @param $id + * @param $name + * @param bool $viewOnly + * @param null $profileContactType + * @param null $fieldTypes + * * @return void * @access public */ @@ -806,6 +812,12 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { } } + /** + * Check template file exists + * @param null $suffix + * + * @return null|string + */ function checkTemplateFileExists($suffix = NULL) { if ($this->_id) { $templateFile = "CRM/Contribute/Form/Contribution/{$this->_id}/{$this->_name}.{$suffix}tpl"; diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 6f573fd976..53255eb364 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -38,11 +38,13 @@ class CRM_Utils_Address { * Format an address basing on the address fields provided. * Use Setting's address_format if there's no format specified. * - * @param array $fields the address fields - * @param string $format the desired address format - * @param boolean $microformat if true indicates, the address to be built in hcard-microformat standard. - * @param boolean $mailing if true indicates, the call has been made from mailing label - * @param boolean $individualFormat if true indicates, the call has been made for the contact of type 'individual' + * @param array $fields the address fields + * @param string $format the desired address format + * @param boolean $microformat if true indicates, the address to be built in hcard-microformat standard. + * @param boolean $mailing if true indicates, the call has been made from mailing label + * @param boolean $individualFormat if true indicates, the call has been made for the contact of type 'individual' + * + * @param null $tokenFields * * @return string formatted address string * diff --git a/CRM/Utils/Api.php b/CRM/Utils/Api.php index b45d7eefa6..97143abdd0 100644 --- a/CRM/Utils/Api.php +++ b/CRM/Utils/Api.php @@ -30,6 +30,8 @@ class CRM_Utils_Api { * Attempts to retrieve the API entity name from any calling class. * * @param string|object $classNameOrObject + * + * @return string * @throws CRM_Core_Exception */ static function getEntityName($classNameOrObject) { diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index 9515244557..6518865625 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -198,7 +198,7 @@ class CRM_Utils_Array { * [1] => baz * [2] => 42 * ) - * + * * [asdf] => Array * ( * [merp] => bleep @@ -208,12 +208,12 @@ class CRM_Utils_Array { * [1] => 2 * [2] => 3 * ) - * + * * ) - * + * * [quux] => 999 * ) - * + * * Corresponding flattened array: * Array * ( @@ -381,6 +381,10 @@ class CRM_Utils_Array { * @params int $depth * (optional) Current recursion depth. * + * @param $array + * @param int $maxdepth + * @param int $depth + * * @return array * The new copy of $array. * @@ -603,7 +607,7 @@ class CRM_Utils_Array { * @param string $field * Name of the attribute used for sorting. * - * @return array + * @return array * Sorted array */ static function crmArraySortByField($array, $field) { @@ -618,7 +622,7 @@ class CRM_Utils_Array { * @param array $array * The input array possibly containing duplicate values. * - * @return array + * @return array * The input array with duplicate values removed. */ static function crmArrayUnique($array) { @@ -642,7 +646,7 @@ class CRM_Utils_Array { * @param array $array * (optional) Array to be sorted. * - * @return array + * @return array * Sorted array. */ static function asort($array = array()) { @@ -665,8 +669,8 @@ class CRM_Utils_Array { * * @param array $items * The array from which to remove items. - * @param string[]|string $key,... - * When passed a string, unsets $items[$key]. + * + * @internal param string|\string[] $key When passed a string, unsets $items[$key].* When passed a string, unsets $items[$key]. * When passed an array of strings, unsets $items[$k] for each string $k * in the array. */ diff --git a/CRM/Utils/Cache.php b/CRM/Utils/Cache.php index 065d297fb6..314c47b331 100644 --- a/CRM/Utils/Cache.php +++ b/CRM/Utils/Cache.php @@ -50,9 +50,9 @@ class CRM_Utils_Cache { /** * Constructor * - * @param array $config an array of configuration params + * @param array $config an array of configuration params * - * @return void + * @return \CRM_Utils_Cache */ function __construct(&$config) { CRM_Core_Error::fatal(ts('this is just an interface and should not be called directly')); diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index 288a78f0e9..822f40de27 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -88,6 +88,8 @@ class CRM_Utils_Check { * Throw an exception if any of the checks fail * * @param array|NULL $messages list of CRM_Utils_Check_Message; or NULL if the default list should be fetched + * + * @throws Exception */ public function assertValid($messages = NULL) { if ($messages === NULL) { @@ -126,4 +128,4 @@ class CRM_Utils_Check { return $messages; } -} \ No newline at end of file +} diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 8c8a966b52..3c377a6cfc 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -41,9 +41,9 @@ class CRM_Utils_Date { /** * format a date by padding it with leading '0'. * - * @param array $date ('Y', 'M', 'd') - * @param string $separator the seperator to use when formatting the date - * @param string $invalidDate what to return if the date is invalid + * @param array $date ('Y', 'M', 'd') + * @param string $separator the seperator to use when formatting the date + * @param int|string $invalidDate what to return if the date is invalid * * @return string - formatted string for date * @@ -208,6 +208,8 @@ class CRM_Utils_Date { /** * return abbreviated month names according to the locale * + * @param bool $month + * * @return array 1-based array with abbreviated month names * * @static @@ -281,10 +283,11 @@ class CRM_Utils_Date { * %P - uppercase ante/post meridiem ('AM', 'PM') * %Y - year as a decimal number including the century ('2005') * - * @param string $date date and time in 'YYYY-MM-DD hh:mm:ss' format - * @param string $format the output format - * @param array $dateParts an array with the desired date parts + * @param $dateString + * @param string $format the output format + * @param array $dateParts an array with the desired date parts * + * @internal param string $date date and time in 'YYYY-MM-DD hh:mm:ss' format * @return string the $format-formatted $date * * @static @@ -469,9 +472,11 @@ class CRM_Utils_Date { /** * converts the any given date to default date format. * - * @param array $params has given date-format - * @param int $dateType type of date - * @param string $dateParam index of params + * @param array $params has given date-format + * @param int $dateType type of date + * @param string $dateParam index of params + * + * @return bool * @static */ static function convertToDefaultDate(&$params, $dateType, $dateParam) { @@ -739,7 +744,10 @@ class CRM_Utils_Date { * Function to get start date and end from * the given relative term and unit * - * @param date $relative eg: term.unit + * @param date $relative eg: term.unit + * + * @param $from + * @param $to * * @return array start date, end date * @static @@ -818,11 +826,13 @@ class CRM_Utils_Date { /** * Function to calculate next payment date according to provided unit & interval * - * @param string $unit frequency unit like year,month, week etc.. + * @param string $unit frequency unit like year,month, week etc.. * - * @param int $interval frequency interval. + * @param int $interval frequency interval. * - * @param array $date start date of pledge. + * @param array $date start date of pledge. + * + * @param bool $dontCareTime * * @return array $result contains new date with added interval * @access public @@ -883,6 +893,8 @@ class CRM_Utils_Date { * * @param $format given format ( eg 'M Y', 'Y M' ) * return array of qfMapping and date parts for date format. + * + * @return array|null|string */ static function &checkBirthDateFormat($format = NULL) { $birthDateFormat = NULL; @@ -1434,13 +1446,13 @@ class CRM_Utils_Date { /** * Function to process date, convert to mysql format * - * @param string $date date string - * @param string $time time string - * @param string $returnNullString 'null' needs to be returned + * @param string $date date string + * @param string $time time string + * @param bool|string $returnNullString 'null' needs to be returned * so that db oject will set null in db - * @param string $format expected return date format.( default is mysql ) + * @param string $format expected return date format.( default is mysql ) * - * @return string $mysqlDate date format that is excepted by mysql + * @return string $mysqlDate date format that is excepted by mysql */ static function processDate($date, $time = NULL, $returnNullString = FALSE, $format = 'YmdHis') { $mysqlDate = NULL; @@ -1459,9 +1471,13 @@ class CRM_Utils_Date { /** * Function to convert mysql to date plugin format * - * @param string $mysqlDate date string + * @param string $mysqlDate date string + * + * @param null $formatType + * @param null $format + * @param null $timeFormat * - * @return array $date and time + * @return array $date and time */ static function setDateDefaults($mysqlDate = NULL, $formatType = NULL, $format = NULL, $timeFormat = NULL) { // if date is not passed assume it as today diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index f17358a473..593de9552d 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -38,11 +38,11 @@ require_once 'api/v3/utils.php'; * take the input parameter list as specified in the data model and * convert it into the same format that we use in QF and BAO object * - * @param array $params Associative array of property name/value + * @param array $params Associative array of property name/value * pairs to insert in new contact. - * @param array $values The reformatted properties that we can use internally + * @param array $values The reformatted properties that we can use internally * - * @param array $create Is the formatted Values array going to + * @param array|bool $create Is the formatted Values array going to * be used for CRM_vent_BAO_Participant:create() * * @return array|CRM_Error @@ -209,11 +209,14 @@ function _civicrm_api3_deprecated_participant_formatted_param($params, &$values, * take the input parameter list as specified in the data model and * convert it into the same format that we use in QF and BAO object * - * @param array $params Associative array of property name/value + * @param array $params Associative array of property name/value * pairs to insert in new contact. - * @param array $values The reformatted properties that we can use internally + * @param array $values The reformatted properties that we can use internally * ' * + * @param bool $create + * @param null $onDuplicate + * * @return array|CRM_Error * @access public */ @@ -663,11 +666,11 @@ function _civicrm_api3_deprecated_check_contact_dedupe($params) { * take the input parameter list as specified in the data model and * convert it into the same format that we use in QF and BAO object * - * @param array $params Associative array of property name/value + * @param array $params Associative array of property name/value * pairs to insert in new contact. - * @param array $values The reformatted properties that we can use internally + * @param array $values The reformatted properties that we can use internally * - * @param array $create Is the formatted Values array going to + * @param array|bool $create Is the formatted Values array going to * be used for CRM_Activity_BAO_Activity::create() * * @return array|CRM_Error @@ -1107,7 +1110,7 @@ function _civicrm_api3_deprecated_add_formatted_location_blocks(&$values, &$para * * @param $params * - * @return + * @return array */ function _civicrm_api3_deprecated_duplicate_formatted_contact($params) { $id = CRM_Utils_Array::value('id', $params); @@ -1202,14 +1205,16 @@ function _civicrm_api3_deprecated_validate_formatted_contact(&$params) { } - /** * @deprecated - this is part of the import parser not the API & needs to be moved on out * - * @param $params - * @param $onDuplicate + * @param $params + * @param $onDuplicate * - * @return + * @internal param $ $params + * @internal param $ $onDuplicate + * + * @return array|bool */ function _civicrm_api3_deprecated_create_participant_formatted($params, $onDuplicate) { require_once 'CRM/Event/Import/Parser.php'; @@ -1228,7 +1233,9 @@ function _civicrm_api3_deprecated_create_participant_formatted($params, $onDupli * * @param $params * - * @return + * @param bool $checkDuplicate + * + * @return array|bool */ function _civicrm_api3_deprecated_participant_check_params($params, $checkDuplicate = FALSE) { @@ -1447,10 +1454,13 @@ function _civicrm_api3_deprecated_contact_check_params( /** * - * @param $result - * @param $activityTypeID + * @param $result + * @param $activityTypeID + * + * @internal param $ $result + * @internal param $ $activityTypeID * - * @return $params + * @return array $params */ function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTypeID) { // get ready for collecting data about activity to be created diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 568fd3ce06..af01467185 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -129,7 +129,12 @@ class CRM_Utils_File { * delete a directory given a path name, delete children directories * and files if needed * - * @param string $path the path name + * @param $target + * @param bool $rmdir + * @param bool $verbose + * + * @throws Exception + * @internal param string $path the path name * * @return void * @access public @@ -237,6 +242,9 @@ class CRM_Utils_File { /** * Appends trailing slashed to paths * + * @param $name + * @param null $separator + * * @return string * @access public * @static @@ -378,7 +386,8 @@ class CRM_Utils_File { /** * Restrict access to a given directory (by planting there a restrictive .htaccess file) * - * @param string $dir the directory to be secured + * @param string $dir the directory to be secured + * @param bool $overwrite */ static function restrictAccess($dir, $overwrite = FALSE) { // note: empty value for $dir can play havoc, since that might result in putting '.htaccess' to root dir @@ -500,6 +509,9 @@ HTACCESS; /** * Make a file path relative to some base dir * + * @param $directory + * @param $basePath + * * @return string */ static function relativize($directory, $basePath) { @@ -588,6 +600,8 @@ HTACCESS; * * @param string $parent * @param string $child + * @param bool $checkRealPath + * * @return bool */ static function isChildPath($parent, $child, $checkRealPath = TRUE) { @@ -616,6 +630,8 @@ HTACCESS; * * @param string $fromDir the directory which should be moved * @param string $toDir the new location of the directory + * @param bool $verbose + * * @return bool TRUE on success */ static function replaceDir($fromDir, $toDir, $verbose = FALSE) { diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 8727dd9c88..615fdbc969 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -814,6 +814,8 @@ abstract class CRM_Utils_Hook { * - 'exclude_is_admin' * - 'membership_type_id' * @param array $membership membership details from the calling function + * + * @return mixed */ static function alterCalculatedMembershipStatus(&$membershipStatus, $arguments, $membership) { return self::singleton()->invoke(3, $membershipStatus, $arguments, @@ -956,8 +958,9 @@ abstract class CRM_Utils_Hook { * * @param string $obj object of rulegroup class * @param string $type type of queries e.g table / threshold - * @param array $query set of queries + * @param array $query set of queries * + * @return mixed * @access public */ static function dupeQuery($obj, $type, &$query) { @@ -970,12 +973,13 @@ abstract class CRM_Utils_Hook { /** * This hook is called AFTER EACH email has been processed by the script bin/EmailProcessor.php * - * @param string $type type of mail processed: 'activity' OR 'mailing' - * @param array &$params the params that were sent to the CiviCRM API function - * @param object $mail the mail object which is an ezcMail class - * @param array &$result the result returned by the api call - * @param string $action (optional ) the requested action to be performed if the types was 'mailing' + * @param string $type type of mail processed: 'activity' OR 'mailing' + * @param array &$params the params that were sent to the CiviCRM API function + * @param object $mail the mail object which is an ezcMail class + * @param array &$result the result returned by the api call + * @param string $action (optional ) the requested action to be performed if the types was 'mailing' * + * @return mixed * @access public */ static function emailProcessor($type, &$params, $mail, &$result, $action = NULL) { @@ -1011,10 +1015,13 @@ abstract class CRM_Utils_Hook { * This hook is called when API permissions are checked (cf. civicrm_api3_api_check_permission() * in api/v3/utils.php and _civicrm_api3_permissions() in CRM/Core/DAO/permissions.php). * - * @param string $entity the API entity (like contact) - * @param string $action the API action (like get) - * @param array &$params the API parameters - * @param array &$permisisons the associative permissions array (probably to be altered by this hook) + * @param string $entity the API entity (like contact) + * @param string $action the API action (like get) + * @param array &$params the API parameters + * @param $permissions + * + * @return mixed + * @internal param array $permisisons the associative permissions array (probably to be altered by this hook) */ static function alterAPIPermissions($entity, $action, &$params, &$permissions) { return self::singleton()->invoke(4, $entity, $action, $params, $permissions, @@ -1034,8 +1041,10 @@ abstract class CRM_Utils_Hook { /** * This hook allows user to customize context menu Actions on contact summary page. * - * @param array $actions Array of all Actions in contextmenu. - * @param int $contactID ContactID for the summary page + * @param array $actions Array of all Actions in contextmenu. + * @param int $contactID ContactID for the summary page + * + * @return mixed */ static function summaryActions(&$actions, $contactID = NULL) { return self::singleton()->invoke(2, $actions, $contactID, @@ -1056,9 +1065,11 @@ abstract class CRM_Utils_Hook { * * @param string $objectName the component name that we are doing the search * activity, campaign, case, contact, contribution, event, grant, membership, and pledge - * @param array &$headers the list of column headers, an associative array with keys: ( name, sort, order ) - * @param array &$rows the list of values, an associate array with fields that are displayed for that component - * @param array &$seletor the selector object. Allows you access to the context of the search + * @param array &$headers the list of column headers, an associative array with keys: ( name, sort, order ) + * @param array &$rows the list of values, an associate array with fields that are displayed for that component + * @param $selector + * + * @internal param array $seletor the selector object. Allows you access to the context of the search * * @return void modify the header and values object to pass the data u need */ @@ -1138,6 +1149,7 @@ abstract class CRM_Utils_Hook { * float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, * or 0 for disable this feature. This feature works only when $ishtml=false. * + * @return mixed */ static function alterMailingLabelParams(&$args) { return self::singleton()->invoke(1, $args, @@ -1155,6 +1167,7 @@ abstract class CRM_Utils_Hook { * @param $tplName the file name of the tpl * @param $object a reference to the page or form object * + * @return mixed * @access public */ static function alterContent(&$content, $context, $tplName, &$object) { @@ -1173,6 +1186,7 @@ abstract class CRM_Utils_Hook { * @param $context context of content - page or form * @param $tplName reference the file name of the tpl * + * @return mixed * @access public */ static function alterTemplateFile($formName, &$form, $context, &$tplName) { @@ -1181,10 +1195,14 @@ abstract class CRM_Utils_Hook { 'civicrm_alterTemplateFile' ); } + /** * This hook collects the trigger definition from all components * - * @param $triggerInfo reference to an array of trigger information + * @param $info + * @param string $tableName (optional) the name of the table that we are interested in only + * + * @internal param \reference $triggerInfo to an array of trigger information * each element has 4 fields: * table - array of tableName * when - BEFORE or AFTER @@ -1193,7 +1211,7 @@ abstract class CRM_Utils_Hook { * a statement can use the tokes {tableName} and {eventName} * to do token replacement with the table / event. This allows * templatizing logging and other hooks - * @param string $tableName (optional) the name of the table that we are interested in only + * @return mixed */ static function triggerInfo(&$info, $tableName = NULL) { return self::singleton()->invoke(2, $info, $tableName, @@ -1536,21 +1554,22 @@ abstract class CRM_Utils_Hook { /** * This hook is called before a case merge (or a case reassign) - * + * * @param type $mainContactId * @param type $mainCaseId * @param type $otherContactId * @param type $otherCaseId - * @param type $changeClient + * @param bool|\type $changeClient + * * @return void */ static function pre_case_merge($mainContactId, $mainCaseId = NULL, $otherContactId = NULL, $otherCaseId = NULL, $changeClient = FALSE) { return self::singleton()->invoke(5, $mainContactId, $mainCaseId, $otherContactId, $otherCaseId, $changeClient, 'civicrm_pre_case_merge'); } - + /** * This hook is called after a case merge (or a case reassign) - * + * * @param type $mainContactId * @param type $mainCaseId * @param type $otherContactId @@ -1567,9 +1586,12 @@ abstract class CRM_Utils_Hook { * Add a hook for altering the display name * * hook_civicrm_contact_get_displayname(&$display_name, $objContact) + * * @param string $displayName * @param int $contactId * @param object $dao the contact object + * + * @return mixed */ static function alterDisplayName($displayName, $contactId, $dao) { return self::singleton()->invoke(3, diff --git a/CRM/Utils/HttpClient.php b/CRM/Utils/HttpClient.php index b7dd02d2f5..a3252a27c0 100644 --- a/CRM/Utils/HttpClient.php +++ b/CRM/Utils/HttpClient.php @@ -145,7 +145,9 @@ class CRM_Utils_HttpClient { * Send an HTTP POST for a remote resource * * @param string $remoteFile URL of a .zip file - * @param string $localFile path at which to store the .zip file + * @param $params + * + * @internal param string $localFile path at which to store the .zip file * @return array array(0 => STATUS_OK|STATUS_DL_ERROR, 1 => string) */ public function post($remoteFile, $params) { diff --git a/CRM/Utils/ICalendar.php b/CRM/Utils/ICalendar.php index 073779cad3..3bef59fdb4 100644 --- a/CRM/Utils/ICalendar.php +++ b/CRM/Utils/ICalendar.php @@ -66,8 +66,9 @@ class CRM_Utils_ICalendar { * * @param $date Date to escape * - * @return Escaped date + * @param bool $gdata * + * @return Escaped date */ static function formatDate($date, $gdata = FALSE) { @@ -92,19 +93,19 @@ class CRM_Utils_ICalendar { * * @access public * - * @param string $content_type - * - * @param string $filename The file name (for downloads) + * @param string $calendar The calendar data to be published. * - * @param string $disposition How the file should be sent ('attachment' for downloads) + * @param string $content_type * * @param string $charset The character set to use, defaults to * 'us-ascii'. * - * @param string $calendar The calendar data to be published. + * @param null $fileName + * @param string $disposition How the file should be sent ('attachment' for downloads) * - * @return void + * @internal param string $filename The file name (for downloads) * + * @return void */ static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Utils/JSON.php b/CRM/Utils/JSON.php index a779e30b99..e556636981 100644 --- a/CRM/Utils/JSON.php +++ b/CRM/Utils/JSON.php @@ -63,9 +63,10 @@ class CRM_Utils_JSON { /** * Function to encode json format for flexigrid, NOTE: "id" should be present in $params for each row * - * @param array $params associated array of values rows - * @param int $page page no for selector - * @param array $selectorElements selector rows + * @param array $params associated array of values rows + * @param int $page page no for selector + * @param $total + * @param array $selectorElements selector rows * * @return json encode string */ diff --git a/CRM/Utils/Money.php b/CRM/Utils/Money.php index 354b467f04..69e60df322 100644 --- a/CRM/Utils/Money.php +++ b/CRM/Utils/Money.php @@ -49,9 +49,10 @@ class CRM_Utils_Money { * %C - the currency ISO code (e.g., 'USD') if provided * %c - the currency symbol (e.g., '$') if available * - * @param float $amount the monetary amount to display (1234.56) - * @param string $currency the three-letter ISO currency code ('USD') - * @param string $format the desired currency format + * @param float $amount the monetary amount to display (1234.56) + * @param string $currency the three-letter ISO currency code ('USD') + * @param string $format the desired currency format + * @param bool $onlyNumber * @param string $valueFormat the desired monetary value display format (e.g. '%!i') * * @return string formatted monetary string @@ -69,11 +70,11 @@ class CRM_Utils_Money { if (!$format) { $format = $config->moneyformat; } - + if (!$valueFormat) { $valueFormat = $config->moneyvalueformat; } - + if ($onlyNumber) { // money_format() exists only in certain PHP install (CRM-650) if (is_numeric($amount) and function_exists('money_format')) { diff --git a/CRM/Utils/Network.php b/CRM/Utils/Network.php index bfaf3d8f57..f9b3a4f088 100644 --- a/CRM/Utils/Network.php +++ b/CRM/Utils/Network.php @@ -40,8 +40,11 @@ class CRM_Utils_Network { /** * Try connecting to a TCP service; if it fails, retry. Repeat until serverStartupTimeOut elapses. * + * @param $host + * @param $port * @param int $serverStartupTimeOut seconds * @param float $interval seconds to wait in between pollings + * * @return bool TRUE if service is online */ public static function waitForServiceStartup($host, $port, $serverStartupTimeOut, $interval = 0.333) { diff --git a/CRM/Utils/Number.php b/CRM/Utils/Number.php index f971be6a6b..3cf0033bb9 100644 --- a/CRM/Utils/Number.php +++ b/CRM/Utils/Number.php @@ -4,6 +4,8 @@ class CRM_Utils_Number { * Create a random number with a given precision * * @param array $precision (int $significantDigits, int $postDecimalDigits) + * + * @return float * @link https://dev.mysql.com/doc/refman/5.1/en/fixed-point-types.html */ static function createRandomDecimal($precision) { @@ -37,4 +39,4 @@ class CRM_Utils_Number { return $sign * $val; } } -} \ No newline at end of file +} diff --git a/CRM/Utils/Pager.php b/CRM/Utils/Pager.php index eb8636956f..b703dbf5d8 100644 --- a/CRM/Utils/Pager.php +++ b/CRM/Utils/Pager.php @@ -64,18 +64,17 @@ class CRM_Utils_Pager extends Pager_Sliding { * We have embedded some html in this class. Need to figure out how to export this * to the top level at some point in time * - * @param int total the total count of items to be displayed - * @param int currentPage the page currently being displayed - * @param string status the status message to be displayed. It embeds a token + * @param $params + * + * @internal param \total $int the total count of items to be displayed + * @internal param \currentPage $int the page currently being displayed + * @internal param \status $string the status message to be displayed. It embeds a token * %%statusMessage%% that will be replaced with which items * are currently being displayed - * @param string csvString the title of the link to be displayed for the export - * @param int perPage the number of items displayed per page - * - * @return object the newly created and initialized pager object - * - * @access public + * @internal param \csvString $string the title of the link to be displayed for the export + * @internal param \perPage $int the number of items displayed per page * + * @return \CRM_Utils_Pager the newly created and initialized pager object@access public */ function __construct($params) { if ($params['status'] === NULL) { @@ -187,11 +186,12 @@ class CRM_Utils_Pager extends Pager_Sliding { * POST over-rides a GET, a POST at the top overrides * a POST at the bottom (of the page) * - * @param int defaultPageId current pageId + * @param int $defaultPageId defaultPageId current pageId + * + * @param $params * * @return int new pageId to display to the user * @access public - * */ function getPageID($defaultPageId = 1, &$params) { // POST has higher priority than GET vars diff --git a/CRM/Utils/PagerAToZ.php b/CRM/Utils/PagerAToZ.php index 066bf12ad9..60d8116428 100644 --- a/CRM/Utils/PagerAToZ.php +++ b/CRM/Utils/PagerAToZ.php @@ -42,9 +42,11 @@ class CRM_Utils_PagerAToZ { /** * returns the alphabetic array for sorting by character * - * @param array $query The query object + * @param array $query The query object * @param string $sortByCharacter The character that we are potentially sorting on * + * @param bool $isDAO + * * @return string The html formatted string * @access public * @static @@ -69,6 +71,9 @@ class CRM_Utils_PagerAToZ { /** * Function to return the all the dynamic characters * + * @param $query + * @param $isDAO + * * @return array $dynamicAlphabets is a array of dynamic characters * @access private * @static @@ -94,9 +99,11 @@ class CRM_Utils_PagerAToZ { /** * create the links * - * @param array $query The form values for search + * @param array $query The form values for search * @param string $sortByCharacter The character that we are potentially sorting on * + * @param $isDAO + * * @return array with links * @access private * @static diff --git a/CRM/Utils/PseudoConstant.php b/CRM/Utils/PseudoConstant.php index c333f5c849..6c2dc9e883 100644 --- a/CRM/Utils/PseudoConstant.php +++ b/CRM/Utils/PseudoConstant.php @@ -54,6 +54,8 @@ class CRM_Utils_PseudoConstant { * @access public * @static * + * @param $constant + * * @return array - array reference of all relevant constant */ public static function getConstant($constant) { @@ -73,6 +75,8 @@ class CRM_Utils_PseudoConstant { * @access public * @static * + * @param $constant + * * @return array - array reference of all relevant constant */ public static function flushConstant($constant) { @@ -93,7 +97,9 @@ class CRM_Utils_PseudoConstant { * If there's a full, preloaded map, use it. Otherwise, use search * class space. * - * @param string $name constant-name + * @param $constant + * + * @internal param string $name constant-name * @return string|NULL class-name */ public static function findConstantClass($constant) { @@ -134,6 +140,8 @@ class CRM_Utils_PseudoConstant { * * This may be inefficient and should generally be avoided. * + * @param $class + * * @return array of string, constant names */ public static function findConstantsByClass($class) { diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 92acf3ce97..885a1c3907 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -49,7 +49,7 @@ class CRM_Utils_REST { * Class constructor. This caches the real user framework class locally, * so we can use it for authentication and validation. * - * @param string $uf The userframework class + * @internal param string $uf The userframework class */ public function __construct() { // any external program which call Rest Server is responsible for diff --git a/CRM/Utils/Recent.php b/CRM/Utils/Recent.php index e02d1738d9..504ad85826 100644 --- a/CRM/Utils/Recent.php +++ b/CRM/Utils/Recent.php @@ -86,11 +86,16 @@ class CRM_Utils_Recent { /** * add an item to the recent stack * - * @param string $title the title to display - * @param string $url the link for the above title - * @param string $icon a link to a graphical image - * @param string $id object id + * @param string $title the title to display + * @param string $url the link for the above title + * @param string $id object id * + * @param $type + * @param $contactId + * @param $contactName + * @param array $others + * + * @internal param string $icon a link to a graphical image * @return void * @access public * @static diff --git a/CRM/Utils/Signer.php b/CRM/Utils/Signer.php index b9a9538fb4..03435adbd3 100644 --- a/CRM/Utils/Signer.php +++ b/CRM/Utils/Signer.php @@ -107,6 +107,8 @@ class CRM_Utils_Signer { * * @param $token string, the full public token representing the signature * @param $params array, key-value pairs + * + * @throws Exception * @return bool, TRUE iff all $paramNames for the submitted validate($params) and the original sign($params) */ function validate($token, $params) { diff --git a/CRM/Utils/SoapServer.php b/CRM/Utils/SoapServer.php index 8785aaae66..ce4e2b13cd 100644 --- a/CRM/Utils/SoapServer.php +++ b/CRM/Utils/SoapServer.php @@ -58,7 +58,7 @@ class CRM_Utils_SoapServer { * Class constructor. This caches the real user framework class locally, * so we can use it for authentication and validation. * - * @param string $uf The userframework class + * @internal param string $uf The userframework class */ public function __construct() { // any external program which call SoapServer is responsible for @@ -85,8 +85,9 @@ class CRM_Utils_SoapServer { /** * Verify a SOAP key * - * @param string $key The soap key generated by authenticate() + * @param string $key The soap key generated by authenticate() * + * @throws SoapFault * @return void * @access public */ @@ -115,9 +116,12 @@ class CRM_Utils_SoapServer { /** * Authentication wrapper to the UF Class * - * @param string $name Login name - * @param string $pass Password + * @param string $name Login name + * @param string $pass Password * + * @param bool $loadCMSBootstrap + * + * @throws SoapFault * @return string The SOAP Client key * @access public * @static diff --git a/CRM/Utils/Sort.php b/CRM/Utils/Sort.php index 8b251838e6..be88f6c436 100644 --- a/CRM/Utils/Sort.php +++ b/CRM/Utils/Sort.php @@ -116,11 +116,11 @@ class CRM_Utils_Sort { * key names of variable (which should be the same as the column name) * value: ascending or descending * - * @param mixed $vars - assoc array as described above + * @param mixed $vars - assoc array as described above * @param string $defaultSortOrder - order to sort * - * @return void - * @access public + * @return \CRM_Utils_Sort + @access public */ function __construct(&$vars, $defaultSortOrder = NULL) { $this->_vars = array(); @@ -277,6 +277,9 @@ class CRM_Utils_Sort { /** * Universal callback function for sorting by weight * + * @param $a + * @param $b + * * @return array of items sorted by weight * @access public */ diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 7f7afd6e1f..93ff782732 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -53,6 +53,8 @@ class CRM_Utils_String { * * @param name Name of the string * + * @param int $maxLength + * * @return string An equivalent variable name * * @access public @@ -121,7 +123,7 @@ class CRM_Utils_String { * useful while converting file names to class names etc * * @param string $string the input string - * @param char $char the character used to demarcate the componets + * @param \char|string $char $char the character used to demarcate the componets * * @access public * @@ -594,6 +596,8 @@ class CRM_Utils_String { * * @param string $string * @param int $maxLen + * + * @return string */ static function ellipsify($string, $maxLen) { $len = strlen($string); @@ -626,7 +630,10 @@ class CRM_Utils_String { * "admin foo" => array(NULL,"admin foo") * "cms:admin foo" => array("cms", "admin foo") * + * @param $delim * @param string $string e.g. "view all contacts". Syntax: "[prefix:]name" + * @param null $defaultPrefix + * * @return array (0 => string|NULL $prefix, 1 => string $value) */ public static function parsePrefix($delim, $string, $defaultPrefix = NULL) { diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 2892e5602b..546821a252 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -60,7 +60,7 @@ class CRM_Utils_System { * (optional) Whether to include the force GET string (if present). * @param string $path * (optional) The path to use for the new url. - * @param string $absolute + * @param bool|string $absolute * (optional) Whether to return an absolute URL. * * @return string @@ -585,6 +585,13 @@ class CRM_Utils_System { } /** + * @param bool $abort + * @param null $name + * @param null $pass + * @param bool $storeInSession + * @param bool $loadCMSBootstrap + * @param bool $requireKey + * * @return bool */ static function authenticateScript($abort = TRUE, $name = NULL, $pass = NULL, $storeInSession = TRUE, $loadCMSBootstrap = TRUE, $requireKey = TRUE) { @@ -769,6 +776,8 @@ class CRM_Utils_System { /** * @param $title * (optional) + * + * @return mixed|string */ static function memory($title = NULL) { static $pid = NULL; @@ -790,6 +799,7 @@ class CRM_Utils_System { * @param $buffer * @param string $ext * @param bool $output + * @param string $disposition */ static function download($name, $mimeType, &$buffer, $ext = NULL, @@ -934,6 +944,8 @@ class CRM_Utils_System { * The URL to check. * @param bool $addCookie * (optional) + * + * @return mixed */ static function checkURL($url, $addCookie = FALSE) { // make a GET request to $url @@ -978,6 +990,9 @@ class CRM_Utils_System { } /** + * @param $string + * @param bool $encode + * * @return string */ static function formatWikiURL($string, $encode = FALSE) { @@ -996,6 +1011,8 @@ class CRM_Utils_System { /** * @param string $url + * + * @return null|string */ static function urlEncode($url) { $items = parse_url($url); @@ -1248,6 +1265,8 @@ class CRM_Utils_System { * @param string $style * (optional) Style attribute value for HTML link (no effect if $URLonly = false) * + * @param null $resource + * * @return string * URL or link to documentation page, based on provided parameters. * @access public @@ -1573,7 +1592,9 @@ class CRM_Utils_System { * Produce an absolute URL from a possibly-relative URL. * * @param string $url - * @param bool $remoteLanguagePart + * @param bool $removeLanguagePart + * + * @internal param bool $remoteLanguagePart * @return string */ static function absoluteURL($url, $removeLanguagePart = FALSE) { @@ -1618,6 +1639,9 @@ class CRM_Utils_System { * * @param string $url * + * @param bool $addLanguagePart + * @param bool $removeLanguagePart + * * @return string $url, formatted url. */ static function languageNegotiationURL($url, diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index 0a4d508e4b..aeb5411a44 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -116,6 +116,8 @@ abstract class CRM_Utils_System_Base { * Determine the native ID of the CMS user * * @param $username + * + * @throws CRM_Core_Exception * @return int|NULL */ function getUfId($username) { @@ -147,6 +149,9 @@ abstract class CRM_Utils_System_Base { /** * Return default Site Settings + * + * @param $dir + * * @return array array * - $url, (Joomla - non admin url) * - $siteName, diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 3e508e9a41..1f776507db 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -122,6 +122,10 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * @params $errors array array of errors * @params $emailName string field label for the 'email' * + * @param $params + * @param $errors + * @param string $emailName + * * @return void */ static function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { @@ -232,6 +236,8 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * sets the title of the page * * @param string $title + * @param null $pageTitle + * * @paqram string $pageTitle * * @return void @@ -250,8 +256,10 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { /** * Append an additional breadcrumb tag to the existing breadcrumb * - * @param string $title - * @param string $url + * @param $breadCrumbs + * + * @internal param string $title + * @internal param string $url * * @return void * @access public @@ -643,6 +651,8 @@ AND u.status = 1 * @param boolean $loadUser boolean Require CMS user load. * @param boolean $throwError If true, print error on failure and exit. * @param boolean|string $realPath path to script + * + * @return bool */ function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { //take the cms root path. @@ -827,6 +837,9 @@ AND u.status = 1 * * @param string $url * + * @param bool $addLanguagePart + * @param bool $removeLanguagePart + * * @return string $url, formatted url. * @static */ diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 2345de532b..d4345567e3 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -142,6 +142,10 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @params $errors array array of errors * @params $emailName string field label for the 'email' * + * @param $params + * @param $errors + * @param string $emailName + * * @return void */ function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { @@ -206,7 +210,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { } } - /* + /** * Function to get the drupal destination string. When this is passed in the * URL the user will be directed to it after filling in the drupal form * @@ -248,6 +252,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * sets the title of the page * * @param string $title + * @param null $pageTitle + * * @paqram string $pageTitle * * @return void @@ -266,8 +272,10 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { /** * Append an additional breadcrumb tag to the existing breadcrumb * - * @param string $title - * @param string $url + * @param $breadCrumbs + * + * @internal param string $title + * @internal param string $url * * @return void * @access public @@ -497,7 +505,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { return FALSE; } - /* + /** * Load user into session */ function loadUser($username) { @@ -608,6 +616,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * @param boolean $loadUser boolean Require CMS user load. * @param boolean $throwError If true, print error on failure and exit. * @param boolean|string $realPath path to script + * + * @return bool */ function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL) { //take the cms root path. @@ -795,6 +805,9 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { * * @param string $url * + * @param bool $addLanguagePart + * @param bool $removeLanguagePart + * * @return string $url, formatted url. * @static */ diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index 05c8770a52..c7ed488b88 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -91,7 +91,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { return $ufID; } - /* + /** * Change user name in host CMS * * @param integer $ufID User ID in CMS @@ -117,6 +117,10 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @params $errors array array of errors * @params $emailName string field label for the 'email' * + * @param $params + * @param $errors + * @param string $emailName + * * @return void */ function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') { @@ -191,8 +195,10 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Append an additional breadcrumb tag to the existing breadcrumb * - * @param string $title - * @param string $url + * @param $breadCrumbs + * + * @internal param string $title + * @internal param string $url * * @return void * @access public @@ -224,7 +230,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Reset an additional breadcrumb tag to the existing breadcrumb * - * @param string $bc the new breadcrumb to be appended + * @internal param string $bc the new breadcrumb to be appended * * @return void * @access public @@ -236,7 +242,9 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Append a string to the head of the html file * - * @param string $head the new string to be appended + * @param null $string + * + * @internal param string $head the new string to be appended * * @return void * @access public @@ -334,9 +342,10 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @param $htmlize boolean whether to convert to html eqivalant * @param $frontend boolean a gross joomla hack * + * @param bool $forceBackend + * * @return string an HTML string containing a link to the given path. * @access public - * */ function url($path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL, $htmlize = TRUE, @@ -603,12 +612,16 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } } - /* + /** * load joomla bootstrap * * @param $params array with uid or name and password * @param $loadUser boolean load cms user? - * @param $throwError throw error on failure? + * @param bool|\throw $throwError throw error on failure? + * @param null $realPath + * @param bool $loadDefines + * + * @return bool */ function loadBootStrap($params = array(), $loadUser = TRUE, $throwError = TRUE, $realPath = NULL, $loadDefines = TRUE) { // Setup the base path related constant. @@ -647,7 +660,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } jimport('joomla.application.cli'); - + // CRM-14281 Joomla wasn't available during bootstrap, so hook_civicrm_config never executes. $config = CRM_Core_Config::singleton(); CRM_Utils_Hook::config($config); @@ -748,6 +761,9 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Return default Site Settings + * + * @param $dir + * * @return array array * - $url, (Joomla - non admin url) * - $siteName, diff --git a/CRM/Utils/System/Soap.php b/CRM/Utils/System/Soap.php index 89483f3592..ecf3e6ae39 100644 --- a/CRM/Utils/System/Soap.php +++ b/CRM/Utils/System/Soap.php @@ -48,6 +48,8 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * sets the title of the page * * @param string $title title for page + * @param $pageTitle + * * @paqram string $pageTitle * * @return void @@ -191,6 +193,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base { * * @param string $destination - if present, add destination to querystring (works for Drupal only) * + * @throws Exception * @return string - loginURL for the current CMS * @static */ diff --git a/CRM/Utils/System/UnitTests.php b/CRM/Utils/System/UnitTests.php index b7afc8b2c1..4d3bc2b1f2 100644 --- a/CRM/Utils/System/UnitTests.php +++ b/CRM/Utils/System/UnitTests.php @@ -167,6 +167,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * * @param string $destination - if present, add destination to querystring (works for Drupal only) * + * @throws Exception * @return string - loginURL for the current CMS * @static */ diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 9e1c209feb..0573a3786b 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -45,6 +45,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * sets the title of the page * * @param string $title + * @param null $pageTitle + * * @paqram string $pageTitle * * @return void @@ -65,8 +67,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { /** * Append an additional breadcrumb tag to the existing breadcrumb * - * @param string $title - * @param string $url + * @param $breadCrumbs + * + * @internal param string $title + * @internal param string $url * * @return void * @access public @@ -245,9 +249,10 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * @param $htmlize boolean whether to convert to html eqivalant * @param $frontend boolean a gross joomla hack * + * @param bool $forceBackend + * * @return string an HTML string containing a link to the given path. * @access public - * */ function url( $path = NULL, @@ -349,12 +354,15 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { /** * Authenticate the user against the wordpress db * - * @param string $name the user name + * @param string $name the user name * @param string $password the password for the above user name * + * @param bool $loadCMSBootstrap + * @param null $realPath + * * @return mixed false if no auth * array( - contactID, ufID, unique string ) if success + * contactID, ufID, unique string ) if success * @access public * @static */ @@ -435,6 +443,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { * * @param $name string optional username for login * @param $pass string optional password for login + * + * @return bool */ function loadBootStrap($name = NULL, $pass = NULL) { global $wp, $wp_rewrite, $wp_the_query, $wp_query, $wpdb; @@ -528,7 +538,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { return $uid; } - /* + /** * Change user name in host CMS * * @param integer $ufID User ID in CMS diff --git a/CRM/Utils/Tree.php b/CRM/Utils/Tree.php index 9ac14fddc5..d60f73e3bf 100644 --- a/CRM/Utils/Tree.php +++ b/CRM/Utils/Tree.php @@ -88,12 +88,12 @@ class CRM_Utils_Tree { /** * Constructor for the tree. * - * @param string $root + * @param $nodeName + * + * @internal param string $root * * @return CRM_Utils_Tree - * @access public - * */ public function __construct($nodeName) { // create the root node diff --git a/CRM/Utils/Weight.php b/CRM/Utils/Weight.php index 5e16756be1..b1dcfb7940 100644 --- a/CRM/Utils/Weight.php +++ b/CRM/Utils/Weight.php @@ -81,6 +81,7 @@ class CRM_Utils_Weight { * * @param string $daoName full name of the DAO * $param integer $weight the weight to be removed + * @param $fieldID * @param array $fieldValues field => value to be used in the WHERE * @param string $weightField field which contains the weight value, * defaults to 'weight' @@ -255,8 +256,11 @@ class CRM_Utils_Weight { * @param string $daoName full name of the DAO * @param array $fieldValues field => value to be used in the WHERE * @param string $queryData data to be used, dependent on the query type + * @param null $additionalWhere * @param string $orderBy optional ORDER BY field * + * @param null $groupBy + * * @return Object CRM_Core_DAO objet that holds the results of the query */ static function &query($queryType, @@ -457,7 +461,7 @@ class CRM_Utils_Weight { self::fixOrderOutput($url); } - + static function fixOrderOutput($url) { if (empty($_GET['snippet']) || $_GET['snippet'] !== 'json') { CRM_Utils_System::redirect($url); diff --git a/CRM/Utils/XML.php b/CRM/Utils/XML.php index 98e0b5aca1..cdbe2e0cd5 100644 --- a/CRM/Utils/XML.php +++ b/CRM/Utils/XML.php @@ -36,6 +36,8 @@ class CRM_Utils_XML { /** * Read a well-formed XML file * + * @param $file + * * @return array (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE) */ public static function parseFile($file) { @@ -64,6 +66,8 @@ class CRM_Utils_XML { /** * Read a well-formed XML file * + * @param $string + * * @return array (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE) */ public static function parseString($string) { @@ -111,6 +115,8 @@ class CRM_Utils_XML { * Convert an XML element to an array * * @pararm $obj SimpleXMLElement + * @param $obj + * * @return array */ public static function xmlObjToArray($obj) { diff --git a/CRM/Utils/Zip.php b/CRM/Utils/Zip.php index 3fe425b23a..38213520a2 100644 --- a/CRM/Utils/Zip.php +++ b/CRM/Utils/Zip.php @@ -41,6 +41,8 @@ class CRM_Utils_Zip { /** * Given a zip file which contains a single root directory, determine the root's name. * + * @param ZipArchive $zip + * * @return mixed; FALSE if #root level items !=1; otherwise, the name of base dir */ static public function findBaseDirName(ZipArchive $zip) { @@ -69,6 +71,8 @@ class CRM_Utils_Zip { /** * Given a zip file, find all directory names in the root * + * @param ZipArchive $zip + * * @return array(string), no trailing / */ static public function findBaseDirs(ZipArchive $zip) { @@ -89,6 +93,9 @@ class CRM_Utils_Zip { /** * Determine the name of the folder within a zip * + * @param ZipArchive $zip + * @param $expected + * * @return string or FALSE */ static public function guessBasedir(ZipArchive $zip, $expected) { -- 2.25.1