From: Bradley Taylor Date: Sat, 22 Jan 2022 11:48:26 +0000 (+0000) Subject: (NFC) Correct type hints for bad null default values X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5e21e0f3f6906d281e1db9ab041e5fb37a6f0fdd;p=civicrm-core.git (NFC) Correct type hints for bad null default values --- diff --git a/CRM/Bridge/OG/Utils.php b/CRM/Bridge/OG/Utils.php index 5fb44c7d81..a7a5fa1e16 100644 --- a/CRM/Bridge/OG/Utils.php +++ b/CRM/Bridge/OG/Utils.php @@ -99,8 +99,8 @@ class CRM_Bridge_OG_Utils { } /** - * @param $source - * @param null $title + * @param string $source + * @param string|null $title * @param bool $abort * * @return null|string diff --git a/CRM/Case/PseudoConstant.php b/CRM/Case/PseudoConstant.php index f94d74686c..f480d04f11 100644 --- a/CRM/Case/PseudoConstant.php +++ b/CRM/Case/PseudoConstant.php @@ -47,8 +47,7 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant { /** * Get all the redaction rules. * - * - * @param null $filter + * @param int $filter * * @return array * array reference of all redaction rules diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index bb4d2ab503..3294f08471 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -1862,7 +1862,7 @@ AND cc.sort_name LIKE '%$name%'"; * * @param array $params * Api input array. - * @param null $direction + * @param string $direction * * @return array|void * @throws \CiviCRM_API3_Exception diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 2f1e78d81c..01dae94d38 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -607,14 +607,12 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * convert it into the same format that we use in QF and BAO object * * @param array $params - * Associative array of property name/value. - * pairs to insert in new contact. + * Associative array of property name/value + * pairs to insert in new contact. * @param array $values * The reformatted properties that we can use internally. - * ' - * * @param bool $create - * @param null $onDuplicate + * @param int $onDuplicate * * @return array|CRM_Error */ diff --git a/CRM/Core/Action.php b/CRM/Core/Action.php index 2211d6cdb6..fc1dcd7c4a 100644 --- a/CRM/Core/Action.php +++ b/CRM/Core/Action.php @@ -166,7 +166,7 @@ class CRM_Core_Action { * * @param array $links * The set of link items. - * @param int $mask + * @param int|null $mask * The mask to be used. a null mask means all items. * @param array $values * The array of values for parameter substitution in the link items. @@ -311,8 +311,8 @@ class CRM_Core_Action { * The mask to be used. a null mask means all items. * @param array $values * The array of values for parameter substitution in the link items. - * @param null $op - * @param null $objectName + * @param string|null $op + * @param string|null $objectName * @param int $objectId * * @return array|null diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 5ef7ec1231..32c92d5b7a 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -61,7 +61,8 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * Build a nested array from hierarchical tags. * * Supports infinite levels of nesting. - * @param null $usedFor + * + * @param string|null $usedFor * @param bool $excludeHidden */ public function buildTree($usedFor = NULL, $excludeHidden = FALSE) { diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 6b599e0bf3..26a62af3a9 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1674,8 +1674,7 @@ abstract class CRM_Core_Payment { * it is better to standardise to being here. * * @param int $invoiceId The ID to check. - * - * @param null $contributionID + * @param int|null $contributionID * If a contribution exists pass in the contribution ID. * * @return bool @@ -1693,8 +1692,8 @@ abstract class CRM_Core_Payment { /** * Get url for users to manage this recurring contribution for this processor. * - * @param int $entityID - * @param null $entity + * @param int|null $entityID + * @param string|null $entity * @param string $action * * @return string|null @@ -1724,6 +1723,10 @@ abstract class CRM_Core_Payment { } $url = 'civicrm/contribute/updaterecur'; break; + + default: + $url = ''; + break; } $userId = CRM_Core_Session::singleton()->get('userID'); diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index fbec70ca29..6d854859c0 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -695,7 +695,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * Get url for users to manage this recurring contribution for this processor. * * @param int $entityID - * @param null $entity + * @param string|null $entity * @param string $action * * @return string|null diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index bfa8cdd1d2..47b0350d7b 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -335,7 +335,7 @@ class CRM_Core_Permission { /** * @param int $type - * @param null $prefix + * @param string $prefix * @param bool $returnUFGroupIds * * @return array|string diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index e9ce6d6b71..6c9cf49cb9 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -40,10 +40,8 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * Class constructor. * * @param array $mapperKeys - * @param null $mapperLocType - * @param null $mapperPhoneType */ - public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) { + public function __construct(&$mapperKeys) { parent::__construct(); $this->_mapperKeys = &$mapperKeys; } diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index d9a633c77d..a8ef7185ad 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -924,7 +924,7 @@ COLS; * Get trigger info. * * @param array $info - * @param null $tableName + * @param string|null $tableName * @param bool $force */ public function triggerInfo(&$info, $tableName = NULL, $force = FALSE) { diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php index 10f4037c25..fe01add149 100644 --- a/CRM/Profile/Page/Dynamic.php +++ b/CRM/Profile/Page/Dynamic.php @@ -104,7 +104,7 @@ class CRM_Profile_Page_Dynamic extends CRM_Core_Page { * * @param $restrict * @param bool $skipPermission - * @param null $profileIds + * @param int[]|null $profileIds * * @param bool $isShowEmailTaskLink * diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index 72cad9e97d..6aefb13117 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -181,7 +181,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @param bool $map * @param bool $editLink * @param bool $ufLink - * @param null $gids + * @param int[]|null $gids * * @return array */ diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 4341726fb6..21b1355ad5 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -5221,7 +5221,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a * * @param string $baseTable * @param string $field - * @param null $tableAlias + * @param string|null $tableAlias */ public function setFromBase($baseTable, $field = 'id', $tableAlias = NULL) { if (!$tableAlias) { diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index 8a20197049..d91c95e010 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -397,7 +397,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { * @todo get rid of $recordType param. It's only because 3 separate contact tables * are mis-declared as one that we need it. * - * @param null $recordType deprecated + * @param string $recordType deprecated * Parameter to hack around the bad decision made in construct to misrepresent * different tables as the same table. */ diff --git a/CRM/Report/Page/TemplateList.php b/CRM/Report/Page/TemplateList.php index 289b817598..eb24cafac1 100644 --- a/CRM/Report/Page/TemplateList.php +++ b/CRM/Report/Page/TemplateList.php @@ -22,7 +22,7 @@ class CRM_Report_Page_TemplateList extends CRM_Core_Page { /** * @param int $compID - * @param null $grouping + * @param string|null $grouping * * @return array */ diff --git a/CRM/Utils/HttpClient.php b/CRM/Utils/HttpClient.php index 0286c4f793..3a34e18970 100644 --- a/CRM/Utils/HttpClient.php +++ b/CRM/Utils/HttpClient.php @@ -48,7 +48,8 @@ class CRM_Utils_HttpClient { } /** - * @param null $connectionTimeout + * @param int|null $connectionTimeout + * seconds; or NULL to use system default */ public function __construct($connectionTimeout = NULL) { $this->connectionTimeout = $connectionTimeout; diff --git a/api/api.php b/api/api.php index b8aeec4e0d..2a857a1db1 100644 --- a/api/api.php +++ b/api/api.php @@ -180,7 +180,7 @@ function _civicrm_api3_api_getfields(&$apiRequest) { * 'format.is_success' => 1 * will result in a boolean success /fail being returned if that is what you need. * - * @param $result + * @param mixed $result * * @return bool * true if error, false otherwise diff --git a/ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php b/ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php index 82c144e118..97cc92d256 100644 --- a/ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php +++ b/ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php @@ -157,7 +157,7 @@ class CRM_Event_Cart_BAO_EventInCart extends CRM_Event_Cart_DAO_EventInCart impl } /** - * @param null $event_cart + * @param CRM_Event_Cart_BAO_Cart|null $event_cart */ public function load_associations($event_cart = NULL) { if ($this->assocations_loaded) { diff --git a/ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php b/ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php index 4cdf4e341b..c1324e2d9b 100644 --- a/ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php +++ b/ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php @@ -30,8 +30,7 @@ class CRM_Event_Cart_BAO_MerParticipant extends CRM_Event_BAO_Participant { public $cart = NULL; /** - * XXX. - * @param null $participant + * @param array $participant */ public function __construct($participant = NULL) { parent::__construct(); diff --git a/ext/eventcart/CRM/Event/Cart/Controller/Checkout.php b/ext/eventcart/CRM/Event/Cart/Controller/Checkout.php index a00044bdda..10ccc2c407 100644 --- a/ext/eventcart/CRM/Event/Cart/Controller/Checkout.php +++ b/ext/eventcart/CRM/Event/Cart/Controller/Checkout.php @@ -6,7 +6,7 @@ class CRM_Event_Cart_Controller_Checkout extends CRM_Core_Controller { /** - * @param null $title + * @param string $title * @param bool|int $action * @param bool $modal */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php index 70bc6b8f19..775dada57b 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php @@ -83,7 +83,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust /** * @param int $offset * @param int $rowcount - * @param null $sort + * @param string|null $sort * @param bool $returnSQL * * @return string @@ -95,7 +95,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust /** * @param int $offset * @param int $rowcount - * @param null $sort + * @param string|null $sort * @param bool $includeContactIDs * @param bool $justIDs * diff --git a/install/index.php b/install/index.php index a56b5289c6..0c6b62c2c9 100644 --- a/install/index.php +++ b/install/index.php @@ -839,7 +839,7 @@ class InstallRequirements { } /** - * @param null $section + * @param string|null $section */ public function showTable($section = NULL) { if ($section) { diff --git a/tools/scripts/solr/createSolrJSON.php b/tools/scripts/solr/createSolrJSON.php index a836ec00da..54b37c1f0d 100644 --- a/tools/scripts/solr/createSolrJSON.php +++ b/tools/scripts/solr/createSolrJSON.php @@ -133,7 +133,7 @@ function getValues(&$contactIDs, &$values) { * @param $tableName * @param $fields * @param $whereField - * @param null $additionalWhereCond + * @param string|null $additionalWhereCond */ function getTableInfo(&$contactIDs, &$values, $tableName, &$fields, $whereField, $additionalWhereCond = NULL) { $selectString = implode(',', array_keys($fields)); diff --git a/tools/scripts/solr/createSolrXML.php b/tools/scripts/solr/createSolrXML.php index c98d064aab..d3399513eb 100644 --- a/tools/scripts/solr/createSolrXML.php +++ b/tools/scripts/solr/createSolrXML.php @@ -106,7 +106,7 @@ function getValues(&$contactIDs, &$values) { * @param $tableName * @param $fields * @param $whereField - * @param null $additionalWhereCond + * @param string|null $additionalWhereCond */ function getTableInfo(&$contactIDs, &$values, $tableName, &$fields, $whereField, $additionalWhereCond = NULL) { $selectString = implode(',', array_keys($fields)); diff --git a/tools/scripts/solr/createSyncJSON.php b/tools/scripts/solr/createSyncJSON.php index cb7c6172c9..e5a101f516 100644 --- a/tools/scripts/solr/createSyncJSON.php +++ b/tools/scripts/solr/createSyncJSON.php @@ -84,7 +84,7 @@ function getValues(&$contactIDs, &$values, &$allContactIDs, &$addditionalContact * @param $tableName * @param $fields * @param $whereField - * @param null $additionalWhereCond + * @param string|null $additionalWhereCond * @param bool $flat */ function getTableInfo(&$contactIDs, &$values, $tableName, &$fields,