<?php

declare(strict_types=1);

namespace App\Framework\Console;

use Attribute;

/**
 * Attribute to define command groups for better organization and workflows
 */
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final readonly class CommandGroup
{
    public function __construct(
        public string $name,
        public string $description = '',
        public string $icon = '📁',
        public int $priority = 0,
        public array $dependencies = [],
        public array $tags = [],
        public bool $hidden = false
    ) {
    }

    /**
     * Get group name
     */
    public function getName(): string
    {
        return $this->name;
    }

    /**
     * Get group description
     */
    public function getDescription(): string
    {
        return $this->description;
    }

    /**
     * Get group icon
     */
    public function getIcon(): string
    {
        return $this->icon;
    }

    /**
     * Get priority (higher = shown first)
     */
    public function getPriority(): int
    {
        return $this->priority;
    }

    /**
     * Get group dependencies
     */
    public function getDependencies(): array
    {
        return $this->dependencies;
    }

    /**
     * Get group tags
     */
    public function getTags(): array
    {
        return $this->tags;
    }

    /**
     * Check if group is hidden
     */
    public function isHidden(): bool
    {
        return $this->hidden;
    }

    /**
     * Check if group has tag
     */
    public function hasTag(string $tag): bool
    {
        return in_array($tag, $this->tags, true);
    }
}
