1 | <?php declare(strict_types=1); |
||
28 | class CommandsDebugIo implements CommandsDebugIoInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $arguments; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $options; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $records = []; |
||
44 | |||
45 | /** |
||
46 | * @param array $arguments |
||
47 | * @param array $options |
||
48 | */ |
||
49 | 2 | public function __construct(array $arguments = [], array $options = []) |
|
54 | |||
55 | /** |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | 1 | public function hasArgument(string $name): bool |
|
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 1 | public function getArgument(string $name) |
|
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | */ |
||
74 | 1 | public function getArguments(): array |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 1 | public function hasOption(string $name): bool |
|
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | 1 | public function getOption(string $name) |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 1 | public function getOptions(): array |
|
102 | |||
103 | /** |
||
104 | * @inheritdoc |
||
105 | * |
||
106 | * @throws Exception |
||
107 | */ |
||
108 | 1 | public function writeInfo(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | * |
||
116 | * @throws Exception |
||
117 | */ |
||
118 | 1 | public function writeWarning(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | * |
||
126 | * @throws Exception |
||
127 | */ |
||
128 | 1 | public function writeError(string $message, int $verbosity = self::VERBOSITY_NORMAL): IoInterface |
|
132 | |||
133 | /** |
||
134 | * @inheritdoc |
||
135 | */ |
||
136 | 1 | public function getRecords(): array |
|
140 | |||
141 | /** |
||
142 | * @inheritdoc |
||
143 | */ |
||
144 | 1 | public function getInfoRecords(): array |
|
148 | |||
149 | /** |
||
150 | * @inheritdoc |
||
151 | */ |
||
152 | 1 | public function getWarningRecords(): array |
|
156 | |||
157 | /** |
||
158 | * @inheritdoc |
||
159 | */ |
||
160 | 1 | public function getErrorRecords(): array |
|
164 | |||
165 | /** |
||
166 | * @inheritdoc |
||
167 | */ |
||
168 | 1 | public function clearRecords(): CommandsDebugIoInterface |
|
174 | |||
175 | /** |
||
176 | * @param int $type |
||
177 | * @param int $verbosity |
||
178 | * @param string $message |
||
179 | * |
||
180 | * @return self |
||
181 | * |
||
182 | * @throws Exception |
||
183 | */ |
||
184 | 1 | private function addRecord(int $type, int $verbosity, string $message): self |
|
195 | |||
196 | /** |
||
197 | * @param array $records |
||
198 | * @param int $type |
||
199 | * |
||
200 | * @return array |
||
201 | */ |
||
202 | 1 | private function filterRecordsByType(array $records, int $type): array |
|
214 | } |
||
215 |