egulias/ListenersDebugCommandBundle

Undefined listener method

shakaran opened this issue · 5 comments

I get this error:

PHP Notice:  Undefined index: method in /var/www/dev/vendor/egulias/listeners-debug-command-bundle/Egulias/ListenersDebugCommandBundle/Command/ListenersCommand.php on line 300

When I execute:

app/console container:debug:listener my.listener

This seems to fail because there are not method and the array in code is trying to access to a undefined index.

It would be nice add a isset() in the code for check before if the method exists for the listener.

Hi!
Does your listener have a tag attribute named 'method'? It's assumed that it will.
Is yours a security listener (I'm testing that functionality and those don't have it).
Thanks for the feedback

Thanks for your quick reply!

My listener doesn't have a method attribute. This is how it looks like:

myapp.listener.mycoolness:
    class: MyApp\MyAppBundle\EventListener\MyCoolnessListener
    arguments:    ['@service_container']
    tags:
        - { name: doctrine.event_listener, event: postPersist, priority: 3 }
        - { name: doctrine.event_listener, event: preUpdate, priority: 3 }
        - { name: doctrine.event_listener, event: postFlush, priority: 3 }

I hope that helps you. It is not a security listener, it is a custom listener.

That's because Doctrine listeners don't need to define a method since they get called by convention.
I'll fix it asap.
Thanks!

Should work now :). Please tag to dev-master or 1.6.1

Verified, works fine with 1.6.1. Thanks