From 65978730cf0447a04691e3ee5ec92dc2c8be2a59 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 24 Jul 2026 00:54:24 +0900 Subject: refactor(symfony-style): remove unused StyleInterface impl on OutputStyle Real symfony/console OutputStyle is abstract and never defines these methods itself (title/section/table/ask/... stay abstract, deferred to SymfonyStyle). The Rust impl block was a porting artifact never invoked anywhere: OutputStyle is only used as SymfonyStyle's concrete `inner` field, and every StyleInterface call site goes through SymfonyStyle's own full implementation. new_line, which SymfonyStyle::new_line does delegate to, moves to an inherent method to keep that call working. --- .../src/symfony/console/style/output_style.rs | 108 +++------------------ 1 file changed, 11 insertions(+), 97 deletions(-) (limited to 'crates/shirabe-external-packages') diff --git a/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs index 12fd3dcb..7d68ceaf 100644 --- a/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/style/output_style.rs @@ -5,8 +5,6 @@ use crate::symfony::console::helper::ProgressBar; use crate::symfony::console::output::ConsoleOutputInterface; use crate::symfony::console::output::OutputInterface; use crate::symfony::console::output::output_interface::OUTPUT_NORMAL; -use crate::symfony::console::style::style_interface::StyleInterface; -use shirabe_php_shim::PhpMixed; /// Decorates output to add console style guide helpers. #[derive(Debug)] @@ -23,6 +21,17 @@ impl OutputStyle { ProgressBar::new(self.output.clone(), max, 1.0 / 25.0) } + pub fn new_line(&self, count: i64) { + self.output.borrow().write( + &[shirabe_php_shim::str_repeat( + shirabe_php_shim::PHP_EOL, + count as usize, + )], + false, + OUTPUT_NORMAL, + ); + } + pub(crate) fn get_error_output(&self) -> std::rc::Rc> { // PHP checks `$this->output instanceof ConsoleOutputInterface`; this requires // runtime type information that the OutputInterface trait object lacks. @@ -105,98 +114,3 @@ impl OutputInterface for OutputStyle { self.output.borrow().get_formatter() } } - -impl StyleInterface for OutputStyle { - fn title(&mut self, _message: &str) { - todo!() - } - - fn section(&mut self, _message: &str) { - todo!() - } - - fn listing(&mut self, _elements: Vec) { - todo!() - } - - fn text(&mut self, _message: PhpMixed) { - todo!() - } - - fn success(&mut self, _message: PhpMixed) { - todo!() - } - - fn error(&mut self, _message: PhpMixed) { - todo!() - } - - fn warning(&mut self, _message: PhpMixed) { - todo!() - } - - fn note(&mut self, _message: PhpMixed) { - todo!() - } - - fn caution(&mut self, _message: PhpMixed) { - todo!() - } - - fn table(&mut self, _headers: Vec, _rows: Vec) { - todo!() - } - - fn ask( - &mut self, - _question: &str, - _default: Option<&str>, - _validator: Option) -> anyhow::Result>>, - ) -> PhpMixed { - todo!() - } - - fn ask_hidden( - &mut self, - _question: &str, - _validator: Option) -> anyhow::Result>>, - ) -> PhpMixed { - todo!() - } - - fn confirm(&mut self, _question: &str, _default: bool) -> bool { - todo!() - } - - fn choice( - &mut self, - _question: &str, - _choices: Vec, - _default: Option, - ) -> PhpMixed { - todo!() - } - - fn new_line(&mut self, count: i64) { - self.output.borrow().write( - &[shirabe_php_shim::str_repeat( - shirabe_php_shim::PHP_EOL, - count as usize, - )], - false, - OUTPUT_NORMAL, - ); - } - - fn progress_start(&mut self, _max: i64) { - todo!() - } - - fn progress_advance(&mut self, _step: i64) { - todo!() - } - - fn progress_finish(&mut self) { - todo!() - } -} -- cgit v1.3.1