diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-09 00:09:08 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-09 00:09:20 +0900 |
| commit | 436e12381dd79e419dce755718be17b66d73e17f (patch) | |
| tree | 09dc809c64efe407b4049695341519ce26c411b3 /crates/shirabe/src/command/remove_command.rs | |
| parent | 1c0eb589741de4aa52ef941ff9315b34dbe48aa0 (diff) | |
| download | php-shirabe-436e12381dd79e419dce755718be17b66d73e17f.tar.gz php-shirabe-436e12381dd79e419dce755718be17b66d73e17f.tar.zst php-shirabe-436e12381dd79e419dce755718be17b66d73e17f.zip | |
feat(event-dispatcher): unify event dispatch via EventInterface trait
Extract a superclass-trait EventInterface from the base Event.
pool_builder's PrePoolCreateEvent stays deferred: its constructor needs
owned, non-cloneable Request and repository boxes the builder only holds
by reference (owned-payload blocker). The event is plugin-only, so its
construction is re-tagged TODO(plugin).
Co-Authored-By: Claude Opus 4.8 (1M context) <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, 3 insertions, 4 deletions
diff --git a/crates/shirabe/src/command/remove_command.rs b/crates/shirabe/src/command/remove_command.rs index ddb14f0..1857b17 100644 --- a/crates/shirabe/src/command/remove_command.rs +++ b/crates/shirabe/src/command/remove_command.rs @@ -485,18 +485,17 @@ impl RemoveCommand { root_package.set_dev_requires(links.remove("require-dev").unwrap_or_default()); } - // TODO(plugin): dispatch CommandEvent(PluginEvents::COMMAND, 'remove', input, output) - let command_event = crate::plugin::CommandEvent::new( + let mut command_event = crate::plugin::CommandEvent::new( crate::plugin::PluginEvents::COMMAND, "remove", input.clone(), output, ); + let command_event_name = command_event.get_name().to_string(); composer .get_event_dispatcher() .borrow_mut() - // TODO(phase-b): dispatch expects Option<Event>; CommandEvent is a different type - .dispatch(Some(command_event.get_name()), None); + .dispatch(Some(&command_event_name), Some(&mut command_event)); let allow_plugins = composer.get_config().borrow_mut().get("allow-plugins"); let removed_plugins: Vec<String> = |
