aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/event/console_event.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-12 01:01:35 +0900
committernsfisis <nsfisis@gmail.com>2026-06-12 01:01:43 +0900
commit1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch)
tree9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe-external-packages/src/symfony/console/event/console_event.rs
parentddf0a624145b618c05c2ee47414545b99b685f37 (diff)
downloadphp-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst
php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/event/console_event.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/event/console_event.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/event/console_event.rs b/crates/shirabe-external-packages/src/symfony/console/event/console_event.rs
new file mode 100644
index 0000000..96b9a31
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/console/event/console_event.rs
@@ -0,0 +1,40 @@
+use crate::symfony::console::command::command::Command;
+use crate::symfony::console::input::input_interface::InputInterface;
+use crate::symfony::console::output::output_interface::OutputInterface;
+use crate::symfony::contracts::event_dispatcher::event::Event;
+
+/// Allows to inspect input and output of a command.
+#[derive(Debug)]
+pub struct ConsoleEvent {
+ inner: Event,
+ pub(crate) command: Option<Box<dyn Command>>,
+ input: Box<dyn InputInterface>,
+ output: Box<dyn OutputInterface>,
+}
+
+impl ConsoleEvent {
+ pub fn new(
+ command: Option<Box<dyn Command>>,
+ input: Box<dyn InputInterface>,
+ output: Box<dyn OutputInterface>,
+ ) -> Self {
+ Self {
+ inner: Event,
+ command,
+ input,
+ output,
+ }
+ }
+
+ pub fn get_command(&self) -> Option<&dyn Command> {
+ self.command.as_deref()
+ }
+
+ pub fn get_input(&self) -> &dyn InputInterface {
+ self.input.as_ref()
+ }
+
+ pub fn get_output(&self) -> &dyn OutputInterface {
+ self.output.as_ref()
+ }
+}