-
Notifications
You must be signed in to change notification settings - Fork 5
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 support for event/job static dispatch calls on class itself #15
Comments
I was looking into this and AFAIK this requires some changes to static call detection logic. As these classes are now hardcoded into method, we would need get all imported classes and try to check if there is used these predefined methods? |
Sorry, I'm a bit confused by your sentence. You mean we would need to:
Or am I understanding it wrong? |
Maybe I should try to clarify my output, but what I meant was:
This is how far I have got with this reasoning. The problem here (I think) is that both event and jobs have dispatch method, which makes separating jobs and events a bit challenging. |
Alright I think I understand the issue. A possible solution might be checking the dispatched class to see if they have a Not sure if there's a more foolproof way though… |
Events
https://laravel.com/docs/9.x/events#dispatching-events
EventClass::dispatch(...)
EventClass::dispatchIf(...)
EventClass::dispatchUnless(...)
Jobs
https://laravel.com/docs/9.x/queues#dispatching-jobs
JobClass::dispatch(...)
JobClass::dispatchIf(...)
JobClass::dispatchUnless(...)
JobClass::dispatchAfterResponse(...)
JobClass::dispatchSync(...)
The text was updated successfully, but these errors were encountered: