29 lines
835 B
PHP
29 lines
835 B
PHP
<?php
|
|
|
|
namespace Modules\Stylist\Console;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Modules\Stylist\Diagnostics\ThemeInspector;
|
|
|
|
final class InspectThemesCommand extends Command
|
|
{
|
|
protected $signature = 'stylist:inspect';
|
|
|
|
protected $description = 'Display installed themes, inheritance, entry views, and view counts.';
|
|
|
|
public function __construct(private readonly ThemeInspector $inspector)
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function handle(): int
|
|
{
|
|
$themes = $this->inspector->themes();
|
|
$this->table(['Key', 'Name', 'Parent', 'Entry view', 'Views', 'Path'], array_map(fn (array $theme): array => [
|
|
$theme['key'], $theme['name'], $theme['parent'] ?? '—', $theme['entry_view'], $theme['views'], $theme['path'],
|
|
], $themes));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|