| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 8 | public function validateConsistency(Interval $interval): bool |
|
| 22 | { |
||
| 23 | 8 | $expectedSum = $this->queryExecutor->calculateHashForInterval( |
|
| 24 | 8 | $this->referencesConfiguration->getReferencedColumn(), |
|
| 25 | 8 | $interval |
|
| 26 | ); |
||
| 27 | 8 | $actualSum = 0; |
|
| 28 | 8 | foreach ($this->referencesConfiguration->getTableReferencesList() as $tableReferences) { |
|
| 29 | 8 | $actualSum += $this->queryExecutor->calculateHashInRelatedTablesForInterval( |
|
| 30 | 8 | $tableReferences, |
|
| 31 | 8 | $interval |
|
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | 8 | return $expectedSum === $actualSum; |
|
| 36 | } |
||
| 37 | } |
||
| 38 |