<?php

declare(strict_types=1);

namespace PpPhp\Core\Designer\Inspector;

final class DesignerInspectorDefinition
{
    public function __construct(
        private readonly array $target,
        private readonly array $breadcrumb = [],
        private readonly array $tabs = [],
        private readonly array $actions = [],
        private readonly array $metadata = []
    ) {}

    public static function create(array $target, array $breadcrumb, array $tabs, array $actions = [], array $metadata = []): self
    {
        return new self($target, $breadcrumb, $tabs, $actions, $metadata);
    }

    public function toArray(): array
    {
        return [
            'target' => $this->target,
            'breadcrumb' => $this->breadcrumb,
            'tabs' => $this->tabs,
            'actions' => $this->actions,
            'metadata' => $this->metadata,
        ];
    }
}
