Skip to content

Omitting event name when register event listener not working #371

@Wait4Code

Description

@Wait4Code

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions