1 | <?php namespace Limoncello\Testing; |
||
26 | class CommandsDebugIo implements CommandsDebugIoInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $arguments; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $options; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | private $records = []; |
||
42 | |||
43 | /** |
||
44 | * @param array $arguments |
||
45 | * @param array $options |
||
46 | */ |
||
47 | 2 | public function __construct(array $arguments = [], array $options = []) |
|
52 | |||
53 | /** |
||
54 | * @inheritdoc |
||
55 | */ |
||
56 | 1 | public function hasArgument(string $name): bool |
|
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | 1 | public function getArgument(string $name) |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 1 | public function getArguments(): array |
|
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | 1 | public function hasOption(string $name): bool |
|
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | 1 | public function getOption(string $name) |
|
92 | |||
93 | /** |
||
94 | * @inheritdoc |
||
95 | */ |
||
96 | 1 | public function getOptions(): array |
|
100 | |||
101 | /** |
||
102 | * @inheritdoc |
||
103 | * |
||
104 | * @throws Exception |
||
105 | */ |
||
106 | 1 | public function writeInfo(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
110 | |||
111 | /** |
||
112 | * @inheritdoc |
||
113 | * |
||
114 | * @throws Exception |
||
115 | */ |
||
116 | 1 | public function writeWarning(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | * |
||
124 | * @throws Exception |
||
125 | */ |
||
126 | 1 | public function writeError(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
130 | |||
131 | /** |
||
132 | * @inheritdoc |
||
133 | */ |
||
134 | 1 | public function getRecords(): array |
|
138 | |||
139 | /** |
||
140 | * @inheritdoc |
||
141 | */ |
||
142 | 1 | public function getInfoRecords(): array |
|
146 | |||
147 | /** |
||
148 | * @inheritdoc |
||
149 | */ |
||
150 | 1 | public function getWarningRecords(): array |
|
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | 1 | public function getErrorRecords(): array |
|
162 | |||
163 | /** |
||
164 | * @inheritdoc |
||
165 | */ |
||
166 | 1 | public function clearRecords(): CommandsDebugIoInterface |
|
172 | |||
173 | /** |
||
174 | * @param int $type |
||
175 | * @param int $verbosity |
||
176 | * @param string $message |
||
177 | * |
||
178 | * @return self |
||
179 | * |
||
180 | * @throws Exception |
||
181 | */ |
||
182 | 1 | private function addRecord(int $type, int $verbosity, string $message): self |
|
193 | |||
194 | /** |
||
195 | * @param array $records |
||
196 | * @param int $type |
||
197 | * |
||
198 | * @return array |
||
199 | */ |
||
200 | 1 | private function filterRecordsByType(array $records, int $type): array |
|
212 | } |
||
213 |