Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Changed iterable $forms to Traversable in the data mapper implementat…
Browse files Browse the repository at this point in the history
…ion example
  • Loading branch information
vudaltsov committed Dec 5, 2020
1 parent 78eaf54 commit 4677e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions form/data_mappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ in your form type::
/**
* @param Color|null $viewData
*/
public function mapDataToForms($viewData, iterable $forms): void
public function mapDataToForms($viewData, \Traversable $forms): void
{
// there is no data yet, so nothing to prepopulate
if (null === $viewData) {
Expand All @@ -119,7 +119,7 @@ in your form type::
$forms['blue']->setData($viewData->getBlue());
}

public function mapFormsToData(iterable $forms, &$viewData): void
public function mapFormsToData(\Traversable $forms, &$viewData): void
{
/** @var FormInterface[] $forms */
$forms = iterator_to_array($forms);
Expand Down

0 comments on commit 4677e42

Please sign in to comment.