<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class RulesListCommand extends AbstractCommand
{
    public function name(): string { return 'rules:list'; }
    public function description(): string { return 'PPphp Rules List'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Rules List');
        $runtime = \PpPhp\Core\Platform\Rules\RulesRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath()); foreach ($runtime->summary()['ruleSets'] as $ruleSet) { $this->line('- ' . $ruleSet['ruleSetId'] . ' rules=' . count($ruleSet['rules']) . ' status=' . $ruleSet['status']); }
        return 0;
    }
}
