diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:43 +0900 |
| commit | 1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch) | |
| tree | 9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe/src/event_dispatcher | |
| parent | ddf0a624145b618c05c2ee47414545b99b685f37 (diff) | |
| download | php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip | |
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/event_dispatcher')
| -rw-r--r-- | crates/shirabe/src/event_dispatcher/event_dispatcher.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs index 2124093..d209e1e 100644 --- a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs +++ b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs @@ -587,14 +587,11 @@ impl EventDispatcher { continue; } - let mut app = Application::new("", ""); + let mut app = Application::__construct("UNKNOWN", "UNKNOWN"); app.set_catch_exceptions(false); - if method_exists( - &PhpMixed::String("Application".to_string()), - "setCatchErrors", - ) { - app.set_catch_errors(false); - } + // PHP: if (method_exists($app, 'setCatchErrors')) { $app->setCatchErrors(false); } + // This Symfony Console port does not provide `setCatchErrors`, so the + // guarded call is skipped, matching `method_exists` evaluating to false. app.set_auto_exit(false); // TODO(plugin): instantiate command class dynamically: `new $className($event->getName())` todo!( @@ -615,7 +612,7 @@ impl EventDispatcher { let _refl_php_version_gate = PHP_VERSION_ID < 80100; todo!("\\ReflectionProperty on ConsoleIO::$output") } else { - ConsoleOutput::new(0, None, None) + ConsoleOutput::new(None, None, None)? }; let input_str = event .get_flags() @@ -623,8 +620,8 @@ impl EventDispatcher { .and_then(|v| v.as_string()) .unwrap_or(&args) .to_string(); - let mut input = StringInput::new(&input_str); - let mut output = output; + let input = StringInput::new(&input_str)?; + let output = output; Ok(app.run( Some(std::rc::Rc::new(std::cell::RefCell::new(input))), Some(std::rc::Rc::new(std::cell::RefCell::new(output))), |
