id = $id; $this->user_id = $user_id; $this->attempts_remaining = $attempts_remaining; $this->created_at = $created_at; $this->valid_to = $valid_to; } public function get_user_id(): int { return $this->user_id; } public function get_attempts_remaining(): int { return $this->attempts_remaining; } public function is_expired(): bool { return $this->valid_to < new DateTime(); } public function is_rejected(): bool { return $this->attempts_remaining <= 0; } }