aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/command/command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-23 02:26:56 +0900
committernsfisis <nsfisis@gmail.com>2026-06-23 02:26:56 +0900
commitc644aa4df0dfcd58e3f0a1372611921678ed6c6d (patch)
tree715f6b41884c2632047a7f310674293aa30c80fa /crates/shirabe-external-packages/src/symfony/console/command/command.rs
parent421d98d9a52dd036acd5632f9049f4503c9add18 (diff)
downloadphp-shirabe-c644aa4df0dfcd58e3f0a1372611921678ed6c6d.tar.gz
php-shirabe-c644aa4df0dfcd58e3f0a1372611921678ed6c6d.tar.zst
php-shirabe-c644aa4df0dfcd58e3f0a1372611921678ed6c6d.zip
refactor(console): close HelperSet to a fixed set of four helpers
Replace the dynamic, string-keyed HelperSet (set/has/get/get_iterator, HelperSetKey, deprecated set_command/get_command) with a closed set of FormatterHelper, DebugFormatterHelper, ProcessHelper and QuestionHelper instantiated by an argument-less constructor and exposed through typed getters (get_formatter/get_debug_formatter/get_process/get_question). The typed getters let ProcessHelper, QuestionHelper::write_error and InitCommand::interact drop their downcast/placeholder todo!() stubs. Dynamic registration of plugin-provided helpers is intentionally dropped for now and tracked via TODO(plugin) comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/command/command.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/command/command.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/command/command.rs b/crates/shirabe-external-packages/src/symfony/console/command/command.rs
index 2d94ad2..59aa915 100644
--- a/crates/shirabe-external-packages/src/symfony/console/command/command.rs
+++ b/crates/shirabe-external-packages/src/symfony/console/command/command.rs
@@ -822,9 +822,11 @@ impl Command for CommandData {
Some(helper_set) => helper_set,
};
- // TODO(review): HelperSet::get() returns `Rc<RefCell<dyn HelperInterface>>`, but
- // Command::getHelper() is typed `mixed` (PhpMixed) here and PhpMixed cannot hold a
- // helper instance. The helper return modelling needs a dedicated type (Phase C).
+ // TODO(plugin): PHP's Command::getHelper($name) looks a helper up by string via
+ // HelperSet::get($name). The HelperSet is now a closed set exposing only typed getters
+ // (get_formatter/get_question/...), so a string-keyed lookup no longer exists. Callers
+ // should use the typed getters on the HelperSet directly; restoring name-based lookup is
+ // deferred until the plugin API (which is the only source of dynamically named helpers).
let _ = helper_set;
todo!()
}