diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-28 03:31:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-28 03:32:04 +0900 |
| commit | c7f53c5d7d581ebf76803650c63ec615b1558dc8 (patch) | |
| tree | c6d83819e82a83cf93ca737b661094a8ea800cec /crates/shirabe/src/command/remove_command.rs | |
| parent | cc5d73c05a0abca2eebcc8a6afa0b1543ee49850 (diff) | |
| download | php-shirabe-refactor/composer-handles.tar.gz php-shirabe-refactor/composer-handles.tar.zst php-shirabe-refactor/composer-handles.zip | |
refactor(composer): represent composer via trait-based handlesrefactor/composer-handles
Replace the PartialComposer/Composer structs and the single
Rc<RefCell<PartialOrFullComposer>> enum with PartialComposer and
Composer traits (Composer: PartialComposer), InnerPartialComposer /
InnerFullComposer data structs, and the handle types FullComposerHandle
(impl Composer) and AnyComposerHandle (polymorphic enum, impl
PartialComposer), plus their weak variants.
Factory builds the full and partial graphs via separate Rc::new_cyclic
branches that share a build_composer_base helper. Call sites now use
trait methods that encapsulate borrowing instead of borrow_partial() /
composer_full*().
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/remove_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/remove_command.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/remove_command.rs b/crates/shirabe/src/command/remove_command.rs index 9ea7329..2b90f80 100644 --- a/crates/shirabe/src/command/remove_command.rs +++ b/crates/shirabe/src/command/remove_command.rs @@ -9,6 +9,7 @@ use shirabe_php_shim::{PhpMixed, UnexpectedValueException, array_map, strtolower use crate::advisory::Auditor; use crate::command::{BaseCommand, BaseCommandData, HasBaseCommandData}; +use crate::composer::{Composer, PartialComposer}; use crate::config::ConfigSourceInterface; use crate::config::JsonConfigSource; use crate::console::input::InputArgument; @@ -184,7 +185,7 @@ impl RemoveCommand { if input.get_option("unused").as_bool().unwrap_or(false) { let composer = self.require_composer(None, None)?; - let mut composer = crate::command::composer_full_mut(&composer); + let composer = crate::command::composer_full(&composer); { let locker = composer.get_locker().clone(); let mut locker = locker.borrow_mut(); @@ -430,7 +431,7 @@ impl RemoveCommand { // TODO(plugin): deactivate installed plugins if let Some(composer_opt) = self.try_composer(None, None) { - let mut composer_opt = crate::command::composer_full_mut(&composer_opt); + let composer_opt = crate::command::composer_full(&composer_opt); composer_opt .get_plugin_manager() .borrow_mut() @@ -439,7 +440,7 @@ impl RemoveCommand { self.reset_composer(); let composer_handle = self.require_composer(None, None)?; - let mut composer = crate::command::composer_full_mut(&composer_handle); + let composer = crate::command::composer_full(&composer_handle); if dry_run { // TODO(phase-b): composer.get_package() returns &dyn RootPackageInterface; set_requires/set_dev_requires need &mut self; needs shared-ownership refactor |
