| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | protected function deduplicate(array &$data): bool |
||
| 43 | { |
||
| 44 | $criteria = $this->duplicateCriteria($data); |
||
| 45 | |||
| 46 | if (isset($this->duplicates[$criteria])) { |
||
| 47 | //Duplicate is presented, let's reduplicate |
||
| 48 | $data = $this->duplicates[$criteria]; |
||
| 49 | |||
| 50 | //Duplicate is presented |
||
| 51 | return false; |
||
| 52 | } |
||
| 53 | |||
| 54 | //Remember record to prevent future duplicates |
||
| 55 | $this->duplicates[$criteria] = &$data; |
||
| 56 | |||
| 57 | return true; |
||
| 58 | } |
||
| 59 | |||
| 71 | } |