Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class SnapshotVersionTrigger implements SnapshotTrigger |
||
22 | { |
||
23 | private const DEFAULT_VERSION_STEP = 10; |
||
24 | |||
25 | /** |
||
26 | * Version step interval. |
||
27 | * |
||
28 | * @var int |
||
29 | */ |
||
30 | private $stepInterval; |
||
31 | |||
32 | /** |
||
33 | * @param int $stepInterval |
||
34 | */ |
||
35 | 8 | public function __construct($stepInterval = self::DEFAULT_VERSION_STEP) |
|
36 | { |
||
37 | 8 | $this->stepInterval = $stepInterval; |
|
38 | 8 | } |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 7 | public function snapshotMustBeCreated(Aggregate $aggregate, Snapshot $previousSnapshot = null): bool |
|
51 | } |
||
52 | } |
||
53 |