Skip to content

refactor(events): dispatch() canonical, fire() shim; converge fork callsites (task 3.7) - #43

Open
agissept wants to merge 1 commit into
migration/3.6-cache-ttl-strictfrom
migration/3.7-events-fire-dispatch
Open

refactor(events): dispatch() canonical, fire() shim; converge fork callsites (task 3.7)#43
agissept wants to merge 1 commit into
migration/3.6-cache-ttl-strictfrom
migration/3.7-events-fire-dispatch

Conversation

@agissept

Copy link
Copy Markdown
Member

Stacked on #42 (task 3.6). Framework-first convergence of Illuminate\Events\Dispatcher to the L13 shape.

What

  • dispatch() is now canonical (body moved from fire()); fire() is a thin alias return $this->dispatch(...) — removed in L13 stock, so it dies at the Events swap. queue()/until()/flush() call dispatch() internally.
  • 18 fork-internal event-dispatch callsites → ->dispatch() (View, Console, Log, Foundation, Database\Connection, Router, Cache\ClearCommand, Queue\Worker, Auth\Guard, Mail\Mailer, and Eloquent\Model) so those components survive the swap to illuminate/events v13 (stock has dispatch, not fire).
    • Hidden callsite caught: Eloquent\Model fires via dynamic $halt ? 'until' : 'fire'$dispatcher->$method(...), invisible to a ->fire( grep. 'fire''dispatch'; until left as-is (present in stock).
  • Left untouched: Command::fire() and Job::fire() — different methods owned by the Console/Queue tasks (the 4 remaining ->fire( in src).

Ratchet bug fix

ci/convergence-ratchet.sh count() ran grep -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 firedispatch (dispatcher mocks only; until mocks untouched); added testDispatchIsCanonicalAndFireDelegates (parity + halt).

Follow-up (separate)

App repo dicoding: sweep Event::fire()/->fire(dispatch() + grep guard (facade is Psalm-blind, same approach as cache-ttl).

🤖 Generated with Claude Code

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant