<?php

namespace CouponsPlus\App\Coupon\Tree\Data;

class SelectOption
{
    /**
     * Id is always expected to be a string, not an int since comparisons are strict
     * @var string
     */
    public $id;
    /**
     * @var int|string
     */
    public $value;
    public string $label;

    /**
     * @param string|int $id
     * @param string|int $value
     */
    public function __construct($id, $value = null, string $label = null)
    {
        $this->id = (string) $id;
        $this->value = $value ?? $id;
        $this->label = $label ?? (string) $id;
    }
}