From c644aa4df0dfcd58e3f0a1372611921678ed6c6d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 23 Jun 2026 02:26:56 +0900 Subject: 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 --- .../src/symfony/console/command/command.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/command/command.rs') 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>`, 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!() } -- cgit v1.3.1