Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(NFC) Correct type hints for bad null default values #22600

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CRM/Bridge/OG/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public static function contactID($ufID) {
}

/**
* @param $source
* @param null $title
* @param string $source
* @param string|null $title
* @param bool $abort
*
* @return null|string
Expand Down
3 changes: 1 addition & 2 deletions CRM/Case/PseudoConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public static function caseStatus($column = 'label', $onlyActive = TRUE, $condit
/**
* Get all the redaction rules.
*
*
* @param null $filter
* @param int $filter
*
* @return array
* array reference of all redaction rules
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@ public static function disableExpiredRelationships() {
*
* @param array $params
* Api input array.
* @param null $direction
* @param string $direction
*
* @return array|void
* @throws \CiviCRM_API3_Exception
Expand Down
8 changes: 3 additions & 5 deletions CRM/Contribute/Import/Parser/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,12 @@ public function formatInput(&$params, &$formatted = []) {
* 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
*/
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static function description($mask) {
*
* @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.
Expand Down Expand Up @@ -311,8 +311,8 @@ public static function formLink(
* 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
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function getTree($usedFor = NULL, $excludeHidden = FALSE) {
* 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) {
Expand Down
11 changes: 7 additions & 4 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1674,8 +1674,7 @@ public function isSuppressSubmitButtons() {
* 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
Expand All @@ -1693,8 +1692,8 @@ protected function checkDupe($invoiceId, $contributionID = NULL) {
/**
* 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
Expand Down Expand Up @@ -1724,6 +1723,10 @@ public function subscriptionURL($entityID = NULL, $entity = NULL, $action = 'can
}
$url = 'civicrm/contribute/updaterecur';
break;

default:
$url = '';
break;
}

$userId = CRM_Core_Session::singleton()->get('userID');
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Payment/PayPalImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public function checkConfig() {
* 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
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static function ufGroup($type = CRM_Core_Permission::VIEW) {

/**
* @param int $type
* @param null $prefix
* @param string $prefix
* @param bool $returnUFGroupIds
*
* @return array|string
Expand Down
4 changes: 1 addition & 3 deletions CRM/Event/Import/Parser/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Logging/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ private function triggersExist() {
* Get trigger info.
*
* @param array $info
* @param null $tableName
* @param string|null $tableName
* @param bool $force
*/
public function triggerInfo(&$info, $tableName = NULL, $force = FALSE) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Profile/Page/Dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion CRM/Profile/Selector/Listings.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function __construct(
* @param bool $map
* @param bool $editLink
* @param bool $ufLink
* @param null $gids
* @param int[]|null $gids
*
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -5221,7 +5221,7 @@ public function selectivelyAddLocationTablesJoinsToFilterQuery() {
*
* @param string $baseTable
* @param string $field
* @param null $tableAlias
* @param string|null $tableAlias
*/
public function setFromBase($baseTable, $field = 'id', $tableAlias = NULL) {
if (!$tableAlias) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public function addressFields($orderBy = FALSE) {
* @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.
*/
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Page/TemplateList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion CRM/Utils/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public static function singleton() {
}

/**
* @param null $connectionTimeout
* @param int|null $connectionTimeout
* seconds; or NULL to use system default
*/
public function __construct($connectionTimeout = NULL) {
$this->connectionTimeout = $connectionTimeout;
Expand Down
2 changes: 1 addition & 1 deletion api/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/eventcart/CRM/Event/Cart/BAO/EventInCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static function part_key($participant) {
}

/**
* @param null $event_cart
* @param CRM_Event_Cart_BAO_Cart|null $event_cart
*/
public function load_associations($event_cart = NULL) {
if ($this->assocations_loaded) {
Expand Down
3 changes: 1 addition & 2 deletions ext/eventcart/CRM/Event/Cart/BAO/MerParticipant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion ext/eventcart/CRM/Event/Cart/Controller/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function summary() {
/**
* @param int $offset
* @param int $rowcount
* @param null $sort
* @param string|null $sort
* @param bool $returnSQL
*
* @return string
Expand All @@ -95,7 +95,7 @@ public function contactIDs($offset = 0, $rowcount = 0, $sort = NULL, $returnSQL
/**
* @param int $offset
* @param int $rowcount
* @param null $sort
* @param string|null $sort
* @param bool $includeContactIDs
* @param bool $justIDs
*
Expand Down
2 changes: 1 addition & 1 deletion install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ public function listErrors() {
}

/**
* @param null $section
* @param string|null $section
*/
public function showTable($section = NULL) {
if ($section) {
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/solr/createSolrJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/solr/createSolrXML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/solr/createSyncJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down