Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ApiToken 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace App\Security;
6
7/**
8 * A Google ID token the API accepts (Authorization: Bearer), shown on the profile page.
9 */
10final readonly class ApiToken
11{
12    public function __construct(
13        public string $token,
14        /** null for fake dev tokens, which don't expire */
15        public ?\DateTimeImmutable $expiresAt,
16        public bool $fake = false,
17    ) {
18    }
19}