psalm-plugin-symfony
psalm-plugin-symfony copied to clipboard
Add issue for event listener pointing to wrong method name
#[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