Rabbi_Gerzi/backend/app/Auth/Session.php
Yisroel Baum 56ddba707d
format: fix psr12 style issues
phpcbf auto-fixes: string concatenation spacing, single-line class braces, closing brace placement.
2026-05-17 09:45:26 +03:00

42 lines
759 B
PHP

<?php
namespace App\Auth;
use App\User\User;
use DateTimeImmutable;
class Session
{
public function __construct(
private string $token,
private User $user,
private DateTimeImmutable $createdAt,
private DateTimeImmutable $expiresAt,
) {
}
public function getToken(): string
{
return $this->token;
}
public function getUser(): User
{
return $this->user;
}
public function getCreatedAt(): DateTimeImmutable
{
return $this->createdAt;
}
public function getExpiresAt(): DateTimeImmutable
{
return $this->expiresAt;
}
public function isExpired(DateTimeImmutable $now): bool
{
return $now >= $this->expiresAt;
}
}