style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
@@ -7,6 +7,7 @@ use Illuminate\Console\Command;
final class InspectModulesCommand extends Command
{
protected $signature = 'module:inspect {name?} {--json}';
protected $description = 'Validate module manifests and display dependencies and providers.';
public function handle(): int
@@ -16,8 +17,14 @@ final class InspectModulesCommand extends Command
$rows = [];
foreach ($files as $file) {
$manifest = json_decode((string) file_get_contents($file), true);
if (! is_array($manifest)) { $this->error("Invalid JSON: {$file}"); return self::FAILURE; }
if ($name && strcasecmp((string) ($manifest['name'] ?? ''), (string) $name) !== 0) { continue; }
if (! is_array($manifest)) {
$this->error("Invalid JSON: {$file}");
return self::FAILURE;
}
if ($name && strcasecmp((string) ($manifest['name'] ?? ''), (string) $name) !== 0) {
continue;
}
$rows[] = [
'name' => $manifest['name'] ?? basename(dirname($file)),
'version' => $manifest['version'] ?? 'unknown',
@@ -25,8 +32,13 @@ final class InspectModulesCommand extends Command
'providers' => count($manifest['providers'] ?? []),
];
}
if ($this->option('json')) { $this->line(json_encode($rows, JSON_PRETTY_PRINT)); return self::SUCCESS; }
if ($this->option('json')) {
$this->line(json_encode($rows, JSON_PRETTY_PRINT));
return self::SUCCESS;
}
$this->table(['Module', 'Version', 'Requires', 'Providers'], $rows);
return self::SUCCESS;
}
}