#Is it possible to get proper Intellisense for Event::dispatch(...) parameters?
20 messages · Page 1 of 1 (latest)
event(new MyEvent("some argument"))?
just construct the object and then send it out
event() is a global function?
yes
np
"Evan" do you specialize in "Event" based answers?
that is the wildest stretch I've ever seen
I specialize in answers related to lost connectivity
...
But no this was great, thanks so much
There is, you need to add phpdoc style documentation within your event before the class starts. You can define something like
/*
@method void dispatch(type $variable)
*/
When calling MyEvent::dispatch in the editor intellisense will kick in. I do that for all my job classes.
It should be marked static, and I also add docs for dispatchSync. It returns a PendingDispatch object, that will give you auto-complete on the chained methods.
