diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index a1ffab79e12e..a02fb38a7cd6 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -33,7 +33,7 @@ class CRM_ACL_API { * * @param string $str * The permission to check. - * @param int $contactID + * @param int|null $contactID * The contactID for whom the check is made. * * @return bool @@ -64,7 +64,7 @@ public static function check($str, $contactID = NULL) { * (reference ) add the tables that are needed for the select clause. * @param array $whereTables * (reference ) add the tables that are needed for the where clause. - * @param int $contactID + * @param int|null $contactID * The contactID for whom the check is made. * @param bool $onlyDeleted * Whether to include only deleted contacts. @@ -135,12 +135,12 @@ public static function whereClause( * * @param int $type * The type of permission needed. - * @param int $contactID + * @param int|null $contactID * The contactID for whom the check is made. * * @param string $tableName - * @param null $allGroups - * @param null $includedGroups + * @param array|null $allGroups + * @param array|null $includedGroups * * @return array * the ids of the groups for which the user has permissions @@ -165,11 +165,11 @@ public static function group( * @param int $type * The type of permission needed. * @param int $groupID - * @param int $contactID + * @param int|null $contactID * The contactID for whom the check is made. * @param string $tableName - * @param null $allGroups - * @param null $includedGroups + * @param array|null $allGroups + * @param array|null $includedGroups * * @return bool */ diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 82aaf8dabcbf..17d1f313832b 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -83,7 +83,7 @@ protected static function getGroupACLRoles(int $contact_id) { /** * Get all ACLs owned by a given contact, including domain and group-level. * - * @param int|null $contact_id + * @param int $contact_id * The contact ID. * * @return array @@ -185,7 +185,7 @@ public static function setIsActive($id, $is_active) { } /** - * @param $str + * @param string $str * @param int $contactID * * @return bool @@ -219,9 +219,9 @@ public static function check($str, $contactID) { } /** - * @param $type - * @param $tables - * @param $whereTables + * @param int $type + * @param array $tables + * @param array $whereTables * @param int $contactID * * @return null|string @@ -314,8 +314,8 @@ public static function whereClause($type, &$tables, &$whereTables, $contactID = * @param int $type * @param int $contactID * @param string $tableName - * @param null $allGroups - * @param null $includedGroups + * @param array|null $allGroups + * @param array|null $includedGroups * * @return array */ @@ -385,7 +385,7 @@ public static function group( /** * @param int $type - * @param $operation + * @param string $operation * * @return bool */ @@ -456,7 +456,7 @@ public static function self_hook_civicrm_pre(\Civi\Core\Event\PreEvent $event) { * @param int $contactID * @param string $tableName * @param int $type - * @param $allGroups + * @param array $allGroups * * @return array */ diff --git a/CRM/Activity/BAO/ActivityType.php b/CRM/Activity/BAO/ActivityType.php index 3a27f8275afa..ba6f1ee3f214 100644 --- a/CRM/Activity/BAO/ActivityType.php +++ b/CRM/Activity/BAO/ActivityType.php @@ -37,7 +37,7 @@ class CRM_Activity_BAO_ActivityType { /** * Constructor * - * @param $activity_type_id int This matches up to the option_value 'value' column in the database. + * @param int $activity_type_id This matches up to the option_value 'value' column in the database. */ public function __construct($activity_type_id) { $this->setActivityType($activity_type_id); @@ -57,7 +57,7 @@ public function getActivityType() { * Look up the key/value pair representing this activity type from the id. * Generally called from constructor. * - * @param $activity_type_id int This matches up to the option_value 'value' column in the database. + * @param int $activity_type_id This matches up to the option_value 'value' column in the database. */ public function setActivityType($activity_type_id) { if ($activity_type_id && is_numeric($activity_type_id)) { diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index c7b5989c3138..e7d06df6689a 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -30,7 +30,7 @@ class CRM_Admin_Form extends CRM_Core_Form { /** * The default values for form fields. * - * @var int + * @var array */ protected $_values; diff --git a/CRM/Admin/Form/Extensions.php b/CRM/Admin/Form/Extensions.php index 7ee7df2f91a2..83fba1bdcb3e 100644 --- a/CRM/Admin/Form/Extensions.php +++ b/CRM/Admin/Form/Extensions.php @@ -151,7 +151,7 @@ public function buildQuickForm() { * The input form values. * @param array $files * The uploaded files if any. - * @param array $self + * @param self $self * This object. * * @return bool|array diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index 076fcf3742ca..09c9f9e32cfc 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -244,7 +244,7 @@ private function checkUserPermission($workflowId) { * The input form values. * @param array $files * The uploaded files if any. - * @param array $self + * @param self $self * * @return array * array of errors diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index dc9fe0576810..4afd0fbf706f 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -342,7 +342,7 @@ public function buildQuickForm() { * The input form values. * @param array $files * The uploaded files if any. - * @param array $self + * @param self $self * Current form object. * * @return array diff --git a/CRM/Admin/Form/PaymentProcessor.php b/CRM/Admin/Form/PaymentProcessor.php index 8686d886b41f..59cdafb0c449 100644 --- a/CRM/Admin/Form/PaymentProcessor.php +++ b/CRM/Admin/Form/PaymentProcessor.php @@ -295,8 +295,8 @@ public static function formRule($fields) { } /** - * @param $fields - * @param $errors + * @param array $fields + * @param array $errors * @param null $section * * @return bool diff --git a/CRM/Admin/Form/Setting/Localization.php b/CRM/Admin/Form/Setting/Localization.php index 5cd32ae5515f..17a4843f22e0 100644 --- a/CRM/Admin/Form/Setting/Localization.php +++ b/CRM/Admin/Form/Setting/Localization.php @@ -230,8 +230,8 @@ public function postProcess() { /** * Replace available currencies by the ones provided * - * @param $currencies array of currencies ['USD', 'CAD'] - * @param $default default currency + * @param string[] $currencies array of currencies ['USD', 'CAD'] + * @param string $default default currency */ public static function updateEnabledCurrencies($currencies, $default) { @@ -339,7 +339,7 @@ public static function onChangeDefaultCurrency($oldCurrency, $newCurrency, $meta $currencies = array_keys(CRM_Core_OptionGroup::values('currencies_enabled')); if (!in_array($newCurrency, $currencies)) { if (empty($currencies)) { - $currencies = [$values['defaultCurrency']]; + $currencies = [$newCurrency]; } else { $currencies[] = $newCurrency; diff --git a/CRM/Admin/Form/Setting/Mail.php b/CRM/Admin/Form/Setting/Mail.php index 4bfe45d35aa8..4b49514c34a4 100644 --- a/CRM/Admin/Form/Setting/Mail.php +++ b/CRM/Admin/Form/Setting/Mail.php @@ -41,7 +41,7 @@ public function buildQuickForm() { } /** - * @param $fields + * @param array $fields * * @return array|bool */ diff --git a/CRM/Badge/BAO/Layout.php b/CRM/Badge/BAO/Layout.php index 708be575027c..2c0780e89e29 100644 --- a/CRM/Badge/BAO/Layout.php +++ b/CRM/Badge/BAO/Layout.php @@ -145,7 +145,7 @@ public static function buildLayout(&$params) { /** * Decode encoded data and return as an array. * - * @param json $jsonData + * @param string $jsonData * Json object. * * @return array diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 2fde9f3ec466..b05fce5c9611 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -549,8 +549,8 @@ public static function voterActivityDetails($surveyId, $voterIds, $interviewerId * @param array $voterIds * @param bool $onlyCount * - * @return array - * An array of survey activity. + * @return array|int + * An array of survey activity, or an int if $onlyCount is set to TRUE */ public static function getSurveyActivities( $surveyId, diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 9e8aceb4966b..37aaf8c82e88 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -233,7 +233,7 @@ public static function add(&$params) { * @param bool $skipDelete * Unclear parameter, passed to website create * - * @return CRM_Contact_BAO_Contact|CRM_Core_Error + * @return CRM_Contact_BAO_Contact|CRM_Core_Error|NULL * Created or updated contribution object. We are deprecating returning an error in * favour of exceptions * @@ -550,7 +550,7 @@ public static function ensureGreetingParamsAreSet(&$params) { * @param bool $includeTypeInReturnParameters * Should type be part of the returned array? * - * @return array + * @return array|null * the displayName and contactImage for this contact */ public static function getDisplayAndImage($id, $includeTypeInReturnParameters = FALSE) { @@ -1840,16 +1840,16 @@ public static function &makeHierReturnProperties($fields, $contactId = NULL) { * * $params int $contactId contact_id * $params boolean $isPrimaryExist if true, return primary contact location type otherwise null - * $params boolean $skipDefaultPriamry if true, return primary contact location type otherwise null + * $params boolean $skipDefaultPrimary if true, return primary contact location type otherwise null * * @param int $contactId - * @param bool $skipDefaultPriamry + * @param bool $skipDefaultPrimary * @param null $block * - * @return int + * @return int|NULL * $locationType location_type_id */ - public static function getPrimaryLocationType($contactId, $skipDefaultPriamry = FALSE, $block = NULL) { + public static function getPrimaryLocationType($contactId, $skipDefaultPrimary = FALSE, $block = NULL) { if ($block) { $entityBlock = ['contact_id' => $contactId]; $blocks = CRM_Core_BAO_Location::getValues($entityBlock); @@ -1891,7 +1891,7 @@ public static function getPrimaryLocationType($contactId, $skipDefaultPriamry = if (isset($locationType)) { return $locationType; } - elseif ($skipDefaultPriamry) { + elseif ($skipDefaultPrimary) { // if there is no primary contact location then return null return NULL; } @@ -2765,7 +2765,7 @@ public static function getCountComponent($component, $contactId, $tableName = NU $tableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $custom['1'], 'table_name'); } $queryString = "SELECT count(id) FROM {$tableName} WHERE entity_id = {$contactId}"; - return CRM_Core_DAO::singleValueQuery($queryString); + return (int) CRM_Core_DAO::singleValueQuery($queryString); } } } @@ -3633,7 +3633,7 @@ public static function isFieldHasLocationType($fieldTitle) { * @param array $appendProfiles * Name of profile(s) to append to each link. * - * @return array + * @return array|false */ public static function getEntityRefCreateLinks($appendProfiles = []) { // You'd think that "create contacts" would be the permission to check, diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 6b2d129dc6fc..e93df1d595c2 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -139,8 +139,8 @@ public static function checkContactType(&$contactIds) { * @param string $entityType * @param null $hashSize * - * @return array - * ( $cs, $ts, $live ) + * @return string + * (Underscore separated: $cs, $ts, $live ) * @throws \CRM_Core_Exception */ public static function generateChecksum($entityId, $ts = NULL, $live = NULL, $hash = NULL, $entityType = 'contact', $hashSize = NULL) { @@ -402,7 +402,7 @@ private static function currentEmployerRelatedMembership($contactID, $employerID } } - //need to handle related meberships. CRM-3792 + //need to handle related memberships. CRM-3792 if ($previousEmpID != $employerID) { CRM_Contact_BAO_Relationship::relatedMemberships($contactID, $relationshipParams, $ids, $action); } @@ -455,7 +455,7 @@ public static function clearCurrentEmployer($contactId, $employerId = NULL) { $dao = CRM_Core_DAO::executeQuery($query); - // need to handle related meberships. CRM-3792 + // need to handle related memberships. CRM-3792 if ($employerId) { //1. disable corresponding relationship. //2. delete related membership. diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 09281671fc6d..d9ba6df7b8ea 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4948,7 +4948,7 @@ public static function getGroupByFromSelectColumns($selectClauses, $groupBy = NU * * @param bool $skipOrderAndLimit * - * @return CRM_Core_DAO + * @return string|null|CRM_Core_DAO */ public function searchQuery( $offset = 0, $rowCount = 0, $sort = NULL, diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index 3f12db81402d..c2c9b7b8e340 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -163,7 +163,7 @@ public function buildQuickForm() { * The input form values. * @param array $files * The uploaded files if any. - * @param object $self + * @param self $self * Form object. * * @return bool|array diff --git a/CRM/Contact/Form/Task/SMSCommon.php b/CRM/Contact/Form/Task/SMSCommon.php index e4604aa6d92b..5c9b2b90dc91 100644 --- a/CRM/Contact/Form/Task/SMSCommon.php +++ b/CRM/Contact/Form/Task/SMSCommon.php @@ -274,7 +274,7 @@ public static function buildQuickForm(&$form) { * @param array $fields * The input form values. * @param array $dontCare - * @param array $self + * @param self $self * Additional values form 'this'. * * @return bool|array diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 745b42ca1bd1..3e4dcba6d2d1 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -124,7 +124,7 @@ class CRM_Core_DAO extends DB_DataObject { /** * Class constructor. * - * @return \CRM_Core_DAO + * @return static */ public function __construct() { $this->initialize(); diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index 3efdac401b2d..fb8a01974a9e 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -226,7 +226,7 @@ public function react(IDS_Report $result) { /** * This function writes an entry about the intrusion to the database. * - * @param array $result + * @param IDS_Report $result * @param int $reaction * * @return bool diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index 38bfdb35d731..ab05516edf48 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -17,7 +17,7 @@ /** * This implements the profile page for all contacts. It uses a selector - * object to do the actual dispay. The fields displayd are controlled by + * object to do the actual display. The fields displayed are controlled by * the admin. */ class CRM_Profile_Page_Listings extends CRM_Core_Page { diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 78ba43e17b3c..48dd35a9fc11 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1115,7 +1115,7 @@ public function setDefaultValues($freeze = TRUE) { * @param string $group * @param string $grpFieldName * - * @return bool + * @return object|bool */ public function getElementFromGroup($group, $grpFieldName) { $eleObj = $this->getElement($group); @@ -2224,7 +2224,7 @@ public function whereClause(&$field, $op, $value, $min, $max) { /** * Get SQL where clause for contact subtypes - * @param string $field + * @param array $field Field specifications * @param mixed $value * @param string $op SQL Operator * diff --git a/CRM/SMS/Provider.php b/CRM/SMS/Provider.php index 896302ea13ee..c1f740b5b2c1 100644 --- a/CRM/SMS/Provider.php +++ b/CRM/SMS/Provider.php @@ -88,7 +88,7 @@ abstract public function send($recipients, $header, $message, $dncID = NULL); * * Child class could override this function to have better control over the message being sent. * - * @param string $message + * @param Mail_mime $message * @param int $contactID * @param array $contactDetails * diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index a270ae03edec..07d0c30e8f47 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -326,7 +326,7 @@ public function setDefaultValues() { * The input form values. * @param array $files * The uploaded files if any. - * @param array $self + * @param self $self * Current form object. * * @return bool|array diff --git a/CRM/Upgrade/Incremental/php/FiveTwenty.php b/CRM/Upgrade/Incremental/php/FiveTwenty.php index df77f052c8a1..d6369f0713ec 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwenty.php +++ b/CRM/Upgrade/Incremental/php/FiveTwenty.php @@ -118,8 +118,8 @@ public static function changeCaseTypeAutoassignee() { /** * Process a single case type * - * @param $caseTypeId int - * @param $definition string + * @param int $caseTypeId + * @param string $definition * xml string */ public static function processCaseTypeAutoassignee($caseTypeId, $definition) { @@ -213,9 +213,9 @@ public static function _changeCaseTypeLabelToName($isDryRun = FALSE) { /** * Process a single case type for _changeCaseTypeLabelToName() * - * @param $isDryRun bool + * @param bool $isDryRun * If TRUE then don't actually change anything just report warnings. - * @param $caseTypeId int + * @param int $caseTypeId */ private static function _processCaseTypeLabelName($isDryRun, $caseTypeId) { $messages = []; diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index d2a7bab78daa..8248f671c7b2 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -913,7 +913,7 @@ public static function getFromTo($relative, $from = NULL, $to = NULL, $fromTime * @param date $targetDate * Target Date. (show age on specific date) * - * @return int + * @return array * array $results contains years or months */ public static function calculateAge($birthDate, $targetDate = NULL) { diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 03c7c26d1c0d..0604758d1a75 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -48,7 +48,7 @@ public function __construct() { * @param string $var * The string to be echoed. * - * @return string + * @return array */ public static function ping($var = NULL) { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 6d84ad5ec47f..4e63ec01035c 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -261,10 +261,10 @@ public static function domain($domain) { } /** - * @param $value + * @param string $value * @param null $default * - * @return null + * @return string|null */ public static function date($value, $default = NULL) { if (is_string($value) && @@ -276,10 +276,10 @@ public static function date($value, $default = NULL) { } /** - * @param $value + * @param string $value * @param null $default * - * @return null|string + * @return string|null */ public static function dateTime($value, $default = NULL) { $result = $default; diff --git a/CRM/Utils/Zip.php b/CRM/Utils/Zip.php index a7dd2440722b..0337bd9b9d5a 100644 --- a/CRM/Utils/Zip.php +++ b/CRM/Utils/Zip.php @@ -80,7 +80,7 @@ public static function findBaseDirs(ZipArchive $zip) { * Determine the name of the folder within a zip. * * @param ZipArchive $zip - * @param $expected + * @param string $expected * * @return string|bool * Return string or FALSE diff --git a/api/api.php b/api/api.php index 9ed9747dd0ca..b8aeec4e0dc6 100644 --- a/api/api.php +++ b/api/api.php @@ -125,7 +125,8 @@ function civicrm_api4(string $entity, string $action, array $params = [], $index * * @throws CiviCRM_API3_Exception * - * @return array + * @return array|int + * Dependant on the $action */ function civicrm_api3(string $entity, string $action, array $params = []) { $params['version'] = 3;