aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-24 00:54:24 +0900
committernsfisis <nsfisis@gmail.com>2026-07-24 00:54:24 +0900
commit65978730cf0447a04691e3ee5ec92dc2c8be2a59 (patch)
tree8bcdbb2648e239b322f09da6983e98250aada912 /crates/shirabe-external-packages/src
parente6cc7371d1685f648e52882568c8330373b6c090 (diff)
downloadphp-shirabe-65978730cf0447a04691e3ee5ec92dc2c8be2a59.tar.gz
php-shirabe-65978730cf0447a04691e3ee5ec92dc2c8be2a59.tar.zst
php-shirabe-65978730cf0447a04691e3ee5ec92dc2c8be2a59.zip
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.
Diffstat (limited to 'crates/shirabe-external-packages/src')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/style/output_style.rs108
1 files changed, 11 insertions, 97 deletions
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<std::cell::RefCell<dyn OutputInterface>> {
// 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<PhpMixed>) {
- 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<PhpMixed>, _rows: Vec<PhpMixed>) {
- todo!()
- }
-
- fn ask(
- &mut self,
- _question: &str,
- _default: Option<&str>,
- _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>,
- ) -> PhpMixed {
- todo!()
- }
-
- fn ask_hidden(
- &mut self,
- _question: &str,
- _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>,
- ) -> PhpMixed {
- todo!()
- }
-
- fn confirm(&mut self, _question: &str, _default: bool) -> bool {
- todo!()
- }
-
- fn choice(
- &mut self,
- _question: &str,
- _choices: Vec<PhpMixed>,
- _default: Option<PhpMixed>,
- ) -> 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!()
- }
-}