<?php

declare(strict_types=1);

namespace App\Framework\Design\Parser;

use App\Framework\Filesystem\ValueObjects\FilePath;

/**
 * Ergebnis eines CSS-Parsing-Vorgangs
 */
final readonly class CssParseResult
{
    public function __construct(
        public FilePath|string|null $sourceFile,
        public array $rules,
        public array $customProperties,
        public array $classNames,
        public string $rawContent,
        public array $statistics = []
    ) {
    }

    public static function empty(): self
    {
        return new self(
            sourceFile: null,
            rules: [],
            customProperties: [],
            classNames: [],
            rawContent: '',
            statistics: [
                'total_rules' => 0,
                'total_custom_properties' => 0,
                'total_classes' => 0,
            ]
        );
    }
}
