Update cookbook/form/dynamic_form_generation.rst

in the class AddNameFieldSubscriber :

not used  "use Symfony\Component\Form\Event\DataEvent;"

missing "use Symfony\Component\Form\FormEvent;"
for "public function preSetData(FormEvent $event)"