diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-05 02:08:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-05 02:08:55 +0900 |
| commit | d59da23db4aeabd1c6807bcddce562e19b645796 (patch) | |
| tree | 512b8f0b7e102578271c58f7e30f112e8ecbfabf /crates/shirabe/src/installer/installation_manager.rs | |
| parent | b62d937331860b5cf17737c9f6be8a015bda102c (diff) | |
| download | php-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.tar.gz php-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.tar.zst php-shirabe-d59da23db4aeabd1c6807bcddce562e19b645796.zip | |
feat(installer): wire InstallerInterface marker-trait downcasts
Add as_binary_presence_interface and as_plugin_installer_mut to
InstallerInterface following the downloader marker-trait downcast
pattern, so InstallationManager can model the PHP instanceof checks in
ensureBinariesPresence and disablePlugins. Make BinaryPresenceInterface
take &mut self, resolving LibraryInstaller's stubbed trait impl.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/installation_manager.rs')
| -rw-r--r-- | crates/shirabe/src/installer/installation_manager.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs index 073625b..8275b41 100644 --- a/crates/shirabe/src/installer/installation_manager.rs +++ b/crates/shirabe/src/installer/installation_manager.rs @@ -96,10 +96,9 @@ impl InstallationManager { /// code is ever executed. pub fn disable_plugins(&mut self) { for installer in self.installers.iter_mut() { - // TODO(phase-b): $installer instanceof PluginInstaller downcast - let plugin_installer: Option<&mut PluginInstaller> = None; - let _ = plugin_installer; - // if let Some(pi) = plugin_installer { pi.disable_plugins(); } + if let Some(plugin_installer) = installer.as_plugin_installer_mut() { + plugin_installer.disable_plugins(); + } } } @@ -161,12 +160,9 @@ impl InstallationManager { }; // if the given installer support installing binaries - // TODO(phase-b): $installer instanceof BinaryPresenceInterface downcast - let bp: Option<&dyn BinaryPresenceInterface> = None; - if let Some(bp) = bp { + if let Some(bp) = installer.as_binary_presence_interface() { bp.ensure_binaries_presence(package); } - let _ = installer; } /// Executes solver operation. |
