From 37da0a85a208eada01f61a5c28c945083799f97c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 12 May 2026 04:15:38 +0900 Subject: feat(port): port PreCommandRunEvent.php --- crates/shirabe/src/plugin/pre_command_run_event.rs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/shirabe/src/plugin') diff --git a/crates/shirabe/src/plugin/pre_command_run_event.rs b/crates/shirabe/src/plugin/pre_command_run_event.rs index cf37128..9b8de26 100644 --- a/crates/shirabe/src/plugin/pre_command_run_event.rs +++ b/crates/shirabe/src/plugin/pre_command_run_event.rs @@ -1 +1,30 @@ //! ref: composer/src/Composer/Plugin/PreCommandRunEvent.php + +// TODO(plugin): this event is part of the plugin API and is dispatched before a command runs +use shirabe_external_packages::symfony::console::input::input_interface::InputInterface; +use crate::event_dispatcher::event::Event; + +pub struct PreCommandRunEvent { + inner: Event, + input: Box, + command: String, +} + +impl PreCommandRunEvent { + pub fn new(name: String, input: Box, command: String) -> Self { + let inner = Event::new(name); + Self { + inner, + input, + command, + } + } + + pub fn get_input(&self) -> &dyn InputInterface { + self.input.as_ref() + } + + pub fn get_command(&self) -> &str { + &self.command + } +} -- cgit v1.3.1