aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-04 20:40:31 +0900
committernsfisis <nsfisis@gmail.com>2026-07-04 20:40:31 +0900
commitbc17a09fc84d146b7d91401a2998ceef10c8a2ec (patch)
treeac6e46161f2ac3763295ec13ba917ab06109c9c5
parent8f852537e82dabd71b4492bdf903b95d9028560c (diff)
downloadphp-shirabe-bc17a09fc84d146b7d91401a2998ceef10c8a2ec.tar.gz
php-shirabe-bc17a09fc84d146b7d91401a2998ceef10c8a2ec.tar.zst
php-shirabe-bc17a09fc84d146b7d91401a2998ceef10c8a2ec.zip
feat(plugin-installer): implement PluginInstaller::get_plugin_manager
Wires PartialComposer.as_full() to fetch the PluginManager, replacing the todo!() stub. Mirrors PHP's assertion that $this->composer must be a fully-loaded Composer instance.
-rw-r--r--crates/shirabe/src/installer/plugin_installer.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/shirabe/src/installer/plugin_installer.rs b/crates/shirabe/src/installer/plugin_installer.rs
index 132d408..7ff5eb3 100644
--- a/crates/shirabe/src/installer/plugin_installer.rs
+++ b/crates/shirabe/src/installer/plugin_installer.rs
@@ -58,8 +58,16 @@ impl PluginInstaller {
}
fn get_plugin_manager(&self) -> std::rc::Rc<std::cell::RefCell<PluginManager>> {
- // TODO(plugin): PartialComposer does not expose PluginManager; revisit when wiring plugin support
- todo!("PartialComposer.get_plugin_manager")
+ // PHP asserts that $this->composer is instance of fully-loaded Composer, and throws a
+ // LogicException if not. In Rust, just panic!.
+ self.inner
+ .composer
+ .upgrade()
+ .expect("Composer handle dropped")
+ .as_full()
+ .expect("PluginInstaller should be initialized with a fully loaded Composer instance.")
+ .borrow()
+ .get_plugin_manager()
}
}