refactor(console): resolve handle()-or-fire() in Command::execute() (task 3.8) - #44
Open
agissept wants to merge 1 commit into
Open
Conversation
…task 3.8)
L13 Command runs handle() (or __invoke); fire() is removed. Make the fork's
execute() prefer handle() and fall back to fire() during migration -- mirrors
stock Command's runtime resolution and lets app commands converge to handle()
one at a time. fire() dies at the Console swap.
Fork-internal commands keep fire(): they run via the fallback and are replaced
by stock illuminate/* commands at their package swaps, so renaming them now is
wasted. Enforcement is app-side (grep guard on command classes) -- the
resolution is runtime, not type-expressible.
Ratchet event_fire baseline 4->3: Command::execute()'s `$this->fire()` is now
`$this->{$method}()`, leaving only the 3 Queue Job::fire() (their own task).
Fork suite 1644 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 #43 (task 3.7). Fork side of task 2.6 (Console
fire()→handle()).What
Command::execute()now resolvesmethod_exists($this,'handle') ? 'handle' : 'fire'and calls$this->{$method}().handle()becomes the canonical L13 entry point;fire()is the L4.2 fallback that dies at the Console swap. Mirrors stock Command's own handle-or-__invokeresolution.handle()one at a time (both work during migration); the app sweep + guard land separately.Why this shape (not temp-abstract)
Fork-internal commands (~38) keep
fire()on purpose: they run via the fallback and get replaced by stockilluminate/*commands at their package swaps, so renaming them now is wasted. A temp-abstract handle()would force renaming all 38 (and break the app in one shot). Enforcement is runtime (not type-expressible), so it's grep-guarded app-side, consistent with Events/Cache.Ratchet
event_firebaseline 4→3:execute()'s$this->fire()became$this->{$method}(), leaving only the 3 QueueJob::fire()(their own task).Tests
Fork suite 1644 green (+1:
testExecuteResolvesHandleThenFallsBackToFire— handle preferred, fire fallback).Follow-up (separate)
App repo
dicoding: sweep commandfire()→handle()(~48 classes) + grep guard + boot-smoke.🤖 Generated with Claude Code