aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 21:40:32 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 21:40:32 +0900
commit0b17152889f2096199a24a87df59ade2dca6e1a0 (patch)
tree0390af199a337ceec002ec07bcf74a88fd73b0f0
parent6a46e7fde3582bdb3335fab1139ebb8ed98a0dc4 (diff)
downloadphp-shirabe-0b17152889f2096199a24a87df59ade2dca6e1a0.tar.gz
php-shirabe-0b17152889f2096199a24a87df59ade2dca6e1a0.tar.zst
php-shirabe-0b17152889f2096199a24a87df59ade2dca6e1a0.zip
feat(outdated): proxy execute to show via shared Application
The execute() proxy was left as todo!(); wire it to the shared Application handle so `outdated` re-enters the run flow as `show -l`, matching PHP's $this->getApplication()->run(). Add Application::shared() to expose the new_shared self-reference and un-ignore run_outdated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
-rw-r--r--crates/shirabe/src/command/outdated_command.rs21
-rw-r--r--crates/shirabe/src/console/application.rs8
-rw-r--r--crates/shirabe/tests/cli.rs1
3 files changed, 25 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/outdated_command.rs b/crates/shirabe/src/command/outdated_command.rs
index 22dd120..16a4ac5 100644
--- a/crates/shirabe/src/command/outdated_command.rs
+++ b/crates/shirabe/src/command/outdated_command.rs
@@ -214,10 +214,23 @@ impl Command for OutdatedCommand {
)?;
let input: Rc<RefCell<dyn InputInterface>> = Rc::new(RefCell::new(input));
- // TODO(phase-c): proxying to ShowCommand via Application::run needs the shared shirabe
- // Application handle (deferred with the Application shared-ownership work and registration).
- let _ = (input, output);
- todo!("outdated command proxy run pending shared Application handle")
+
+ let application = {
+ let application = self
+ .get_application()
+ .expect("a proxy command is always attached to its application");
+ let application = application.borrow();
+ application
+ .as_any()
+ .downcast_ref::<crate::console::application::Application>()
+ .expect("shirabe always installs its own Application")
+ .shared()
+ };
+
+ Ok(
+ crate::console::application::Application::run(&application, Some(input), Some(output))?
+ as i64,
+ )
}
fn initialize(
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 4f7754d..7fa6720 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -246,6 +246,14 @@ impl Application {
Ok(application)
}
+ /// Returns the shared handle to this application set up by `new_shared`. Proxy commands use it to
+ /// re-enter the run flow (PHP's `$this->getApplication()->run(...)`).
+ pub fn shared(&self) -> std::rc::Rc<std::cell::RefCell<Application>> {
+ self.me
+ .upgrade()
+ .expect("Application must be constructed through new_shared")
+ }
+
/// Registers the default commands on a shared application (PHP's lazy `init()`), executed once
/// with no application borrow held so each `set_application` can borrow back safely.
fn init_shared(
diff --git a/crates/shirabe/tests/cli.rs b/crates/shirabe/tests/cli.rs
index a267ff2..ba58d11 100644
--- a/crates/shirabe/tests/cli.rs
+++ b/crates/shirabe/tests/cli.rs
@@ -145,7 +145,6 @@ run_no_panic_tests! {
run_init => "init",
run_install => "install",
run_licenses => "licenses",
- #[ignore = "currently panics"]
run_outdated => "outdated",
run_prohibits => "prohibits",
run_reinstall => "reinstall",