1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
//! ref: composer/src/Composer/IO/NullIO.php
use crate::io::base_io::BaseIO;
use crate::io::io_interface::IOInterface;
use shirabe_php_shim::PhpMixed;
#[derive(Debug)]
pub struct NullIO {
authentications: index::IndexMap<String, indexmap::IndexMap<String, Option<String>>>,
}
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
}
fn write_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64) {
<Self as BaseIO>::write_raw(self, messages, newline, verbosity)
}
fn write_error_raw(&self, messages: PhpMixed, newline: bool, verbosity: i64) {
<Self as BaseIO>::write_error_raw(self, messages, newline, verbosity)
}
fn get_authentications(
&self,
) -> indexmap::IndexMap<String, indexmap::IndexMap<String, Option<String>>> {
<Self as BaseIO>::get_authentications(self)
}
fn has_authentication(&self, repository_name: &str) -> bool {
<Self as BaseIO>::has_authentication(self, repository_name)
}
fn get_authentication(
&self,
repository_name: &str,
) -> indexmap::IndexMap<String, Option<String>> {
<Self as BaseIO>::get_authentication(self, repository_name)
}
fn set_authentication(
&mut self,
repository_name: String,
username: String,
password: Option<String>,
) {
<Self as BaseIO>::set_authentication(self, repository_name, username, password)
}
fn load_configuration(&mut self, config: &crate::config::Config) {
<Self as BaseIO>::load_configuration(self, config)
}
}
impl BaseIO for NullIO {
fn authentications(
&self,
) -> &indexmap::IndexMap<String, indexmap::IndexMap<String, Option<String>>> {
&self.authentications
}
fn authentications_mut(
&mut self,
) -> &mut indexmap::IndexMap<String, indexmap::IndexMap<String, Option<String>>> {
&mut self.authentications
}
}
|