aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/update_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-09 00:09:08 +0900
committernsfisis <nsfisis@gmail.com>2026-06-09 00:09:20 +0900
commit436e12381dd79e419dce755718be17b66d73e17f (patch)
tree09dc809c64efe407b4049695341519ce26c411b3 /crates/shirabe/src/command/update_command.rs
parent1c0eb589741de4aa52ef941ff9315b34dbe48aa0 (diff)
downloadphp-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/update_command.rs')
-rw-r--r--crates/shirabe/src/command/update_command.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/update_command.rs b/crates/shirabe/src/command/update_command.rs
index a4fbf99..751203c 100644
--- a/crates/shirabe/src/command/update_command.rs
+++ b/crates/shirabe/src/command/update_command.rs
@@ -306,12 +306,11 @@ impl UpdateCommand {
let mut command_event =
CommandEvent::new(PluginEvents::COMMAND, "update", input.clone(), output);
- // TODO(phase-b): dispatch should accept the CommandEvent itself; passing the
- // event by name only for now to keep types aligned with EventDispatcher::dispatch.
+ let command_event_name = command_event.get_name().to_string();
composer
.get_event_dispatcher()
.borrow_mut()
- .dispatch(Some(command_event.get_name()), None)?;
+ .dispatch(Some(&command_event_name), Some(&mut command_event))?;
composer
.get_installation_manager()