diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-26 20:04:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-26 20:04:02 +0900 |
| commit | f411daceacad66e0bd774fda7d3c5ef8533cc55c (patch) | |
| tree | eefb065e4d676a3f7031ca49bab21c773b00b134 /crates/shirabe/src/io/console_io.rs | |
| parent | 1921f173ea219cb4b25847294d2d3fa465550fbb (diff) | |
| download | php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.gz php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.tar.zst php-shirabe-f411daceacad66e0bd774fda7d3c5ef8533cc55c.zip | |
refactor(io): share IOInterface via Rc<RefCell<dyn _>> handle
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/io/console_io.rs')
| -rw-r--r-- | crates/shirabe/src/io/console_io.rs | 63 |
1 files changed, 19 insertions, 44 deletions
diff --git a/crates/shirabe/src/io/console_io.rs b/crates/shirabe/src/io/console_io.rs index b4bae47..2b1c334 100644 --- a/crates/shirabe/src/io/console_io.rs +++ b/crates/shirabe/src/io/console_io.rs @@ -5,7 +5,6 @@ use crate::io::io_interface; use indexmap::IndexMap; use indexmap::indexmap; use shirabe_external_packages::composer::pcre::Preg; -use shirabe_external_packages::psr::log::LoggerInterface; use shirabe_external_packages::symfony::component::console::helper::HelperSet; use shirabe_external_packages::symfony::component::console::helper::ProgressBar; use shirabe_external_packages::symfony::component::console::helper::Table; @@ -25,6 +24,8 @@ use std::cell::RefCell; use crate::io::BaseIO; use crate::io::IOInterface; +use crate::io::IOInterfaceImmutable; +use crate::io::IOInterfaceMutable; use crate::question::StrictConfirmationQuestion; use crate::util::Silencer; @@ -378,49 +379,7 @@ impl ConsoleIO { } } -impl LoggerInterface for ConsoleIO { - // TODO(phase-b): BaseIO's emergency/alert/.../log take PhpMixed and - // IndexMap<String, Box<PhpMixed>> while LoggerInterface takes &str and - // &[(&str, &str)]. Delegation requires reconciling signatures; for now, - // mirror NullIO and panic via todo!(). - fn emergency(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn alert(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn critical(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn error(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn warning(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn notice(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn info(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn debug(&self, _message: &str, _context: &[(&str, &str)]) { - todo!() - } - - fn log(&self, _level: &str, _message: &str, _context: &[(&str, &str)]) { - todo!() - } -} - -impl IOInterface for ConsoleIO { +impl IOInterfaceImmutable for ConsoleIO { fn is_interactive(&self) -> bool { self.input.is_interactive() } @@ -690,6 +649,20 @@ impl IOInterface for ConsoleIO { <Self as BaseIO>::get_authentication(self, repository_name) } + fn error(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } + + fn warning(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } + + fn debug(&self, _message: &str, _context: &[(&str, &str)]) { + todo!() + } +} + +impl IOInterfaceMutable for ConsoleIO { fn set_authentication( &mut self, repository_name: String, @@ -704,6 +677,8 @@ impl IOInterface for ConsoleIO { } } +impl IOInterface for ConsoleIO {} + impl BaseIO for ConsoleIO { fn authentications( &self, |
