Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
14.29% |
1 / 7 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| TokenData | |
14.29% |
1 / 7 |
|
50.00% |
1 / 2 |
4.52 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Domain\Auth\Data; |
| 6 | |
| 7 | final readonly class TokenData |
| 8 | { |
| 9 | public function __construct( |
| 10 | public string $accessToken, |
| 11 | public string $refreshToken, |
| 12 | public int $expiresIn, |
| 13 | public string $tokenType = 'Bearer' |
| 14 | ) {} |
| 15 | |
| 16 | /** |
| 17 | * @return array<string, int|string>: array |
| 18 | */ |
| 19 | public function toArray(): array |
| 20 | { |
| 21 | return [ |
| 22 | 'accessToken' => $this->accessToken, |
| 23 | 'refreshToken' => $this->refreshToken, |
| 24 | 'tokenType' => $this->tokenType, |
| 25 | 'expiresIn' => $this->expiresIn, |
| 26 | ]; |
| 27 | } |
| 28 | } |