Omitting event name when register event listener not working
Wait4Code opened this issue · 5 comments
Hi,
I'm not sure if it is a bug of OneupUploaderBundle or Symfony and even if it is a bug but since Symfony 4.4 we can now register EventListener without specify event name because Symfony will instrospect arguments of listener method to know which event should be associated to listener.
(https://symfony.com/blog/new-in-symfony-4-4-simpler-event-listeners)
This new functionality does not work with, at least, post_upload event.
App\EventListener\MyListener:
tags:
- { name: kernel.event_listener }
use Oneup\UploaderBundle\Event\PostUploadEvent;
final class MyListener
{
public function __invoke(PostUploadEvent $event):void
{
echo "in listener";
exit;
}
}
It seems that with this code, dump is never reached.
Any clue ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Did you test this with the new 3.0.0
release?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sorry for the delay but I can confirm that this bug is still present with version 3.0.1.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.