Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add issue for event listener pointing to wrong method name #318

Open
ostrolucky opened this issue Jul 6, 2023 · 0 comments
Open

Add issue for event listener pointing to wrong method name #318

ostrolucky opened this issue Jul 6, 2023 · 0 comments
Labels
feature New feature or request

Comments

@ostrolucky
Copy link
Contributor

#[AsEventListener(ImportProcessEvent::USER_IMPORT_CONFIRMED, priority: 100)]
final class UserImportListener
{
    public function dispatchAccess(ImportProcessEvent $event): void
    {
    }
}

This should be reported as an issue, because in runtime it produces

Uncaught PHP Exception TypeError: "Failed to create closure from callable: class UserImportListener does not have a method "onImportConfirmed" at /srv/api/vendor/symfony/event-dispatcher/EventDispatcher.php line 270

Method should be renamed to __invoke or onImportConfirmed

@seferov seferov added the feature New feature or request label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants