mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°8851 - Explicit nullable in functions parameters
This commit is contained in:
@@ -152,7 +152,7 @@ class DBBackup
|
||||
* @return string Name of the backup file WITHOUT the file extension (eg. `.tar.gz`)
|
||||
* @since 3.1.0 N°5279 Add $oDateTime parameter
|
||||
*/
|
||||
public function MakeName(string $sNameSpec = "__DB__-%Y-%m-%d", DateTime $oDateTime = null)
|
||||
public function MakeName(string $sNameSpec = "__DB__-%Y-%m-%d", ?DateTime $oDateTime = null)
|
||||
{
|
||||
if ($oDateTime === null) {
|
||||
$oDateTime = new DateTime();
|
||||
|
||||
@@ -38,7 +38,7 @@ class DOMFormatException extends Exception
|
||||
* @param $previous
|
||||
* @param DesignElement|null $node DOMNode causing the DOMFormatException
|
||||
*/
|
||||
public function __construct($message, $code = 0, $previous = null, DesignElement $node = null)
|
||||
public function __construct($message, $code = 0, $previous = null, ?DesignElement $node = null)
|
||||
{
|
||||
if ($node !== null) {
|
||||
$message .= ' ('.MFDocument::GetItopNodePath($node).' at line '.$node->getLineNo().')';
|
||||
@@ -930,7 +930,7 @@ EOF
|
||||
*
|
||||
* @since 3.0.0 Add param. $bAddQuotes to be equivalent to {@see self::GetMandatoryPropString} and allow retrieving property without surrounding single quotes
|
||||
*/
|
||||
protected function GetPropString($oNode, string $sTag, string $sDefault = null, bool $bAddQuotes = true)
|
||||
protected function GetPropString($oNode, string $sTag, ?string $sDefault = null, bool $bAddQuotes = true)
|
||||
{
|
||||
$val = $oNode->GetChildText($sTag);
|
||||
if (is_null($val)) {
|
||||
|
||||
@@ -2399,7 +2399,7 @@ class MFDocument extends \Combodo\iTop\DesignDocument
|
||||
*/
|
||||
// Return type union is not supported by PHP 7.4, we can remove the following PHP attribute and add the return type once iTop min PHP version is PHP 8.0+
|
||||
#[\ReturnTypeWillChange]
|
||||
public function saveXML(DOMNode $node = null, $options = 0)
|
||||
public function saveXML(?DOMNode $node = null, $options = 0)
|
||||
{
|
||||
$oRootNode = $this->firstChild;
|
||||
if (!$oRootNode) {
|
||||
|
||||
Reference in New Issue
Block a user