1 | <?php |
||
10 | trait IO |
||
11 | { |
||
12 | use InputAwareTrait; |
||
13 | use OutputAwareTrait; |
||
14 | |||
15 | /** |
||
16 | * @var \Symfony\Component\Console\Style\SymfonyStyle |
||
17 | */ |
||
18 | protected $io; |
||
19 | |||
20 | /** |
||
21 | * Provide access to SymfonyStyle object. |
||
22 | * |
||
23 | * @deprecated Use a style injector instead |
||
24 | * |
||
25 | * @return \Symfony\Component\Console\Style\SymfonyStyle |
||
26 | * |
||
27 | * @see http://symfony.com/blog/new-in-symfony-2-8-console-style-guide |
||
28 | */ |
||
29 | protected function io() |
||
36 | |||
37 | /** |
||
38 | * @param string $nonDecorated |
||
39 | * @param string $decorated |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | protected function decorationCharacter($nonDecorated, $decorated) |
||
50 | |||
51 | /** |
||
52 | * @param string $text |
||
53 | */ |
||
54 | protected function say($text) |
||
59 | |||
60 | /** |
||
61 | * @param string $text |
||
62 | * @param int $length |
||
63 | * @param string $color |
||
64 | */ |
||
65 | protected function yell($text, $length = 40, $color = 'green') |
||
71 | |||
72 | /** |
||
73 | * @param string $text |
||
74 | * @param int $length |
||
75 | * @param string $format |
||
76 | */ |
||
77 | protected function formattedOutput($text, $length, $format) |
||
91 | |||
92 | /** |
||
93 | * @param string $question |
||
94 | * @param bool $hideAnswer |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function ask($question, $hideAnswer = false) |
||
105 | |||
106 | /** |
||
107 | * @param string $question |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | protected function askHidden($question) |
||
117 | |||
118 | /** |
||
119 | * @param string $question |
||
120 | * @param string $default |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | protected function askDefault($question, $default) |
||
128 | |||
129 | /** |
||
130 | * @param string $question |
||
131 | * @param bool $default |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function confirm($question, $default = false) |
||
139 | |||
140 | /** |
||
141 | * @param \Symfony\Component\Console\Question\Question $question |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function doAsk(Question $question) |
||
149 | |||
150 | /** |
||
151 | * @param string $message |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | protected function formatQuestion($message) |
||
159 | |||
160 | /** |
||
161 | * @return \Symfony\Component\Console\Helper\QuestionHelper |
||
162 | */ |
||
163 | protected function getDialog() |
||
167 | |||
168 | /** |
||
169 | * @param $text |
||
170 | */ |
||
171 | protected function writeln($text) |
||
175 | } |
||
176 |