<?php

declare(strict_types=1);

namespace KupShop\KupShopBundle\Metrics;

class StatusSample
{
    protected string $type;
    protected array $labelNames = ['type'];
    protected array $labelValues = [];
    protected mixed $value;

    public function __construct(string $type, mixed $value, array $labelNames = [], array $labelValues = [])
    {
        $this->type = $type;
        $this->value = $value;
        $this->labelNames = array_merge($this->labelNames, $labelNames);
        $this->labelValues = array_merge([$type], $labelValues);
    }

    public function toArray(): array
    {
        return [
            'name' => 'kupshop_status',
            'labelNames' => $this->labelNames,
            'labelValues' => $this->labelValues,
            'value' => $this->value,
        ];
    }
}
