Skip to content

Commit

Permalink
feat: added stub for DataMapperInterface
Browse files Browse the repository at this point in the history
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

creds to @roerbakei ;)

refs: phpstan#417
  • Loading branch information
JefvdA committed Jan 9, 2025
1 parent c08cd8e commit 0d2b11a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions stubs/Symfony/Component/Form/DataMapperInterface.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Symfony\Component\Form;

/**
* @template TViewData
*/
interface DataMapperInterface
{
/**
* @param TViewData|null $viewData
* @param \Traversable<mixed, FormInterface<mixed>> $forms
*/
public function mapDataToForms(mixed $viewData, \Traversable $forms): void;

/**
* @param \Traversable<mixed, FormInterface<mixed>> $forms
* @param TViewData|null $viewData
* @param-out TViewData $viewData
*/
public function mapFormsToData(\Traversable $forms, mixed &$viewData): void;
}

0 comments on commit 0d2b11a

Please sign in to comment.