<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;
use PpPhp\Core\Platform\Developer\PlatformCacheManager;

final class CacheWarmCommand extends AbstractCommand
{
    public function name(): string { return 'cache:warm'; }
    public function description(): string { return 'Warm platform caches.'; }

    public function handle(array $arguments = []): int
    {
        $result = (new PlatformCacheManager())->warm();
        $this->title('Platform Cache Warm');
        $this->line('Classmap: ' . $result['classmap']);
        $this->line('Manifests: ' . $result['manifests']);
        return 0;
    }
}
