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/util/process_executor.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/util/process_executor.rs')
| -rw-r--r-- | crates/shirabe/src/util/process_executor.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs index b62debe..75b40cb 100644 --- a/crates/shirabe/src/util/process_executor.rs +++ b/crates/shirabe/src/util/process_executor.rs @@ -261,14 +261,19 @@ impl ProcessExecutor { } } + // PHP: $callback = is_callable($output) ? $output : fn($type, $buffer) => $this->outputHandler($type, $buffer); let output_is_callable = output.as_deref().map(|o| is_callable(o)).unwrap_or(false); let _callback: Box<dyn Fn(&str, &str)> = if output_is_callable { - // TODO(phase-b): adapt output PhpMixed callable to closure + // TODO(phase-c): the user-supplied $output is a PhpMixed callable that cannot be + // invoked without a typed callable model (Rc<dyn Fn>); deferred with the callable model. Box::new(|_t: &str, _b: &str| {}) } else { - Box::new(|_t: &str, _b: &str| { - // TODO(phase-b): self.output_handler(t, b) — self is borrowed mutably elsewhere - }) + // TODO(phase-c): the fallback must call self.output_handler(type, buffer) (which is + // &mut self and writes to io / updates last_message), but this is a 'static + // `Box<dyn Fn>` that cannot borrow &mut self. Wiring it needs the handler state shared + // (Rc<RefCell<...>>). The callback is also not yet passed to process.run, whose Symfony + // Process backing stays todo!(). + Box::new(|_t: &str, _b: &str| {}) }; let io_for_signal = self.io.clone(); |
