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