diff options
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/component/console')
37 files changed, 771 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/component/console/application.rs b/crates/shirabe-external-packages/src/symfony/component/console/application.rs new file mode 100644 index 0000000..760e609 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/application.rs @@ -0,0 +1,88 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct Application; + +impl Application { + pub fn new(name: &str, version: &str) -> Self { + todo!() + } + + pub fn run( + &mut self, + input: Option<&mut dyn InputInterface>, + output: Option<&mut dyn OutputInterface>, + ) -> anyhow::Result<i64> { + todo!() + } + + pub fn set_name(&mut self, name: &str) { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn set_version(&mut self, version: &str) { + todo!() + } + + pub fn get_version(&self) -> String { + todo!() + } + + pub fn add(&mut self, command: PhpMixed) -> Option<PhpMixed> { + todo!() + } + + pub fn get(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn set_auto_exit(&mut self, auto_exit: bool) { + todo!() + } + + pub fn set_catch_exceptions(&mut self, catch_exceptions: bool) { + todo!() + } + + pub fn get_helper_set(&self) -> PhpMixed { + todo!() + } + + pub fn set_helper_set(&mut self, helper_set: PhpMixed) { + todo!() + } + + pub fn get_definition(&self) -> PhpMixed { + todo!() + } + + pub fn get_long_version(&self) -> String { + todo!() + } + + pub fn find(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn all(&self, namespace: Option<&str>) -> Vec<PhpMixed> { + todo!() + } + + pub fn get_namespaces(&self) -> Vec<String> { + todo!() + } + + pub fn set_default_command(&mut self, command_name: &str, is_single_command: bool) -> &mut Self { + todo!() + } + + pub fn is_single_command(&self) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs new file mode 100644 index 0000000..cf18378 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs @@ -0,0 +1,81 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[derive(Debug)] +pub struct Command; + +impl Command { + pub fn new(name: Option<&str>) -> Self { + todo!() + } + + pub fn set_name(&mut self, name: &str) -> &mut Self { + todo!() + } + + pub fn get_name(&self) -> Option<String> { + todo!() + } + + pub fn set_description(&mut self, description: &str) -> &mut Self { + todo!() + } + + pub fn get_description(&self) -> String { + todo!() + } + + pub fn set_help(&mut self, help: &str) -> &mut Self { + todo!() + } + + pub fn set_definition(&mut self, definition: PhpMixed) -> &mut Self { + todo!() + } + + pub fn get_definition(&self) -> &InputDefinition { + todo!() + } + + pub fn add_argument(&mut self, name: &str, mode: Option<i64>, description: &str, default: PhpMixed) -> &mut Self { + todo!() + } + + pub fn add_option(&mut self, name: &str, shortcut: Option<&str>, mode: Option<i64>, description: &str, default: PhpMixed) -> &mut Self { + todo!() + } + + pub fn set_aliases(&mut self, aliases: &[String]) -> &mut Self { + todo!() + } + + pub fn get_aliases(&self) -> Vec<String> { + todo!() + } + + pub fn set_hidden(&mut self, hidden: bool) -> &mut Self { + todo!() + } + + pub fn is_hidden(&self) -> bool { + todo!() + } + + pub fn run( + &mut self, + input: &mut dyn InputInterface, + output: &mut dyn OutputInterface, + ) -> anyhow::Result<i64> { + todo!() + } + + pub fn get_helper(&self, name: &str) -> PhpMixed { + todo!() + } + + pub fn get_helper_set(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs new file mode 100644 index 0000000..9fe7961 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs @@ -0,0 +1 @@ +pub mod command; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs new file mode 100644 index 0000000..a4b3d3e --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionInput; + +impl CompletionInput { + pub fn get_completion_type(&self) -> String { + todo!() + } + + pub fn get_completion_name(&self) -> Option<String> { + todo!() + } + + pub fn get_completion_value(&self) -> String { + todo!() + } + + pub fn must_suggest_option_values_for(&self, name: &str) -> bool { + todo!() + } + + pub fn must_suggest_argument_values_for(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs new file mode 100644 index 0000000..709cdcd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs @@ -0,0 +1,14 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionSuggestions; + +impl CompletionSuggestions { + pub fn suggest_values(&mut self, values: Vec<PhpMixed>) { + todo!() + } + + pub fn suggest_value(&mut self, value: PhpMixed) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs new file mode 100644 index 0000000..6300bb0 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs @@ -0,0 +1,2 @@ +pub mod completion_input; +pub mod completion_suggestions; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs new file mode 100644 index 0000000..f1ed60b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct CommandNotFoundException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for CommandNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for CommandNotFoundException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs new file mode 100644 index 0000000..3c42009 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs @@ -0,0 +1 @@ +pub trait ExceptionInterface: std::error::Error {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs new file mode 100644 index 0000000..658ed8c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct InvalidArgumentException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for InvalidArgumentException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for InvalidArgumentException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs new file mode 100644 index 0000000..febda79 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs @@ -0,0 +1,3 @@ +pub mod command_not_found_exception; +pub mod exception_interface; +pub mod invalid_argument_exception; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs new file mode 100644 index 0000000..81a2a87 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs @@ -0,0 +1,2 @@ +pub mod output_formatter; +pub mod output_formatter_style; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs new file mode 100644 index 0000000..1f51e46 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs @@ -0,0 +1,32 @@ +#[derive(Debug)] +pub struct OutputFormatter; + +impl OutputFormatter { + pub fn new(decorated: bool) -> Self { + todo!() + } + + pub fn format(&self, message: &str) -> String { + todo!() + } + + pub fn is_decorated(&self) -> bool { + todo!() + } + + pub fn set_decorated(&mut self, decorated: bool) { + todo!() + } + + pub fn escape(text: &str) -> String { + todo!() + } + + pub fn escape_trailing_backslash(text: &str) -> String { + todo!() + } + + pub fn set_style(&mut self, name: &str, style: crate::symfony::component::console::formatter::output_formatter_style::OutputFormatterStyle) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs new file mode 100644 index 0000000..8be111d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct OutputFormatterStyle; + +impl OutputFormatterStyle { + pub fn new(foreground: Option<&str>, background: Option<&str>, options: Option<Vec<String>>) -> Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs new file mode 100644 index 0000000..eb19ea7 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs @@ -0,0 +1,12 @@ +#[derive(Debug)] +pub struct FormatterHelper; + +impl FormatterHelper { + pub fn format_section(&self, section: &str, message: &str, style: &str) -> String { + todo!() + } + + pub fn format_block(&self, messages: &[&str], style: &str, large: bool) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs new file mode 100644 index 0000000..881aabd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs @@ -0,0 +1,3 @@ +pub trait Helper { + fn get_name(&self) -> String; +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs new file mode 100644 index 0000000..9448310 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct HelperSet; + +impl HelperSet { + pub fn new(helpers: Vec<PhpMixed>) -> Self { + todo!() + } + + pub fn get(&self, name: &str) -> Option<PhpMixed> { + todo!() + } + + pub fn set(&mut self, helper: PhpMixed, alias: Option<&str>) { + todo!() + } + + pub fn has(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs new file mode 100644 index 0000000..4fbb5c3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs @@ -0,0 +1,7 @@ +pub mod formatter_helper; +pub mod helper; +pub mod helper_set; +pub mod progress_bar; +pub mod question_helper; +pub mod table; +pub mod table_separator; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs new file mode 100644 index 0000000..22ca089 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs @@ -0,0 +1,34 @@ +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct ProgressBar; + +impl ProgressBar { + pub fn new(output: &dyn OutputInterface, max: i64) -> Self { + todo!() + } + + pub fn start(&mut self, max: Option<i64>) { + todo!() + } + + pub fn advance(&mut self, step: i64) { + todo!() + } + + pub fn finish(&mut self) { + todo!() + } + + pub fn set_format(&mut self, format: &str) { + todo!() + } + + pub fn get_progress(&self) -> i64 { + todo!() + } + + pub fn get_max_steps(&self) -> i64 { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs new file mode 100644 index 0000000..ade7c06 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs @@ -0,0 +1,18 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::question::question::Question; + +#[derive(Debug)] +pub struct QuestionHelper; + +impl QuestionHelper { + pub fn ask( + &self, + input: &mut dyn InputInterface, + output: &mut dyn OutputInterface, + question: &Question, + ) -> Option<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs new file mode 100644 index 0000000..0244c73 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs @@ -0,0 +1,35 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct Table; + +impl Table { + pub fn new(output: &dyn OutputInterface) -> Self { + todo!() + } + + pub fn set_headers(&mut self, headers: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn set_rows(&mut self, rows: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn add_row(&mut self, row: PhpMixed) -> &mut Self { + todo!() + } + + pub fn render(&mut self) { + todo!() + } + + pub fn set_style(&mut self, style: &str) -> &mut Self { + todo!() + } + + pub fn set_column_widths(&mut self, widths: Vec<i64>) -> &mut Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs new file mode 100644 index 0000000..7b4b2e2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct TableSeparator; + +impl TableSeparator { + pub fn new() -> Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs new file mode 100644 index 0000000..c70e798 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs @@ -0,0 +1,31 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[derive(Debug)] +pub struct ArrayInput; + +impl ArrayInput { + pub fn new(parameters: IndexMap<String, PhpMixed>, definition: Option<InputDefinition>) -> 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 bind(&mut self, _definition: &InputDefinition) -> anyhow::Result<()> { 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/component/console/input/input_definition.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs new file mode 100644 index 0000000..7a46004 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs @@ -0,0 +1,30 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputDefinition; + +impl InputDefinition { + pub fn new(definition: Vec<PhpMixed>) -> Self { + todo!() + } + + pub fn add_argument(&mut self, argument: PhpMixed) { + todo!() + } + + pub fn add_option(&mut self, option: PhpMixed) { + todo!() + } + + pub fn has_option(&self, name: &str) -> bool { + todo!() + } + + pub fn get_option(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn has_argument(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs new file mode 100644 index 0000000..04e302e --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; + +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 bind(&mut self, definition: &crate::symfony::component::console::input::input_definition::InputDefinition) -> anyhow::Result<()>; + fn validate(&self) -> anyhow::Result<()>; + fn get_arguments(&self) -> indexmap::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::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/component/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs new file mode 100644 index 0000000..9c188ba --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/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/component/console/input/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/mod.rs new file mode 100644 index 0000000..1a81599 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/mod.rs @@ -0,0 +1,5 @@ +pub mod array_input; +pub mod input_definition; +pub mod input_interface; +pub mod input_option; +pub mod string_input; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs new file mode 100644 index 0000000..3c401eb --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs @@ -0,0 +1,31 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[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 bind(&mut self, _definition: &InputDefinition) -> anyhow::Result<()> { 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/component/console/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/mod.rs new file mode 100644 index 0000000..b7c65d8 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/mod.rs @@ -0,0 +1,11 @@ +pub mod application; +pub mod command; +pub mod completion; +pub mod exception; +pub mod formatter; +pub mod helper; +pub mod input; +pub mod output; +pub mod question; +pub mod single_command_application; +pub mod terminal; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs new file mode 100644 index 0000000..98133df --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs @@ -0,0 +1,31 @@ +use crate::symfony::component::console::formatter::output_formatter::OutputFormatter; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::output::console_output_interface::ConsoleOutputInterface; + +#[derive(Debug)] +pub struct ConsoleOutput; + +impl ConsoleOutput { + pub fn new(verbosity: i64, decorated: Option<bool>, formatter: Option<OutputFormatter>) -> Self { + todo!() + } + + pub fn get_error_output(&self) -> &dyn OutputInterface { + todo!() + } +} + +impl OutputInterface for ConsoleOutput { + fn write(&mut self, _messages: &str, _newline: bool, _type: i64) { todo!() } + fn writeln(&mut self, _messages: &str, _type: i64) { todo!() } + fn set_verbosity(&mut self, _level: i64) { todo!() } + fn get_verbosity(&self) -> i64 { todo!() } + fn is_quiet(&self) -> bool { todo!() } + fn is_verbose(&self) -> bool { todo!() } + fn is_very_verbose(&self) -> bool { todo!() } + fn is_debug(&self) -> bool { todo!() } + fn set_decorated(&mut self, _decorated: bool) { todo!() } + fn is_decorated(&self) -> bool { todo!() } + fn set_formatter(&mut self, _formatter: OutputFormatter) { todo!() } + fn get_formatter(&self) -> &OutputFormatter { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs new file mode 100644 index 0000000..0e5fc88 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs @@ -0,0 +1,6 @@ +use crate::symfony::component::console::output::output_interface::OutputInterface; + +pub trait ConsoleOutputInterface: OutputInterface { + fn get_error_output(&self) -> &dyn OutputInterface; + fn set_error_output(&mut self, error: Box<dyn OutputInterface>); +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs new file mode 100644 index 0000000..a548a0c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs @@ -0,0 +1,3 @@ +pub mod console_output; +pub mod console_output_interface; +pub mod output_interface; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs new file mode 100644 index 0000000..62a95bb --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs @@ -0,0 +1,26 @@ +use crate::symfony::component::console::formatter::output_formatter::OutputFormatter; + +pub trait OutputInterface { + fn write(&mut self, messages: &str, newline: bool, r#type: i64); + fn writeln(&mut self, messages: &str, r#type: i64); + fn set_verbosity(&mut self, level: i64); + fn get_verbosity(&self) -> i64; + fn is_quiet(&self) -> bool; + fn is_verbose(&self) -> bool; + fn is_very_verbose(&self) -> bool; + fn is_debug(&self) -> bool; + fn set_decorated(&mut self, decorated: bool); + fn is_decorated(&self) -> bool; + fn set_formatter(&mut self, formatter: OutputFormatter); + fn get_formatter(&self) -> &OutputFormatter; +} + +pub const VERBOSITY_QUIET: i64 = 16; +pub const VERBOSITY_NORMAL: i64 = 32; +pub const VERBOSITY_VERBOSE: i64 = 64; +pub const VERBOSITY_VERY_VERBOSE: i64 = 128; +pub const VERBOSITY_DEBUG: i64 = 256; + +pub const OUTPUT_NORMAL: i64 = 1; +pub const OUTPUT_RAW: i64 = 2; +pub const OUTPUT_PLAIN: i64 = 4; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs new file mode 100644 index 0000000..5b32ced --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::question::question::Question; + +#[derive(Debug)] +pub struct ChoiceQuestion(pub Question); + +impl ChoiceQuestion { + pub fn new(question: &str, choices: Vec<PhpMixed>, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn set_multiselect(&mut self, multiselect: bool) { + todo!() + } + + pub fn set_error_message(&mut self, error_message: &str) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs new file mode 100644 index 0000000..e3a42e8 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs @@ -0,0 +1,2 @@ +pub mod choice_question; +pub mod question; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs new file mode 100644 index 0000000..cfbdd25 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs @@ -0,0 +1,46 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Question; + +impl Question { + pub fn new(question: &str, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn set_validator(&mut self, validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>) { + todo!() + } + + pub fn set_max_attempts(&mut self, attempts: Option<i64>) { + todo!() + } + + pub fn set_hidden(&mut self, hidden: bool) { + todo!() + } + + pub fn set_hidden_fallback(&mut self, fallback: bool) { + todo!() + } + + pub fn get_question(&self) -> String { + todo!() + } + + pub fn get_default(&self) -> Option<PhpMixed> { + todo!() + } + + pub fn is_hidden(&self) -> bool { + todo!() + } + + pub fn get_validator(&self) -> Option<&dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>> { + todo!() + } + + pub fn get_max_attempts(&self) -> Option<i64> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs new file mode 100644 index 0000000..9642aa0 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct SingleCommandApplication; + +impl SingleCommandApplication { + pub fn new() -> Self { + todo!() + } + + pub fn set_name(&mut self, name: &str) -> &mut Self { + todo!() + } + + pub fn set_version(&mut self, version: &str) -> &mut Self { + todo!() + } + + pub fn set_code(&mut self, code: Box<dyn Fn(&dyn std::any::Any, &dyn std::any::Any) -> i64>) -> &mut Self { + todo!() + } + + pub fn run(&mut self) -> anyhow::Result<i64> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs new file mode 100644 index 0000000..f960a50 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct Terminal; + +impl Terminal { + pub fn new() -> Self { + todo!() + } + + pub fn get_width(&self) -> i64 { + todo!() + } + + pub fn get_height(&self) -> i64 { + todo!() + } +} |
