From b7acea0ec4c160cfb11bc44e3e2295bd02155717 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 16:47:38 +0100 Subject: [PATCH] Fix: PhanTypeMismatchDeclaredParamNullable notices # Fix: PhanTypeMismatchDeclaredParamNullable notices PHPDoc must indicate param is nullable if the default is null with explicit typing. (+Improved some other typing from generic Object to CommonObject). --- htdocs/core/lib/bank.lib.php | 13 +++++++------ .../modules/fichinter/doc/pdf_soleil.modules.php | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 75788627cec..ffde1206773 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Ferran Marcet + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,8 +229,8 @@ function account_statement_prepare_head($object, $num) /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs - * @return array Array of tabs to shoc + * @param CommonObject $object Object related to tabs + * @return array Array of tabs to shoc */ function various_payment_prepare_head($object) { @@ -275,8 +276,8 @@ function various_payment_prepare_head($object) /** * Check SWIFT information for a bank account * - * @param Account $account A bank account (used to get BIC/SWIFT) - * @param string $swift Swift value (used to get BIC/SWIFT, param $account non used if provided) + * @param ?Account $account A bank account (used to get BIC/SWIFT) + * @param ?string $swift Swift value (used to get BIC/SWIFT, param $account non used if provided) * @return boolean True if information are valid, false otherwise */ function checkSwiftForAccount(Account $account = null, $swift = null) @@ -296,8 +297,8 @@ function checkSwiftForAccount(Account $account = null, $swift = null) /** * Check IBAN number information for a bank account. * - * @param Account $account A bank account - * @param string $ibantocheck Bank account number (used to get BAN, $account not used if provided) + * @param ?Account $account A bank account + * @param ?string $ibantocheck Bank account number (used to get BAN, $account not used if provided) * @return boolean True if information are valid, false otherwise */ function checkIbanForAccount(Account $account = null, $ibantocheck = null) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 8c2b45055fc..82871ffae52 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -449,7 +450,7 @@ class pdf_soleil extends ModelePDFFicheinter * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array * @param int $hidebottom Hide bottom bar of array - * @param Fichinter $object FichInter Object + * @param ?Fichinter $object FichInter Object * @return void */ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, FichInter $object = null)