Skip to content

Commit

Permalink
feat: stub 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

refs: phpstan#417
  • Loading branch information
wietse committed Dec 4, 2024
1 parent 1ef4dce commit 12ff984
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stubs/Symfony/Component/Form/DataMapperInterface.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Symfony\Component\Form;

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

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

0 comments on commit 12ff984

Please sign in to comment.