diff --git a/sources/Forms/Block/IO/FormBinding.php b/sources/Forms/Block/IO/FormBinding.php index 8664b8657..15e348881 100644 --- a/sources/Forms/Block/IO/FormBinding.php +++ b/sources/Forms/Block/IO/FormBinding.php @@ -11,12 +11,17 @@ namespace Combodo\iTop\Forms\Block\IO; */ class FormBinding { + public readonly AbstractFormIO $oSourceIO; + public readonly AbstractFormIO $oDestinationIO; + /** * @param AbstractFormIO $oSourceIO * @param AbstractFormIO $oDestinationIO */ - public function __construct(public readonly AbstractFormIO $oSourceIO, public readonly AbstractFormIO $oDestinationIO) + public function __construct(AbstractFormIO $oSourceIO, AbstractFormIO $oDestinationIO) { + $this->oDestinationIO = $oDestinationIO; + $this->oSourceIO = $oSourceIO; } diff --git a/sources/Forms/Block/IO/Format/AttributeIOFormat.php b/sources/Forms/Block/IO/Format/AttributeIOFormat.php index c62a342b5..2e16d42a8 100644 --- a/sources/Forms/Block/IO/Format/AttributeIOFormat.php +++ b/sources/Forms/Block/IO/Format/AttributeIOFormat.php @@ -6,8 +6,11 @@ use JsonSerializable; class AttributeIOFormat implements JsonSerializable { - public function __construct(public string $sAttributeName) + public string $sAttributeName; + + public function __construct(string $sAttributeName) { + $this->sAttributeName = $sAttributeName; // validation du format sinon exception } diff --git a/sources/Forms/Block/IO/Format/ClassIOFormat.php b/sources/Forms/Block/IO/Format/ClassIOFormat.php index f8d9b64bf..ceedbf5ea 100644 --- a/sources/Forms/Block/IO/Format/ClassIOFormat.php +++ b/sources/Forms/Block/IO/Format/ClassIOFormat.php @@ -6,8 +6,11 @@ use JsonSerializable; class ClassIOFormat implements JsonSerializable { - public function __construct(public string $sClassName) + public string $sClassName; + + public function __construct(string $sClassName) { + $this->sClassName = $sClassName; // validation du format sinon exception } diff --git a/sources/Forms/Block/IO/Format/RawFormat.php b/sources/Forms/Block/IO/Format/RawFormat.php index 04ab08f97..ec8e3895e 100644 --- a/sources/Forms/Block/IO/Format/RawFormat.php +++ b/sources/Forms/Block/IO/Format/RawFormat.php @@ -4,8 +4,11 @@ namespace Combodo\iTop\Forms\Block\IO\Format; class RawFormat { - public function __construct(public string $oValue) + public string $oValue; + + public function __construct(string $oValue) { + $this->oValue = $oValue; // validation du format sinon exception } diff --git a/sources/Forms/FormBuilder/DependencyHandler.php b/sources/Forms/FormBuilder/DependencyHandler.php index 3bc70b537..0b17af973 100644 --- a/sources/Forms/FormBuilder/DependencyHandler.php +++ b/sources/Forms/FormBuilder/DependencyHandler.php @@ -27,6 +27,11 @@ class DependencyHandler /** @var array Debug data */ private array $aDebugData = []; + private readonly string $sName; + private readonly AbstractFormBlock $oFormBlock; + private readonly FormBuilder $oFormBuilder; + private readonly array $aSubBlocks; + private readonly array $aDependentBlocks; /** * Constructor. @@ -37,8 +42,13 @@ class DependencyHandler * @param array $aSubBlocks Sub blocks * @param array $aDependentBlocks Dependants blocks */ - public function __construct(private readonly string $sName, private readonly AbstractFormBlock $oFormBlock, private readonly FormBuilder $oFormBuilder, private readonly array $aSubBlocks, private readonly array $aDependentBlocks) + public function __construct(string $sName, AbstractFormBlock $oFormBlock, FormBuilder $oFormBuilder, array $aSubBlocks, array $aDependentBlocks) { + $this->aDependentBlocks = $aDependentBlocks; + $this->aSubBlocks = $aSubBlocks; + $this->oFormBuilder = $oFormBuilder; + $this->oFormBlock = $oFormBlock; + $this->sName = $sName; // dependencies map $this->oDependenciesMap = new DependencyMap($aDependentBlocks); diff --git a/sources/Forms/FormBuilder/DependencyMap.php b/sources/Forms/FormBuilder/DependencyMap.php index a5b9e43d5..783bc71d3 100644 --- a/sources/Forms/FormBuilder/DependencyMap.php +++ b/sources/Forms/FormBuilder/DependencyMap.php @@ -25,14 +25,16 @@ class DependencyMap /** @var array output to outputs */ private array $aOutputToOutputsMap = []; + private readonly array $aDependentBlocks; /** * Constructor. * * @param array $aDependentBlocks */ - public function __construct(private readonly array $aDependentBlocks) + public function __construct(array $aDependentBlocks) { + $this->aDependentBlocks = $aDependentBlocks; // Initialization $this->Init(); } diff --git a/sources/Forms/FormBuilder/FormBuilder.php b/sources/Forms/FormBuilder/FormBuilder.php index 148009e3d..c0af3050d 100644 --- a/sources/Forms/FormBuilder/FormBuilder.php +++ b/sources/Forms/FormBuilder/FormBuilder.php @@ -32,6 +32,7 @@ class FormBuilder implements FormBuilderInterface, \IteratorAggregate /** @var array sub blocks */ private array $aSubFormBlocks = []; + private readonly FormBuilderInterface $builder; /** * Constructor. @@ -39,8 +40,9 @@ class FormBuilder implements FormBuilderInterface, \IteratorAggregate * @param FormBuilderInterface $builder * */ - public function __construct(private readonly FormBuilderInterface $builder) + public function __construct(FormBuilderInterface $builder) { + $this->builder = $builder; /** Get the corresponding form block @var AbstractFormBlock $oFormBlock */ $oFormBlock = $this->builder->getOption('form_block');