1 | <?php |
||
23 | class ImagineStyle implements ImagineStyleInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var SymfonyStyle |
||
27 | */ |
||
28 | private $io; |
||
29 | |||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $decoration; |
||
34 | |||
35 | /** |
||
36 | * @param InputInterface $input |
||
37 | * @param OutputInterface $output |
||
38 | * @param bool $decoration |
||
39 | */ |
||
40 | public function __construct(InputInterface $input, OutputInterface $output, bool $decoration = true) |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function text(string $string, array $replacements = []): ImagineStyleInterface |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function line(string $string, array $replacements = []): ImagineStyleInterface |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function newline(int $count = 1): ImagineStyleInterface |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function space(int $count = 1): ImagineStyleInterface |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function separator(string $character = null, int $width = null, string $fg = null, bool $newline = true): ImagineStyleInterface |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function status(string $status, string $fg = null, string $bg = null): ImagineStyleInterface |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function group(string $item, string $group, string $fg = null, string $bg = null): ImagineStyleInterface |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function title(string $title, string $type = null, string $fg = null, string $bg = null): ImagineStyleInterface |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function smallBlock(string $string, string $type, string $fg = null, string $bg = null, string $prefix = null): ImagineStyleInterface |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function largeBlock(string $string, string $type, string $fg = null, string $bg = null, string $prefix = null): ImagineStyleInterface |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function okayBlock(string $string, array $replacements = []): ImagineStyleInterface |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function noteBlock(string $string, array $replacements = []): ImagineStyleInterface |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function critBlock(string $string, array $replacements = []): ImagineStyleInterface |
||
173 | |||
174 | /** |
||
175 | * @param string $title |
||
176 | * @param string|null $type |
||
177 | * |
||
178 | * @return ImagineStyleInterface |
||
179 | */ |
||
180 | private function plainTitle(string $title, string $type = null): ImagineStyleInterface |
||
192 | |||
193 | /** |
||
194 | * @param string $string |
||
195 | * @param string|null $type |
||
196 | * @param string|null $fg |
||
197 | * @param string|null $bg |
||
198 | * @param string|null $prefix |
||
199 | * @param bool $padding |
||
200 | * |
||
201 | * @return ImagineStyleInterface |
||
202 | */ |
||
203 | private function block(string $string, string $type = null, string $fg = null, string $bg = null, string $prefix = null, bool $padding = true): ImagineStyleInterface |
||
213 | |||
214 | /** |
||
215 | * @param string $string |
||
216 | * @param string $type |
||
217 | * |
||
218 | * @return ImagineStyleInterface |
||
219 | */ |
||
220 | private function plainBlock(string $string, string $type): ImagineStyleInterface |
||
227 | |||
228 | /** |
||
229 | * @param string $format |
||
230 | * @param array $replacements |
||
231 | * |
||
232 | * @return string |
||
233 | */ |
||
234 | private function compileString(string $format, array $replacements = []): string |
||
254 | } |
||
255 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: