diff --git a/Event/BirdInCageEvent.php b/Event/BirdInCageEvent.php index 10d009d..fce3ccf 100644 --- a/Event/BirdInCageEvent.php +++ b/Event/BirdInCageEvent.php @@ -12,7 +12,7 @@ namespace Eo\HoneypotBundle\Event; use Eo\HoneypotBundle\Model\HoneypotPreyInterface; -use Symfony\Component\EventDispatcher\Event; +use Symfony\Contracts\EventDispatcher\Event; class BirdInCageEvent extends Event { diff --git a/Form/Type/HoneypotType.php b/Form/Type/HoneypotType.php index 9012875..a97bb9a 100644 --- a/Form/Type/HoneypotType.php +++ b/Form/Type/HoneypotType.php @@ -80,7 +80,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) $prey = $honeypotManager->createNew($request->getClientIp()); // Dispatch bird.in.cage event - $eventDispatcher->dispatch(Events::BIRD_IN_CAGE, new BirdInCageEvent($prey)); + $eventDispatcher->dispatch(new BirdInCageEvent($prey), Events::BIRD_IN_CAGE); // Save prey $honeypotManager->save($prey); diff --git a/Tests/Form/Type/HoneypotTypeTest.php b/Tests/Form/Type/HoneypotTypeTest.php index 9cb0a26..8a88270 100644 --- a/Tests/Form/Type/HoneypotTypeTest.php +++ b/Tests/Form/Type/HoneypotTypeTest.php @@ -79,7 +79,7 @@ public function testBuildForm($data, $trigger) $form = $builder->getForm(); $form->setParent($parent); - $eventDispatcher->dispatch(FormEvents::PRE_SUBMIT, new FormEvent($form, $data)); + $eventDispatcher->dispatch(new FormEvent($form, $data), FormEvents::PRE_SUBMIT); $this->assertEquals($this->triggered, $trigger); } diff --git a/composer.json b/composer.json index ca9a2b6..d26f612 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "symfony/framework-bundle": "~3.0|~4.0|~5.0" + "symfony/framework-bundle": "~5.0" }, "require-dev": { "eo/symfony-test-edition": "~3.0"