<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;
use PpPhp\Core\Platform\Console\ConsolePath;
use PpPhp\Core\Platform\DI\Integration\PlatformContainerRuntime;

final class ContainerDefinitionsCommand extends AbstractCommand
{
    public function name(): string { return 'container:definitions'; }
    public function description(): string { return 'List integrated DI container definitions.'; }

    public function handle(array $arguments = []): int
    {
        $container = (new PlatformContainerRuntime(ConsolePath::basePath()))->container();
        $this->json($container->toArray());
        return 0;
    }
}
