diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:43 +0900 |
| commit | 1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch) | |
| tree | 9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe-external-packages/src/symfony/console/style/style_interface.rs | |
| parent | ddf0a624145b618c05c2ee47414545b99b685f37 (diff) | |
| download | php-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/style/style_interface.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/console/style/style_interface.rs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/style/style_interface.rs b/crates/shirabe-external-packages/src/symfony/console/style/style_interface.rs new file mode 100644 index 0000000..c94e450 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/style/style_interface.rs @@ -0,0 +1,72 @@ +use shirabe_php_shim::PhpMixed; + +/// Output style helpers. +pub trait StyleInterface { + /// Formats a command title. + fn title(&mut self, message: &str); + + /// Formats a section title. + fn section(&mut self, message: &str); + + /// Formats a list. + fn listing(&mut self, elements: Vec<PhpMixed>); + + /// Formats informational text. + fn text(&mut self, message: PhpMixed); + + /// Formats a success result bar. + fn success(&mut self, message: PhpMixed); + + /// Formats an error result bar. + fn error(&mut self, message: PhpMixed); + + /// Formats an warning result bar. + fn warning(&mut self, message: PhpMixed); + + /// Formats a note admonition. + fn note(&mut self, message: PhpMixed); + + /// Formats a caution admonition. + fn caution(&mut self, message: PhpMixed); + + /// Formats a table. + fn table(&mut self, headers: Vec<PhpMixed>, rows: Vec<PhpMixed>); + + /// Asks a question. + fn ask( + &mut self, + question: &str, + default: Option<&str>, + validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + ) -> PhpMixed; + + /// Asks a question with the user input hidden. + fn ask_hidden( + &mut self, + question: &str, + validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + ) -> PhpMixed; + + /// Asks for confirmation. + fn confirm(&mut self, question: &str, default: bool) -> bool; + + /// Asks a choice question. + fn choice( + &mut self, + question: &str, + choices: Vec<PhpMixed>, + default: Option<PhpMixed>, + ) -> PhpMixed; + + /// Add newline(s). + fn new_line(&mut self, count: i64); + + /// Starts the progress output. + fn progress_start(&mut self, max: i64); + + /// Advances the progress output X steps. + fn progress_advance(&mut self, step: i64); + + /// Finishes the progress output. + fn progress_finish(&mut self); +} |
