aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-12 04:15:38 +0900
committernsfisis <nsfisis@gmail.com>2026-05-12 04:15:38 +0900
commit37da0a85a208eada01f61a5c28c945083799f97c (patch)
treea1eb63ffe0404d970a0da274dd4b1348ba228238 /crates
parentfce5d59aeb5a1fdc07a0fa4b74f38ded23d9551e (diff)
downloadphp-shirabe-37da0a85a208eada01f61a5c28c945083799f97c.tar.gz
php-shirabe-37da0a85a208eada01f61a5c28c945083799f97c.tar.zst
php-shirabe-37da0a85a208eada01f61a5c28c945083799f97c.zip
feat(port): port PreCommandRunEvent.php
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe/src/plugin/pre_command_run_event.rs29
1 files changed, 29 insertions, 0 deletions
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<dyn InputInterface>,
+ command: String,
+}
+
+impl PreCommandRunEvent {
+ pub fn new(name: String, input: Box<dyn InputInterface>, 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
+ }
+}