<?php
declare(strict_types=1);

namespace App\DataObjects;

use Symfony\Component\HttpFoundation\Request;

class LoginData
{
    public function __construct(
        public ?string $username = '',
        public ?string $password = ''
    ) {
    }

    public static function fromRequest(Request $request): self
    {
        return new self(
            $request->get('_username'),
            $request->get('_password'),
        );
    }
}