<?php

namespace App\Modules\ApplicationSession\Application\Find;

use App\Modules\ApplicationSession\Domain\ApplicationSessionRepository;
use App\Modules\ApplicationSession\Domain\ExistsApplicationSessionByToken;

final class ApplicationSessionFinder
{
    public function __construct(private ApplicationSessionRepository $sessionRepository)
    {
    }

    public function __invoke(
        FindApplicationSessionQuery $query
    )
    {
        return $this->sessionRepository->find(new ExistsApplicationSessionByToken($query->token));
    }
}
