Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
ApiKey | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package Modules\Admin\Models |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace Modules\Admin\Models; |
16 | |
17 | use phpOMS\Account\AccountStatus; |
18 | |
19 | /** |
20 | * Api key class. |
21 | * |
22 | * @package Modules\Admin\Models |
23 | * @license OMS License 2.0 |
24 | * @link https://jingga.app |
25 | * @since 1.0.0 |
26 | */ |
27 | class ApiKey |
28 | { |
29 | /** |
30 | * Id. |
31 | * |
32 | * @var int |
33 | * @since 1.0.0 |
34 | */ |
35 | public int $id = 0; |
36 | |
37 | /** |
38 | * Names. |
39 | * |
40 | * @var string |
41 | * @since 1.0.0 |
42 | */ |
43 | public string $key = ''; |
44 | |
45 | /** |
46 | * Api key status. |
47 | * |
48 | * @var int |
49 | * @since 1.0.0 |
50 | */ |
51 | public int $status = AccountStatus::INACTIVE; |
52 | |
53 | /** |
54 | * Creator. |
55 | * |
56 | * @var int |
57 | * @since 1.0.0 |
58 | */ |
59 | public int $account = 0; |
60 | |
61 | /** |
62 | * Created. |
63 | * |
64 | * @var \DateTimeImmutable |
65 | * @since 1.0.0 |
66 | */ |
67 | public \DateTimeImmutable $createdAt; |
68 | |
69 | /** |
70 | * Constructor. |
71 | * |
72 | * @since 1.0.0 |
73 | */ |
74 | public function __construct() |
75 | { |
76 | $this->key = \random_bytes(128); |
77 | $this->createdAt = new \DateTimeImmutable('now'); |
78 | } |
79 | } |