refactor(events): dispatch() canonical, fire() shim; converge fork callsites (task 3.7) - #43
Open
agissept wants to merge 1 commit into
Open
Conversation
…llsites (task 3.7) L13 renames Events\Dispatcher::fire() -> dispatch() (fire() removed in stock). Move the body into dispatch(); fire() becomes a thin alias that dies at the Events swap. queue()/until()/flush() now call dispatch() internally. Converge all 18 fork-internal event-dispatch callsites to dispatch() so those components survive the swap to illuminate/events v13 (View, Console, Log, Foundation, Database\Connection, Router, Cache\ClearCommand, Queue\Worker, Auth \Guard, Mail\Mailer, and Eloquent\Model's dynamic $halt?'until':'fire'). Left untouched: Command::fire() and Job::fire() -- different methods owned by the Console/Queue tasks. Fix ci/convergence-ratchet.sh: count() grep lacked `--`, so the four `->`- prefixed patterns (event_fire/where_raw/eloquent_lists/pagination_getters) were parsed as grep options, errored, and silently counted 0 -- the ratchet was a no-op for them. Add the guard and regenerate the baseline to grandfather the now-visible real residues (event_fire=4 Command/Job, where_raw=1, eloquent_lists=6, pagination_getters=15). Fork suite 1643 green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #42 (task 3.6). Framework-first convergence of
Illuminate\Events\Dispatcherto the L13 shape.What
dispatch()is now canonical (body moved fromfire());fire()is a thin aliasreturn $this->dispatch(...)— removed in L13 stock, so it dies at the Events swap.queue()/until()/flush()calldispatch()internally.->dispatch()(View, Console, Log, Foundation, Database\Connection, Router, Cache\ClearCommand, Queue\Worker, Auth\Guard, Mail\Mailer, andEloquent\Model) so those components survive the swap toilluminate/eventsv13 (stock hasdispatch, notfire).Eloquent\Modelfires via dynamic$halt ? 'until' : 'fire'→$dispatcher->$method(...), invisible to a->fire(grep.'fire'→'dispatch';untilleft as-is (present in stock).Command::fire()andJob::fire()— different methods owned by the Console/Queue tasks (the 4 remaining->fire(insrc).Ratchet bug fix
ci/convergence-ratchet.shcount()rangrep -rEc … "$1"without--, so the four->-prefixed patterns (event_fire,where_raw,eloquent_lists,pagination_getters) were parsed as grep options, errored, and silently counted 0 — a no-op guard. Added the--and regenerated the baseline to grandfather the now-visible real residues:event_fire=4(Command/Job),where_raw=1,eloquent_lists=6,pagination_getters=15. These now actually enforce.Tests
Fork suite 1643 green (21 skipped). Mock expectations for the event dispatcher retargeted
fire→dispatch(dispatcher mocks only;untilmocks untouched); addedtestDispatchIsCanonicalAndFireDelegates(parity + halt).Follow-up (separate)
App repo
dicoding: sweepEvent::fire()/->fire(→dispatch()+ grep guard (facade is Psalm-blind, same approach as cache-ttl).🤖 Generated with Claude Code