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/buffer_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/buffer_io.rs')
| -rw-r--r-- | crates/shirabe/src/io/buffer_io.rs | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/crates/shirabe/src/io/buffer_io.rs b/crates/shirabe/src/io/buffer_io.rs index 867eb0e..ed87b71 100644 --- a/crates/shirabe/src/io/buffer_io.rs +++ b/crates/shirabe/src/io/buffer_io.rs @@ -129,39 +129,9 @@ impl BufferIO { } } -// TODO(phase-b): PHP `class BufferIO extends ConsoleIO` — delegate all IOInterface, -// LoggerInterface, and BaseIO methods to `self.inner` (ConsoleIO). -impl shirabe_external_packages::psr::log::LoggerInterface for BufferIO { - fn emergency(&self, message: &str, context: &[(&str, &str)]) { - self.inner.emergency(message, context) - } - fn alert(&self, message: &str, context: &[(&str, &str)]) { - self.inner.alert(message, context) - } - fn critical(&self, message: &str, context: &[(&str, &str)]) { - self.inner.critical(message, context) - } - fn error(&self, message: &str, context: &[(&str, &str)]) { - self.inner.error(message, context) - } - fn warning(&self, message: &str, context: &[(&str, &str)]) { - self.inner.warning(message, context) - } - fn notice(&self, message: &str, context: &[(&str, &str)]) { - self.inner.notice(message, context) - } - fn info(&self, message: &str, context: &[(&str, &str)]) { - self.inner.info(message, context) - } - fn debug(&self, message: &str, context: &[(&str, &str)]) { - self.inner.debug(message, context) - } - fn log(&self, level: &str, message: &str, context: &[(&str, &str)]) { - self.inner.log(level, message, context) - } -} - -impl crate::io::IOInterface for BufferIO { +// TODO(phase-b): PHP `class BufferIO extends ConsoleIO` — delegate all +// IOInterface and BaseIO methods to `self.inner` (ConsoleIO). +impl crate::io::IOInterfaceImmutable for BufferIO { fn is_interactive(&self) -> bool { self.inner.is_interactive() } @@ -247,6 +217,20 @@ impl crate::io::IOInterface for BufferIO { ) -> indexmap::IndexMap<String, Option<String>> { self.inner.get_authentication(repository_name) } + fn error(&self, message: &str, context: &[(&str, &str)]) { + self.inner.error(message, context) + } + + fn warning(&self, message: &str, context: &[(&str, &str)]) { + self.inner.warning(message, context) + } + + fn debug(&self, message: &str, context: &[(&str, &str)]) { + self.inner.debug(message, context) + } +} + +impl crate::io::IOInterfaceMutable for BufferIO { fn set_authentication( &mut self, repository_name: String, @@ -261,6 +245,8 @@ impl crate::io::IOInterface for BufferIO { } } +impl crate::io::IOInterface for BufferIO {} + impl crate::io::BaseIO for BufferIO { fn authentications( &self, |
