aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/io
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-15 20:04:19 +0900
committernsfisis <nsfisis@gmail.com>2026-05-15 20:04:19 +0900
commit5df989b646dbd2c20be83691ca6e807fbfc7212b (patch)
treeceae18cd861fb2224ef1e9d1513713376c618a97 /crates/shirabe/src/io
parentc7df5b68ef4bae43f9dfe51c1c8c766bbddffcc7 (diff)
downloadphp-shirabe-5df989b646dbd2c20be83691ca6e807fbfc7212b.tar.gz
php-shirabe-5df989b646dbd2c20be83691ca6e807fbfc7212b.tar.zst
php-shirabe-5df989b646dbd2c20be83691ca6e807fbfc7212b.zip
feat(port): port NullIO.php
Diffstat (limited to 'crates/shirabe/src/io')
-rw-r--r--crates/shirabe/src/io/null_io.rs63
1 files changed, 63 insertions, 0 deletions
diff --git a/crates/shirabe/src/io/null_io.rs b/crates/shirabe/src/io/null_io.rs
index 6c9f36d..ad41746 100644
--- a/crates/shirabe/src/io/null_io.rs
+++ b/crates/shirabe/src/io/null_io.rs
@@ -1 +1,64 @@
//! ref: composer/src/Composer/IO/NullIO.php
+
+use shirabe_php_shim::PhpMixed;
+use crate::io::base_io::BaseIO;
+use crate::io::io_interface::IOInterface;
+
+#[derive(Debug)]
+pub struct NullIO {
+ inner: BaseIO,
+}
+
+impl IOInterface for NullIO {
+ fn is_interactive(&self) -> bool {
+ false
+ }
+
+ fn is_verbose(&self) -> bool {
+ false
+ }
+
+ fn is_very_verbose(&self) -> bool {
+ false
+ }
+
+ fn is_debug(&self) -> bool {
+ false
+ }
+
+ fn is_decorated(&self) -> bool {
+ false
+ }
+
+ fn write(&self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {
+ }
+
+ fn write_error(&self, _messages: PhpMixed, _newline: bool, _verbosity: i64) {
+ }
+
+ fn overwrite(&self, _messages: PhpMixed, _newline: bool, _size: Option<i64>, _verbosity: i64) {
+ }
+
+ fn overwrite_error(&self, _messages: PhpMixed, _newline: bool, _size: Option<i64>, _verbosity: i64) {
+ }
+
+ fn ask(&self, _question: String, default: PhpMixed) -> PhpMixed {
+ default
+ }
+
+ fn ask_confirmation(&self, _question: String, default: bool) -> bool {
+ default
+ }
+
+ fn ask_and_validate(&self, _question: String, _validator: Box<dyn Fn(PhpMixed) -> PhpMixed>, _attempts: Option<i64>, default: PhpMixed) -> PhpMixed {
+ default
+ }
+
+ fn ask_and_hide_answer(&self, _question: String) -> Option<String> {
+ None
+ }
+
+ fn select(&self, _question: String, _choices: Vec<String>, default: PhpMixed, _attempts: PhpMixed, _error_message: String, _multiselect: bool) -> PhpMixed {
+ default
+ }
+}