Skip to content
Snippets Groups Projects
TokenResponse.php 431 B
Newer Older
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
<?php

namespace App\Service\Response\Classes;

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
use Symfony\Component\DependencyInjection\Attribute\AsAlias;
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
use Symfony\Component\Serializer\Annotation\Groups;

i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
#[AsAlias(id: 'response.token', public: true)]
i.vasilenko@iq-adv.ru's avatar
i.vasilenko@iq-adv.ru committed
class TokenResponse extends Response
{
    /**
     * @var array
     */
    #[Groups(["data"])]
    public array $data;

    public function setToken(string $token)
    {
        $this->data = ['token' => $token];
    }
}