Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
FixedIdGenerator | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getNewId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare( strict_types = 1 ); |
4 | |
5 | namespace EntitySchema\Maintenance; |
6 | |
7 | use EntitySchema\Domain\Storage\IdGenerator; |
8 | |
9 | /** |
10 | * Returns a constant fixed id |
11 | * |
12 | * This is inteded to be used in maintenance scripts to create some predefined initial EntitySchemas |
13 | * |
14 | * @license GPL-2.0-or-later |
15 | */ |
16 | class FixedIdGenerator implements IdGenerator { |
17 | |
18 | private int $fixId; |
19 | |
20 | public function __construct( int $fixId ) { |
21 | $this->fixId = $fixId; |
22 | } |
23 | |
24 | public function getNewId(): int { |
25 | return $this->fixId; |
26 | } |
27 | |
28 | } |