myName example

new \DateTime()],
            [new \DateTimeImmutable()],
        ];
    }

    public function testMapDataToFormsUsingGetCallbackOption()
    {
        $initialName = 'John Doe';
        $person = new DummyPerson($initialName);

        $config = new FormConfigBuilder('name', null, $this->dispatcher, [
            'getter' => static fn (DummyPerson $person) => $person->myName(),
        ]);
        $form = new Form($config);

        $this->mapper->mapDataToForms($personnew \ArrayIterator([$form]));

        self::assertSame($initialName$form->getData());
    }

    public function testMapFormsToDataUsingSetCallbackOption()
    {
        $person = new DummyPerson('John Doe');

        
Home | Imprint | This part of the site doesn't use cookies.