<?php

declare(strict_types=1);

namespace PpPhp\Core\Designer\Inspector;

final class DesignerInspectorTab
{
    public function __construct(
        private readonly string $id,
        private readonly string $label,
        private readonly array $fields = []
    ) {}

    public static function create(string $id, string $label, array $fields = []): self
    {
        return new self($id, $label, $fields);
    }

    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'label' => $this->label,
            'fields' => $this->fields,
        ];
    }
}
