From 12ff9846fa684137318a77797d3d72502921d0a0 Mon Sep 17 00:00:00 2001 From: wietse Date: Wed, 4 Dec 2024 11:53:18 +0100 Subject: [PATCH 1/3] feat: stub DataMapperInterface Ensure TData of FormInterface is provided Set TData on mixed since we don't know the type of the child forms Add template for in DataMapperInterface refs: #417 --- .../Component/Form/DataMapperInterface.sub | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 stubs/Symfony/Component/Form/DataMapperInterface.sub diff --git a/stubs/Symfony/Component/Form/DataMapperInterface.sub b/stubs/Symfony/Component/Form/DataMapperInterface.sub new file mode 100644 index 00000000..b63a58b3 --- /dev/null +++ b/stubs/Symfony/Component/Form/DataMapperInterface.sub @@ -0,0 +1,21 @@ +> $forms + */ + public function mapDataToForms(mixed $viewData, \Traversable $forms): void; + + /** + * @param \Traversable> $forms + * @param TViewData $viewData + */ + public function mapFormsToData(\Traversable $forms, mixed &$viewData): void; +} From 632853fb49096abb93eab682a5512aff0ed66805 Mon Sep 17 00:00:00 2001 From: wietse Date: Wed, 4 Dec 2024 12:20:42 +0100 Subject: [PATCH 2/3] fix: incorrect file extension for stub file refs: #417 --- .../Form/{DataMapperInterface.sub => DataMapperInterface.stub} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename stubs/Symfony/Component/Form/{DataMapperInterface.sub => DataMapperInterface.stub} (100%) diff --git a/stubs/Symfony/Component/Form/DataMapperInterface.sub b/stubs/Symfony/Component/Form/DataMapperInterface.stub similarity index 100% rename from stubs/Symfony/Component/Form/DataMapperInterface.sub rename to stubs/Symfony/Component/Form/DataMapperInterface.stub From 9f1c406abc63e579d2468fdfbd5e9ce3f9874a0b Mon Sep 17 00:00:00 2001 From: wietse Date: Wed, 4 Dec 2024 12:22:24 +0100 Subject: [PATCH 3/3] feat: define param out type for passed by reference refs: #417 --- stubs/Symfony/Component/Form/DataMapperInterface.stub | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/Symfony/Component/Form/DataMapperInterface.stub b/stubs/Symfony/Component/Form/DataMapperInterface.stub index b63a58b3..f243bb95 100644 --- a/stubs/Symfony/Component/Form/DataMapperInterface.stub +++ b/stubs/Symfony/Component/Form/DataMapperInterface.stub @@ -16,6 +16,7 @@ interface DataMapperInterface /** * @param \Traversable> $forms * @param TViewData $viewData + * @param-out TViewData $viewData */ public function mapFormsToData(\Traversable $forms, mixed &$viewData): void; }