<?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 CacheBuildCommand extends AbstractCommand
{
    public function name(): string { return 'cache:build'; }
    public function description(): string { return 'Build platform caches.'; }

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