diff --git a/core/log.class.inc.php b/core/log.class.inc.php index 0e4962c43..deb434975 100644 --- a/core/log.class.inc.php +++ b/core/log.class.inc.php @@ -691,7 +691,7 @@ abstract class LogAPI static::$m_oMockMetaModelConfig = $oMetaModelConfig; } - public static function Exception(string $sMessage, throwable $oException, string $sChannel = null, array $aContext = []): void + public static function Exception(string $sMessage, throwable $oException, ?string $sChannel = null, array $aContext = []): void { $aErrorLogs = []; $aErrorLogs[] = static::PrepareErrorLog($sMessage, $oException, $aContext); diff --git a/setup/modulediscovery/ModuleFileReaderException.php b/setup/modulediscovery/ModuleFileReaderException.php index 64fef5e7f..50b22c393 100644 --- a/setup/modulediscovery/ModuleFileReaderException.php +++ b/setup/modulediscovery/ModuleFileReaderException.php @@ -14,7 +14,7 @@ class ModuleFileReaderException extends Exception * @param int $iHttpCode * @param Exception|null $oPrevious */ - public function __construct($sMessage, $iHttpCode = 0, Exception $oPrevious = null, $sModuleFile = null) + public function __construct($sMessage, $iHttpCode = 0, ?Exception $oPrevious = null, $sModuleFile = null) { $e = new Exception(""); diff --git a/sources/Application/TwigBase/Controller/Controller.php b/sources/Application/TwigBase/Controller/Controller.php index c562283d7..7c8d87c46 100644 --- a/sources/Application/TwigBase/Controller/Controller.php +++ b/sources/Application/TwigBase/Controller/Controller.php @@ -738,7 +738,7 @@ abstract class Controller extends AbstractController * * @param string $sCode Code of the tab */ - public function AddAjaxTab(string $sCode, string $sURL, bool $bCache = true, string $sLabel = null): void + public function AddAjaxTab(string $sCode, string $sURL, bool $bCache = true, ?string $sLabel = null): void { if (is_null($sLabel)) { $sLabel = Dict::S($sCode); diff --git a/sources/Application/UI/Base/Component/TurboForm/TurboForm.php b/sources/Application/UI/Base/Component/TurboForm/TurboForm.php index 2b7bb563e..d09056508 100644 --- a/sources/Application/UI/Base/Component/TurboForm/TurboForm.php +++ b/sources/Application/UI/Base/Component/TurboForm/TurboForm.php @@ -22,7 +22,7 @@ class TurboForm extends UIContentBlock protected ?string $sAction; private FormView $oFormView; - public function __construct(FormView $oFormView, string $sId = null) + public function __construct(FormView $oFormView, ?string $sId = null) { parent::__construct($sId); $this->oFormView = $oFormView; diff --git a/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php b/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php index 414d28b0c..b5cb49072 100644 --- a/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php +++ b/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php @@ -36,7 +36,7 @@ class TurboFormUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\TurboForm\TurboForm An HTML form in which you can add UIBlocks */ - public static function MakeStandard(FormView $oFormView, string $sAction = null, string $sId = null): TurboForm + public static function MakeStandard(FormView $oFormView, ?string $sAction = null, ?string $sId = null): TurboForm { $oTurboForm = new TurboForm($oFormView, $sId); if (!is_null($sAction)) { @@ -57,7 +57,7 @@ class TurboFormUIBlockFactory extends AbstractUIBlockFactory * @return \Combodo\iTop\Application\UI\Base\Component\TurboForm\TurboForm * @throws \Combodo\iTop\Forms\Block\FormBlockException */ - public static function MakeForDashletConfiguration(string $sDashletId, array $aData = [], string $sId = null): TurboForm + public static function MakeForDashletConfiguration(string $sDashletId, array $aData = [], ?string $sId = null): TurboForm { $oBlockForm = FormBlockService::GetInstance()->GetFormBlockById($sDashletId, 'Dashlet'); $oController = new FormsController(); diff --git a/sources/Application/UI/Base/Component/TurboStream/TurboStream.php b/sources/Application/UI/Base/Component/TurboStream/TurboStream.php index 877c080b5..5a7a310e9 100644 --- a/sources/Application/UI/Base/Component/TurboStream/TurboStream.php +++ b/sources/Application/UI/Base/Component/TurboStream/TurboStream.php @@ -16,7 +16,7 @@ class TurboStream extends UIContentBlock private string $sTarget; private string $sAction; - public function __construct(string $sTarget, string $sAction, string $sId = null) + public function __construct(string $sTarget, string $sAction, ?string $sId = null) { parent::__construct($sId); $this->sTarget = $sTarget; diff --git a/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php b/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php index 84f86b68d..fa8c76fb9 100644 --- a/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php +++ b/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php @@ -31,7 +31,7 @@ class TurboStreamUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks */ - public static function MakeUpdate(string $sTarget, string $sId = null): TurboStream + public static function MakeUpdate(string $sTarget, ?string $sId = null): TurboStream { return new TurboStream($sTarget, 'update', $sId); } @@ -44,7 +44,7 @@ class TurboStreamUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks */ - public static function MakeReplace(string $sTarget, string $sId = null): TurboStream + public static function MakeReplace(string $sTarget, ?string $sId = null): TurboStream { return new TurboStream($sTarget, 'replace', $sId); } @@ -57,7 +57,7 @@ class TurboStreamUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks */ - public static function MakePrepend(string $sTarget, string $sId = null): TurboStream + public static function MakePrepend(string $sTarget, ?string $sId = null): TurboStream { return new TurboStream($sTarget, 'prepend', $sId); } @@ -70,7 +70,7 @@ class TurboStreamUIBlockFactory extends AbstractUIBlockFactory * * @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks */ - public static function MakeAppend(string $sTarget, string $sId = null): TurboStream + public static function MakeAppend(string $sTarget, ?string $sId = null): TurboStream { return new TurboStream($sTarget, 'append', $sId); } diff --git a/sources/Application/WebPage/ErrorPage.php b/sources/Application/WebPage/ErrorPage.php index 0fec50b95..fd902cbc4 100644 --- a/sources/Application/WebPage/ErrorPage.php +++ b/sources/Application/WebPage/ErrorPage.php @@ -51,7 +51,7 @@ class ErrorPage extends NiceWebPage $this->log_warning($sText); } - public function error($sText, \Throwable $oException = null) + public function error($sText, ?\Throwable $oException = null) { $this->add("
$sText
"); if (utils::IsEasterEggAllowed()) { diff --git a/sources/Core/AttributeDefinition/AttributeBlob.php b/sources/Core/AttributeDefinition/AttributeBlob.php index e3bc2bb2f..e8c97d394 100644 --- a/sources/Core/AttributeDefinition/AttributeBlob.php +++ b/sources/Core/AttributeDefinition/AttributeBlob.php @@ -67,12 +67,12 @@ class AttributeBlob extends AttributeDefinition return true; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return new ormDocument('', '', ''); } - public function IsNullAllowed(DBObject $oHostObject = null) + public function IsNullAllowed(?DBObject $oHostObject = null) { return $this->GetOptional("is_null_allowed", false); } diff --git a/sources/Core/AttributeDefinition/AttributeCaseLog.php b/sources/Core/AttributeDefinition/AttributeCaseLog.php index f812d656c..9dadebba5 100644 --- a/sources/Core/AttributeDefinition/AttributeCaseLog.php +++ b/sources/Core/AttributeDefinition/AttributeCaseLog.php @@ -121,7 +121,7 @@ class AttributeCaseLog extends AttributeLongText } } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return new ormCaseLog(); } diff --git a/sources/Core/AttributeDefinition/AttributeClass.php b/sources/Core/AttributeDefinition/AttributeClass.php index b9fd7fb51..93b127044 100644 --- a/sources/Core/AttributeDefinition/AttributeClass.php +++ b/sources/Core/AttributeDefinition/AttributeClass.php @@ -32,7 +32,7 @@ class AttributeClass extends AttributeString parent::__construct($sCode, $aParams); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { $sDefault = parent::GetDefaultValue($oHostObject); if (!$this->IsNullAllowed() && $this->IsNull($sDefault)) { diff --git a/sources/Core/AttributeDefinition/AttributeCustomFields.php b/sources/Core/AttributeDefinition/AttributeCustomFields.php index bdd75746c..6b173d0eb 100644 --- a/sources/Core/AttributeDefinition/AttributeCustomFields.php +++ b/sources/Core/AttributeDefinition/AttributeCustomFields.php @@ -61,7 +61,7 @@ class AttributeCustomFields extends AttributeDefinition return false; } // See ReadValue... - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return new ormCustomFieldsValue($oHostObject, $this->GetCode()); } diff --git a/sources/Core/AttributeDefinition/AttributeDBField.php b/sources/Core/AttributeDefinition/AttributeDBField.php index 23b27b184..81d79b29c 100644 --- a/sources/Core/AttributeDefinition/AttributeDBField.php +++ b/sources/Core/AttributeDefinition/AttributeDBField.php @@ -21,7 +21,7 @@ class AttributeDBField extends AttributeDBFieldVoid return array_merge(parent::ListExpectedParams(), ["default_value", "is_null_allowed"]); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->MakeRealValue($this->Get("default_value"), $oHostObject); } diff --git a/sources/Core/AttributeDefinition/AttributeDBFieldVoid.php b/sources/Core/AttributeDefinition/AttributeDBFieldVoid.php index 5ebac10d0..4a7f08767 100644 --- a/sources/Core/AttributeDefinition/AttributeDBFieldVoid.php +++ b/sources/Core/AttributeDefinition/AttributeDBFieldVoid.php @@ -83,7 +83,7 @@ class AttributeDBFieldVoid extends AttributeDefinition return $this->Get("sql"); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->MakeRealValue("", $oHostObject); } diff --git a/sources/Core/AttributeDefinition/AttributeDashboard.php b/sources/Core/AttributeDefinition/AttributeDashboard.php index b00d9277f..2918a4c91 100644 --- a/sources/Core/AttributeDefinition/AttributeDashboard.php +++ b/sources/Core/AttributeDefinition/AttributeDashboard.php @@ -63,7 +63,7 @@ class AttributeDashboard extends AttributeDefinition return ""; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return null; } diff --git a/sources/Core/AttributeDefinition/AttributeDateTime.php b/sources/Core/AttributeDefinition/AttributeDateTime.php index 535ee854f..82bde38e3 100644 --- a/sources/Core/AttributeDefinition/AttributeDateTime.php +++ b/sources/Core/AttributeDefinition/AttributeDateTime.php @@ -244,7 +244,7 @@ class AttributeDateTime extends AttributeDBField return $iUnixSeconds; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { $sDefaultValue = $this->Get('default_value'); if (utils::IsNotNullOrEmptyString($sDefaultValue)) { diff --git a/sources/Core/AttributeDefinition/AttributeDefinition.php b/sources/Core/AttributeDefinition/AttributeDefinition.php index 76ca7234a..0d4699637 100644 --- a/sources/Core/AttributeDefinition/AttributeDefinition.php +++ b/sources/Core/AttributeDefinition/AttributeDefinition.php @@ -875,7 +875,7 @@ abstract class AttributeDefinition return null; } - abstract public function GetDefaultValue(DBObject $oHostObject = null); + abstract public function GetDefaultValue(?DBObject $oHostObject = null); // // To be overloaded in subclasses diff --git a/sources/Core/AttributeDefinition/AttributeExternalField.php b/sources/Core/AttributeDefinition/AttributeExternalField.php index ae6f2e158..bcdfaff7d 100644 --- a/sources/Core/AttributeDefinition/AttributeExternalField.php +++ b/sources/Core/AttributeDefinition/AttributeExternalField.php @@ -326,7 +326,7 @@ class AttributeExternalField extends AttributeDefinition return $oExtAttDef->GetSQLExpr(); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { $oExtAttDef = $this->GetExtAttDef(); diff --git a/sources/Core/AttributeDefinition/AttributeExternalKey.php b/sources/Core/AttributeDefinition/AttributeExternalKey.php index 10783fffb..77c47bb8d 100644 --- a/sources/Core/AttributeDefinition/AttributeExternalKey.php +++ b/sources/Core/AttributeDefinition/AttributeExternalKey.php @@ -112,7 +112,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid return $this->GetOptional('display_style', 'select'); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return 0; } diff --git a/sources/Core/AttributeDefinition/AttributeFinalClass.php b/sources/Core/AttributeDefinition/AttributeFinalClass.php index 281db08f3..0a0c37f54 100644 --- a/sources/Core/AttributeDefinition/AttributeFinalClass.php +++ b/sources/Core/AttributeDefinition/AttributeFinalClass.php @@ -50,7 +50,7 @@ class AttributeFinalClass extends AttributeString $this->m_sValue = $sValue; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->m_sValue; } diff --git a/sources/Core/AttributeDefinition/AttributeFriendlyName.php b/sources/Core/AttributeDefinition/AttributeFriendlyName.php index de813f54a..dd24db428 100644 --- a/sources/Core/AttributeDefinition/AttributeFriendlyName.php +++ b/sources/Core/AttributeDefinition/AttributeFriendlyName.php @@ -133,7 +133,7 @@ class AttributeFriendlyName extends AttributeDefinition $this->m_sValue = $sValue; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->m_sValue; } diff --git a/sources/Core/AttributeDefinition/AttributeImage.php b/sources/Core/AttributeDefinition/AttributeImage.php index f5e0f97a1..37e2c429b 100644 --- a/sources/Core/AttributeDefinition/AttributeImage.php +++ b/sources/Core/AttributeDefinition/AttributeImage.php @@ -74,7 +74,7 @@ class AttributeImage extends AttributeBlob return $oDoc; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return new ormDocument('', '', ''); } diff --git a/sources/Core/AttributeDefinition/AttributeLinkedSet.php b/sources/Core/AttributeDefinition/AttributeLinkedSet.php index 840c9eaea..e0b99b5a1 100644 --- a/sources/Core/AttributeDefinition/AttributeLinkedSet.php +++ b/sources/Core/AttributeDefinition/AttributeLinkedSet.php @@ -122,7 +122,7 @@ class AttributeLinkedSet extends AttributeDefinition * @throws CoreException * @throws CoreWarning */ - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { if ($oHostObject === null) { return null; diff --git a/sources/Core/AttributeDefinition/AttributeObjectKey.php b/sources/Core/AttributeDefinition/AttributeObjectKey.php index 4c7643f01..122c48909 100644 --- a/sources/Core/AttributeDefinition/AttributeObjectKey.php +++ b/sources/Core/AttributeDefinition/AttributeObjectKey.php @@ -52,7 +52,7 @@ class AttributeObjectKey extends AttributeDBFieldVoid return "INT(11)".($bFullSpec ? " DEFAULT 0" : ""); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return 0; } diff --git a/sources/Core/AttributeDefinition/AttributeObsolescenceFlag.php b/sources/Core/AttributeDefinition/AttributeObsolescenceFlag.php index 8cea14cd6..d976bdd73 100644 --- a/sources/Core/AttributeDefinition/AttributeObsolescenceFlag.php +++ b/sources/Core/AttributeDefinition/AttributeObsolescenceFlag.php @@ -109,7 +109,7 @@ class AttributeObsolescenceFlag extends AttributeBoolean return null; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->MakeRealValue(false, $oHostObject); } diff --git a/sources/Core/AttributeDefinition/AttributeOneWayPassword.php b/sources/Core/AttributeDefinition/AttributeOneWayPassword.php index 288404b77..38e72d716 100644 --- a/sources/Core/AttributeDefinition/AttributeOneWayPassword.php +++ b/sources/Core/AttributeDefinition/AttributeOneWayPassword.php @@ -64,7 +64,7 @@ class AttributeOneWayPassword extends AttributeDefinition implements iAttributeN return true; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return ""; } diff --git a/sources/Core/AttributeDefinition/AttributeRedundancySettings.php b/sources/Core/AttributeDefinition/AttributeRedundancySettings.php index 7778d7b2d..49d8420fc 100644 --- a/sources/Core/AttributeDefinition/AttributeRedundancySettings.php +++ b/sources/Core/AttributeDefinition/AttributeRedundancySettings.php @@ -93,7 +93,7 @@ class AttributeRedundancySettings extends AttributeDBField return 20; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { $sRet = 'disabled'; if ($this->Get('enabled')) { diff --git a/sources/Core/AttributeDefinition/AttributeSet.php b/sources/Core/AttributeDefinition/AttributeSet.php index b485c1278..f70e82d73 100644 --- a/sources/Core/AttributeDefinition/AttributeSet.php +++ b/sources/Core/AttributeDefinition/AttributeSet.php @@ -131,7 +131,7 @@ abstract class AttributeSet extends AttributeDBFieldVoid return true; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return null; } diff --git a/sources/Core/AttributeDefinition/AttributeStopWatch.php b/sources/Core/AttributeDefinition/AttributeStopWatch.php index dfd24141d..9d53ee95c 100644 --- a/sources/Core/AttributeDefinition/AttributeStopWatch.php +++ b/sources/Core/AttributeDefinition/AttributeStopWatch.php @@ -72,7 +72,7 @@ class AttributeStopWatch extends AttributeDefinition return true; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return $this->NewStopWatch(); } diff --git a/sources/Core/AttributeDefinition/AttributeSubItem.php b/sources/Core/AttributeDefinition/AttributeSubItem.php index fa0f18d08..2f9e5f63a 100644 --- a/sources/Core/AttributeDefinition/AttributeSubItem.php +++ b/sources/Core/AttributeDefinition/AttributeSubItem.php @@ -117,7 +117,7 @@ class AttributeSubItem extends AttributeDefinition return false; } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { return null; } diff --git a/sources/Core/AttributeDefinition/AttributeTagSet.php b/sources/Core/AttributeDefinition/AttributeTagSet.php index b547f17c3..1e4ed3c5f 100644 --- a/sources/Core/AttributeDefinition/AttributeTagSet.php +++ b/sources/Core/AttributeDefinition/AttributeTagSet.php @@ -276,7 +276,7 @@ class AttributeTagSet extends AttributeSet return new ormTagSet(MetaModel::GetAttributeOrigin($this->GetHostClass(), $this->GetCode()), $this->GetCode(), $this->GetMaxItems()); } - public function GetDefaultValue(DBObject $oHostObject = null) + public function GetDefaultValue(?DBObject $oHostObject = null) { $oTagSet = new ormTagSet(MetaModel::GetAttributeOrigin($this->GetHostClass(), $this->GetCode()), $this->GetCode(), $this->GetMaxItems()); $oTagSet->SetValues([]); diff --git a/sources/Forms/Block/AbstractFormBlock.php b/sources/Forms/Block/AbstractFormBlock.php index 67ecfd9a3..68fbbc7e0 100644 --- a/sources/Forms/Block/AbstractFormBlock.php +++ b/sources/Forms/Block/AbstractFormBlock.php @@ -253,7 +253,7 @@ abstract class AbstractFormBlock implements IFormBlock * @throws FormBlockIOException * @throws RegisterException */ - public function AddOutput(string $sName, string $sType, bool $bIsArray = false, AbstractConverter $oConverter = null): AbstractFormBlock + public function AddOutput(string $sName, string $sType, bool $bIsArray = false, ?AbstractConverter $oConverter = null): AbstractFormBlock { $this->oIORegister->AddOutput($sName, $sType, $bIsArray, $oConverter); return $this; @@ -413,7 +413,7 @@ abstract class AbstractFormBlock implements IFormBlock * * @return bool */ - public function IsInputsDataReady(string $sType = null): bool + public function IsInputsDataReady(?string $sType = null): bool { return $this->oIORegister->IsInputsDataReady($sType); } diff --git a/sources/Forms/Block/AbstractTypeFormBlock.php b/sources/Forms/Block/AbstractTypeFormBlock.php index 9e85e3686..31ce6a66c 100644 --- a/sources/Forms/Block/AbstractTypeFormBlock.php +++ b/sources/Forms/Block/AbstractTypeFormBlock.php @@ -53,7 +53,7 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock * @return bool * @throws FormBlockException */ - public function IsVisible(string $sEventType = null): bool + public function IsVisible(?string $sEventType = null): bool { $oInput = $this->GetInput(self::INPUT_VISIBLE); if (!$oInput->IsBound()) { @@ -68,7 +68,7 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock /** * @return true */ - public function AllowAdd(string $sEventType = null): bool + public function AllowAdd(?string $sEventType = null): bool { return true; } diff --git a/sources/Forms/Block/FormBlockService.php b/sources/Forms/Block/FormBlockService.php index 0e7430b7b..1c80605ec 100644 --- a/sources/Forms/Block/FormBlockService.php +++ b/sources/Forms/Block/FormBlockService.php @@ -20,12 +20,12 @@ class FormBlockService { private static FormBlockService $oInstance; - protected function __construct(ModelReflection $oModelReflection = null) + protected function __construct(?ModelReflection $oModelReflection = null) { ServiceLocator::GetInstance()->RegisterService('ModelReflection', $oModelReflection ?? new ModelReflectionRuntime()); } - final public static function GetInstance(ModelReflection $oModelReflection = null): FormBlockService + final public static function GetInstance(?ModelReflection $oModelReflection = null): FormBlockService { if (!isset(static::$oInstance)) { static::$oInstance = new FormBlockService($oModelReflection); diff --git a/sources/Forms/FormBuilder/DependencyHandler.php b/sources/Forms/FormBuilder/DependencyHandler.php index 92a16601f..0a3bb6fc4 100644 --- a/sources/Forms/FormBuilder/DependencyHandler.php +++ b/sources/Forms/FormBuilder/DependencyHandler.php @@ -161,7 +161,7 @@ class DependencyHandler * @return void * @throws FormBlockException */ - private function CheckDependencies(FormInterface|FormBuilderInterface $oForm, string $sOutputBlock = null, string $sEventType = null): void + private function CheckDependencies(FormInterface|FormBuilderInterface $oForm, ?string $sOutputBlock = null, ?string $sEventType = null): void { $aImpactedBlocks = $this->aDependentBlocks; if ($sOutputBlock !== null) { diff --git a/sources/Forms/FormBuilder/DependencyMap.php b/sources/Forms/FormBuilder/DependencyMap.php index 836c856f8..4503b593c 100644 --- a/sources/Forms/FormBuilder/DependencyMap.php +++ b/sources/Forms/FormBuilder/DependencyMap.php @@ -171,7 +171,7 @@ class DependencyMap * * @return array|null */ - public function GetBlocksImpactedBy(string $sBlockName, callable $oFilter = null): ?array + public function GetBlocksImpactedBy(string $sBlockName, ?callable $oFilter = null): ?array { if (!array_key_exists($sBlockName, $this->aBlocksImpactedBy)) { return null; diff --git a/sources/Forms/IO/AbstractFormIO.php b/sources/Forms/IO/AbstractFormIO.php index 49d50ae46..4a5ecdc58 100644 --- a/sources/Forms/IO/AbstractFormIO.php +++ b/sources/Forms/IO/AbstractFormIO.php @@ -164,7 +164,7 @@ class AbstractFormIO * * @return mixed */ - public function GetValue(string $sEventType = null): mixed + public function GetValue(?string $sEventType = null): mixed { if ($sEventType === null) { return $this->Value(); @@ -190,7 +190,7 @@ class AbstractFormIO * * @return bool */ - public function HasEventValue(string $sEventType = null): bool + public function HasEventValue(?string $sEventType = null): bool { if ($sEventType === null) { return $this->HasValue(); diff --git a/sources/Forms/IO/FormInput.php b/sources/Forms/IO/FormInput.php index 4bdbe0023..ac05839cf 100644 --- a/sources/Forms/IO/FormInput.php +++ b/sources/Forms/IO/FormInput.php @@ -28,7 +28,7 @@ class FormInput extends AbstractFormIO * * @return bool */ - public function IsEventDataReady(string $sEventType = null): bool + public function IsEventDataReady(?string $sEventType = null): bool { return $this->HasEventValue($sEventType); } diff --git a/sources/Forms/IO/FormOutput.php b/sources/Forms/IO/FormOutput.php index 361ec6929..d8a799772 100644 --- a/sources/Forms/IO/FormOutput.php +++ b/sources/Forms/IO/FormOutput.php @@ -34,7 +34,7 @@ class FormOutput extends AbstractFormIO * * @throws FormBlockIOException */ - public function __construct(string $sName, string $sType, bool $bIsArray = false, AbstractConverter $oConverter = null) + public function __construct(string $sName, string $sType, bool $bIsArray = false, ?AbstractConverter $oConverter = null) { parent::__construct($sName, $sType, $bIsArray); $this->oConverter = $oConverter; diff --git a/sources/Forms/Register/IORegister.php b/sources/Forms/Register/IORegister.php index 4d434ddbc..8caab57cf 100644 --- a/sources/Forms/Register/IORegister.php +++ b/sources/Forms/Register/IORegister.php @@ -135,7 +135,7 @@ class IORegister * @throws FormBlockIOException * @throws RegisterException */ - public function AddOutput(string $sName, string $sType, bool $bIsArray = false, AbstractConverter $oConverter = null): void + public function AddOutput(string $sName, string $sType, bool $bIsArray = false, ?AbstractConverter $oConverter = null): void { $oFormOutput = new FormOutput($sName, $sType, $bIsArray, $oConverter); $oFormOutput->SetOwnerBlock($this->oFormBlock); @@ -349,7 +349,7 @@ class IORegister * * @return bool */ - public function IsInputsDataReady(string $sType = null): bool + public function IsInputsDataReady(?string $sType = null): bool { foreach ($this->aInputs as $oFormInput) { if ($oFormInput->IsBound()) { diff --git a/sources/Forms/Validator/AttributeExist.php b/sources/Forms/Validator/AttributeExist.php index 001f94baf..07f7cbfa8 100644 --- a/sources/Forms/Validator/AttributeExist.php +++ b/sources/Forms/Validator/AttributeExist.php @@ -38,7 +38,7 @@ class AttributeExist extends Constraint * @param array|null $aGroups * @param mixed|null $oPayload */ - public function __construct(string $sOqlPropertyPath = null, string $sFilter = null, array $aOptions = [], ?array $aGroups = null, mixed $oPayload = null) + public function __construct(?string $sOqlPropertyPath = null, ?string $sFilter = null, array $aOptions = [], ?array $aGroups = null, mixed $oPayload = null) { if ($sOqlPropertyPath === null) { throw new InvalidArgumentException('The argument "sOqlPropertyPath" must be set.'); diff --git a/sources/PropertyType/PropertyTypeDesign.php b/sources/PropertyType/PropertyTypeDesign.php index 1b67b88a3..ac9d533b5 100644 --- a/sources/PropertyType/PropertyTypeDesign.php +++ b/sources/PropertyType/PropertyTypeDesign.php @@ -18,7 +18,7 @@ use utils; */ class PropertyTypeDesign extends DesignDocument { - public function __construct(string $sDesignSourceId = null, string $sType = 'Default') + public function __construct(?string $sDesignSourceId = null, string $sType = 'Default') { parent::__construct();