diff options
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/input')
7 files changed, 166 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs new file mode 100644 index 0000000..1eb3883 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs @@ -0,0 +1,29 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::console::input::input_interface::InputInterface; + +#[derive(Debug)] +pub struct ArrayInput; + +impl ArrayInput { + pub fn new(parameters: IndexMap<String, PhpMixed>) -> Self { + todo!() + } +} + +impl InputInterface for ArrayInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs new file mode 100644 index 0000000..1f70581 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs @@ -0,0 +1,30 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputArgument; + +impl InputArgument { + pub const REQUIRED: i64 = 1; + pub const OPTIONAL: i64 = 2; + pub const IS_ARRAY: i64 = 4; + + pub fn new(name: &str, mode: Option<i64>, description: &str, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn is_required(&self) -> bool { + todo!() + } + + pub fn is_array(&self) -> bool { + todo!() + } + + pub fn get_default(&self) -> Option<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs new file mode 100644 index 0000000..2e25dea --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; + +pub trait InputInterface { + fn get_first_argument(&self) -> Option<String>; + fn has_parameter_option(&self, values: &[&str], only_params: bool) -> bool; + fn get_parameter_option(&self, values: &[&str], default: PhpMixed, only_params: bool) -> PhpMixed; + fn validate(&self) -> anyhow::Result<()>; + fn get_arguments(&self) -> IndexMap<String, PhpMixed>; + fn get_argument(&self, name: &str) -> PhpMixed; + fn set_argument(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_argument(&self, name: &str) -> bool; + fn get_options(&self) -> IndexMap<String, PhpMixed>; + fn get_option(&self, name: &str) -> PhpMixed; + fn set_option(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_option(&self, name: &str) -> bool; + fn is_interactive(&self) -> bool; + fn set_interactive(&mut self, interactive: bool); +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs new file mode 100644 index 0000000..9c188ba --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs @@ -0,0 +1,46 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputOption; + +impl InputOption { + pub const VALUE_NONE: i64 = 1; + pub const VALUE_REQUIRED: i64 = 2; + pub const VALUE_OPTIONAL: i64 = 4; + pub const VALUE_IS_ARRAY: i64 = 8; + pub const VALUE_NEGATABLE: i64 = 16; + + pub fn new( + name: &str, + shortcut: Option<&str>, + mode: Option<i64>, + description: &str, + default: PhpMixed, + ) -> Self { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn accept_value(&self) -> bool { + todo!() + } + + pub fn is_value_required(&self) -> bool { + todo!() + } + + pub fn is_value_optional(&self) -> bool { + todo!() + } + + pub fn is_array(&self) -> bool { + todo!() + } + + pub fn get_default(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/mod.rs b/crates/shirabe-external-packages/src/symfony/console/input/mod.rs new file mode 100644 index 0000000..fba76f2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/mod.rs @@ -0,0 +1,6 @@ +pub mod array_input; +pub mod input_argument; +pub mod input_interface; +pub mod input_option; +pub mod streamable_input_interface; +pub mod string_input; diff --git a/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs b/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs new file mode 100644 index 0000000..ed4a238 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs @@ -0,0 +1,7 @@ +use crate::symfony::console::input::input_interface::InputInterface; +use shirabe_php_shim::PhpMixed; + +pub trait StreamableInputInterface: InputInterface { + fn set_stream(&mut self, stream: PhpMixed); + fn get_stream(&self) -> Option<PhpMixed>; +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs new file mode 100644 index 0000000..d552380 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs @@ -0,0 +1,29 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::console::input::input_interface::InputInterface; + +#[derive(Debug)] +pub struct StringInput; + +impl StringInput { + pub fn new(input: &str) -> Self { + todo!() + } +} + +impl InputInterface for StringInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} |
