Hi. I have got problem during making Ratchet tutorial. This is my full error log.
PHP Catchable fatal error: Argument 2 passed to Evenement\EventEmitter::on() must be callable, array given, called in /var/www/ratchet/bin/push-server.php on line 12 and defined in /var/www/ratchet/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php on line 18
I found that if you delete callable attribute before $listener param from EventEmitterInterface then works fine. You should update yours tutorial to new version of Evenement or add specific version to composer.lock.
Best regards.
Does your $pusher instance have a valid method named onBlogEntry?
Yes
Can you post your source code in a gist so I can replicate it?
Closing due to inactivity. Will re-open if reproducible code is posted.
For the benefit of others, make sure that the method you're passing has public visibility. Even when you define the callback in the same class, remember that it's going to be called from different context when the event actually gets emitted.
This has stupidly tripped me up more than once!
Most helpful comment
For the benefit of others, make sure that the method you're passing has
publicvisibility. Even when you define the callback in the same class, remember that it's going to be called from different context when the event actually gets emitted.This has stupidly tripped me up more than once!