Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 11 |
| SupervisorProcessDataFormDataMapper | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
56 | |
0.00% |
0 / 11 |
| mapDataToForms | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 7 |
|||
| mapFormsToData | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
| configureOptions | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php declare(strict_types = 1); | |
| // | |
| // Generated by Smalldb\CodeCooker\Generator\DtoGenerator. | |
| // Do NOT edit! All changes will be lost! | |
| // | |
| // | |
| namespace Smalldb\StateMachine\Test\Example\SupervisorProcess\SupervisorProcessData; | |
| use Smalldb\CodeCooker\Annotation\GeneratedClass; | |
| use Symfony\Component\Form\DataMapperInterface; | |
| use Symfony\Component\Form\Exception\UnexpectedTypeException; | |
| use Symfony\Component\OptionsResolver\OptionsResolver; | |
| /** | |
| * @GeneratedClass | |
| * @see \Smalldb\StateMachine\Test\Example\SupervisorProcess\SupervisorProcessProperties | |
| */ | |
| class SupervisorProcessDataFormDataMapper implements DataMapperInterface | |
| { | |
| public function mapDataToForms($viewData, iterable $forms) | |
| { | |
| if ($viewData === null) { | |
| return; | |
| } else if ($viewData instanceof SupervisorProcessData) { | |
| foreach ($forms as $prop => $field) { | |
| $field->setData(SupervisorProcessDataImmutable::get($viewData, $prop)); | |
| } | |
| } else { | |
| throw new UnexpectedTypeException($viewData, SupervisorProcessDataImmutable::class); | |
| } | |
| } | |
| public function mapFormsToData(iterable $forms, & $viewData) | |
| { | |
| $viewData = SupervisorProcessDataImmutable::fromIterable($viewData, (function() use ($forms) { foreach($forms as $k => $field) yield $k => $field->getData(); })()); | |
| } | |
| public function configureOptions(OptionsResolver $optionsResolver) | |
| { | |
| $optionsResolver->setDefault("empty_data", null); | |
| $optionsResolver->setDefault("data_class", SupervisorProcessData::class); | |
| } | |
| } | |