Browse Source

correction event form

Sangfroid 4 weeks ago
parent
commit
a570e2690f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Form/ArticleType.php

+ 4 - 2
src/Form/ArticleType.php

@@ -10,6 +10,8 @@ use App\Service\BaseUrl;
 use Doctrine\ORM\EntityManagerInterface;
 use Symfony\Bridge\Doctrine\Form\Type\EntityType;
 use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Event\PostSetDataEvent;
+use Symfony\Component\Form\Event\SubmitEvent;
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
 use Symfony\Component\Form\Extension\Core\Type\TextareaType;
 use Symfony\Component\Form\Extension\Core\Type\TextType;
@@ -75,7 +77,7 @@ class ArticleType extends AbstractType
         ;
 
         // Listener pour pré-remplir le champ texte lors de l'édition
-        $builder->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event): void {
+        $builder->addEventListener(FormEvents::POST_SET_DATA, function (PostSetDataEvent $event): void {
             /** @var Article $article */
             $article = $event->getData();
             $form = $event->getForm();
@@ -88,7 +90,7 @@ class ArticleType extends AbstractType
         });
 
         // Écouteur d'événement pour permettre la création de nouveaux tags
-        $builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event): void {
+        $builder->addEventListener(FormEvents::SUBMIT, function (SubmitEvent $event): void {
             $article = $event->getData();
             $form = $event->getForm();