See PR with a proposed backwards-compatible fix: #238
What happened?
Depending on the registration of additional handle methods, the return value of a Event::commit can either be the exact return value of the event's handle method, or a collection of the handle return value` plus the return values of any additionally registered handlers.
This makes using the Event::commit return value virtually impossible, as there is no way to protect your events to get additional handlers registered.
The current Verbs documentation is also proposing a use case for Event::commit which is brittle: #218 (comment)
How to reproduce the bug
See this original ticket and the linked PR: #218
Package Version
v0.7.1
PHP Version
8.4.6
Laravel Version
N/A
Which operating systems does with happen with?
macOS
Notes
I prepared a PR that supports customizing the handle return resolution logic to stay backward-compatible (if this is considered a hard requirement), but allows people to opt into a more consistent behavior: #238
See PR with a proposed backwards-compatible fix: #238
What happened?
Depending on the registration of additional handle methods, the return value of a
Event::commitcan either be the exact return value of the event'shandlemethod, or a collection of thehandlereturn value` plus the return values of any additionally registered handlers.This makes using the
Event::commitreturn value virtually impossible, as there is no way to protect your events to get additional handlers registered.The current Verbs documentation is also proposing a use case for
Event::commitwhich is brittle: #218 (comment)How to reproduce the bug
See this original ticket and the linked PR: #218
Package Version
v0.7.1
PHP Version
8.4.6
Laravel Version
N/A
Which operating systems does with happen with?
macOS
Notes
I prepared a PR that supports customizing the handle return resolution logic to stay backward-compatible (if this is considered a hard requirement), but allows people to opt into a more consistent behavior: #238