Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
FixedIdGenerator
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getNewId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types = 1 );
4
5namespace EntitySchema\Maintenance;
6
7use 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 */
16class 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}