From e5e6cc6807c9fbbef883ffe0eec9eed477d5bee3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 1 Aug 2026 20:51:40 +0900 Subject: feat(symfony-console): implement interactive question/style helpers Resolve the remaining todo!()s in SymfonyStyle, OutputStyle, QuestionHelper and SymfonyQuestionHelper: * Wire up the virtual dispatch PHP performs for the protected writePrompt()/writeError() overrides, following the codebase's established inheritance idiom (Command, ArchiveDownloader): the base class becomes a trait (QuestionHelperInterface, named after the QuestionInterface precedent) whose provided methods ask/do_ask/ validate_attempts carry the template logic and late-bind the write_prompt/write_error hooks through Self, with inner()/inner_mut() reaching the base-class state. SymfonyQuestionHelper overrides the hooks as plain trait-impl methods, mirroring PHP's protected-method overriding, so SymfonyStyle-driven questions now render the Symfony Style Guide prompt. * Type definition_list input as an enum (string|array|TableSeparator) because PhpMixed intentionally cannot carry objects; the InvalidArgumentException branch (a LogicException) becomes unrepresentable. horizontal_table now takes typed Cells/Rows. * Propagate the MissingInputException thrown inside autocomplete() through a Result instead of aborting. * Implement as_console_output_interface via Ref::filter_map on ConsoleOutput, the interface's only implementor. * Port progressIterate eagerly, following ProgressBar::iterate. * Map __FILE__ to current_exe(): a native binary never runs from a phar, so the hiddeninput.exe relocation branch correctly never fires. Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/question/strict_confirmation_question_test.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/tests/question/strict_confirmation_question_test.rs') diff --git a/crates/shirabe/tests/question/strict_confirmation_question_test.rs b/crates/shirabe/tests/question/strict_confirmation_question_test.rs index 37d57117..916daad1 100644 --- a/crates/shirabe/tests/question/strict_confirmation_question_test.rs +++ b/crates/shirabe/tests/question/strict_confirmation_question_test.rs @@ -1,7 +1,9 @@ //! ref: composer/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php use shirabe::question::StrictConfirmationQuestion; -use shirabe_external_packages::symfony::console::helper::question_helper::QuestionHelper; +use shirabe_external_packages::symfony::console::helper::question_helper::{ + QuestionHelper, QuestionHelperInterface, +}; use shirabe_external_packages::symfony::console::input::array_input::ArrayInput; use shirabe_external_packages::symfony::console::input::streamable_input_interface::StreamableInputInterface; use shirabe_external_packages::symfony::console::output::output_interface::OutputInterface; -- cgit v1.3.1