|
7 | 7 | use Laravel\Prompts\ConfirmPrompt; |
8 | 8 | use Laravel\Prompts\SelectPrompt; |
9 | 9 | use Magento\Framework\Console\Cli; |
| 10 | +use OpenForgeProject\MageForge\Model\ThemeAncestor; |
10 | 11 | use OpenForgeProject\MageForge\Model\ThemeList; |
11 | 12 | use OpenForgeProject\MageForge\Service\ThemeSuggester; |
12 | 13 | use Symfony\Component\Console\Command\Command; |
@@ -223,7 +224,7 @@ protected function addParentThemeOptions(): void |
223 | 224 | * @param OutputInterface $output |
224 | 225 | * @param string $label |
225 | 226 | * @param array<string> $parents |
226 | | - * @param array<mixed> $chains |
| 227 | + * @param array<array<ThemeAncestor>> $chains |
227 | 228 | * @return bool |
228 | 229 | */ |
229 | 230 | protected function confirmParentThemes( |
@@ -269,23 +270,23 @@ protected function confirmParentThemes( |
269 | 270 | * Render a theme and its ancestors as an indented tree, child on top. |
270 | 271 | * |
271 | 272 | * @param string $themeCode |
272 | | - * @param array<mixed> $chain |
| 273 | + * @param array<ThemeAncestor> $chain |
273 | 274 | * @return void |
274 | 275 | */ |
275 | 276 | protected function renderInheritanceTree(string $themeCode, array $chain): void |
276 | 277 | { |
277 | 278 | $this->io->newLine(); |
278 | 279 | $this->io->writeln(sprintf(' <fg=cyan;options=bold>%s</> <fg=gray>(selected)</>', $themeCode)); |
279 | 280 |
|
280 | | - foreach ($chain as $level => $ancestor) { |
| 281 | + foreach (array_values($chain) as $level => $ancestor) { |
281 | 282 | $indent = str_repeat(' ', $level); |
282 | | - $status = $ancestor['skipReason'] === null |
| 283 | + $status = $ancestor->skipReason === null |
283 | 284 | ? '<fg=green>will be built</>' |
284 | | - : sprintf('<fg=gray>skipped: %s</>', $ancestor['skipReason']); |
| 285 | + : sprintf('<fg=gray>skipped: %s</>', $ancestor->skipReason); |
285 | 286 | $this->io->writeln(sprintf( |
286 | 287 | ' %s└─ <fg=yellow>%s</> <fg=gray>(parent)</> · %s', |
287 | 288 | $indent, |
288 | | - $ancestor['code'], |
| 289 | + $ancestor->code, |
289 | 290 | $status, |
290 | 291 | )); |
291 | 292 | } |
|
0 commit comments