<?php

namespace Sibs\Stargate\Dto;

class TokenDto extends AbstractDto
{
    /** @var string */
    public $tokenType;

    /** @var string */
    public $value;

    /**
     * Constructor.
     */
    public function __construct(string $tokenType, string $value)
    {
        $this->tokenType = $tokenType;
        $this->value = $value;
    }

    /**
     * From Array.
     */
    public static function fromArray(array $data): self
    {
        return new self(
            $data['tokenType'] ?? '',
            $data['value'] ?? ''
        );
    }
}
