all(); if ($worlds === []) { $this->warn('Keine Bildwelt gefunden.'); return self::SUCCESS; } $incomplete = 0; foreach ($worlds as $world) { $missing = $world->missingFiles(); if ($missing === []) { $this->info(sprintf('✓ %s (%s): %d Plätze', $world->name, $world->key, count($world->slots))); continue; } $incomplete++; $this->error(sprintf('✗ %s (%s): ohne Datei – %s', $world->name, $world->key, implode(', ', $missing))); } $this->newLine(); $this->line($this->slotOverview($worlds)); return $incomplete === 0 ? self::SUCCESS : self::FAILURE; } /** * Which slot is filled by which world – so a template author sees what they may rely on. * * @param array $worlds */ private function slotOverview(array $worlds): string { $slots = []; foreach ($worlds as $world) { foreach (array_keys($world->slots) as $slot) { $slots[$slot][] = $world->key; } } ksort($slots); return collect($slots) ->map(fn (array $keys, string $slot): string => sprintf(' %-18s %s', $slot, implode(', ', $keys))) ->implode(PHP_EOL); } }