diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-11 02:39:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-11 02:39:35 +0900 |
| commit | 6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83 (patch) | |
| tree | e39261f4aa7314fe8c75142670c76591cdaccb92 /crates/shirabe/src/io/buffer_io.rs | |
| parent | 5d3232a80be4b989e89cc7ae4e3642cc5acae030 (diff) | |
| download | php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.gz php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.tar.zst php-shirabe-6ae7e0d4b3eaf20e2d2cd3d000cf61ab0c9b6e83.zip | |
feat(console): resolve phase-b TODOs in doRun and IO wiring
Wire up ConsoleIO with HelperSet/QuestionHelper, register the
ErrorHandler with the IO instance, and fall back to a default output
in run(). Replace resolved phase-b TODOs across the console, command,
io, factory, installer, dependency_resolver, and util modules; reclassify
the remaining blockers (typed Symfony command registry, stdin resource
caching) as phase-c.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/io/buffer_io.rs')
| -rw-r--r-- | crates/shirabe/src/io/buffer_io.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/shirabe/src/io/buffer_io.rs b/crates/shirabe/src/io/buffer_io.rs index 92f5714..988c153 100644 --- a/crates/shirabe/src/io/buffer_io.rs +++ b/crates/shirabe/src/io/buffer_io.rs @@ -4,6 +4,7 @@ use crate::io::ConsoleIO; use anyhow::Result; use shirabe_external_packages::composer::pcre::Preg; use shirabe_external_packages::symfony::console::formatter::OutputFormatterInterface; +use shirabe_external_packages::symfony::console::helper::HelperInterface; use shirabe_external_packages::symfony::console::helper::HelperSet; use shirabe_external_packages::symfony::console::helper::QuestionHelper; use shirabe_external_packages::symfony::console::input::InputInterface; @@ -46,11 +47,11 @@ impl BufferIO { let output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>> = todo!("wire StreamOutput as the ConsoleIO output"); - // TODO(phase-c): construct the QuestionHelper and register it in the HelperSet. - let helpers: Vec<PhpMixed> = vec![/* PhpMixed::Object(QuestionHelper::new()) */]; - let _ = std::marker::PhantomData::<QuestionHelper>; + let helpers: Vec<std::rc::Rc<std::cell::RefCell<dyn HelperInterface>>> = + vec![std::rc::Rc::new(std::cell::RefCell::new(QuestionHelper))]; let inner = ConsoleIO::new( - Box::new(input_obj) as Box<dyn InputInterface>, + std::rc::Rc::new(std::cell::RefCell::new(input_obj)) + as std::rc::Rc<std::cell::RefCell<dyn InputInterface>>, output, HelperSet::new(helpers), ); @@ -129,8 +130,6 @@ impl 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() @@ -249,6 +248,10 @@ impl crate::io::IOInterface for BufferIO { fn as_any(&self) -> &dyn std::any::Any { self } + + fn as_base_io_mut(&mut self) -> Option<&mut dyn crate::io::BaseIO> { + Some(self) + } } impl crate::io::BaseIO for BufferIO { |
