Code Duplication    Length = 7-8 lines in 2 locations

app/Handlers/Duty/DutyGroups.php 1 location

@@ 97-103 (lines=7) @@
94
            // Does list[i] already have date assigned? Is yes, skip assignment
95
            if (!empty($this->list[$i]['date'])) {
96
                continue;
97
            } else {
98
                $this->list[$i] = [
99
                    'group' => $this->list[$i]['group'],
100
                    'id'    => $this->list[$i]['id'],
101
                    'date'  => $newDatesList[$dateCounter++],
102
                ];
103
            }
104
        }
105
        $this->list = $this->list->sortBy('date');
106

app/Handlers/Duty/DutyUsers.php 1 location

@@ 155-162 (lines=8) @@
152
153
        for ($i = 0; $i < $count; $i++) {
154
            // Does list[i] already have date assigned? Is yes, skip assignment
155
            if (!empty($this->list[$i]['date'])) {
156
                continue;
157
            } else {
158
                $this->list[$i] = [
159
                    'date' => $newDatesList[$dateCounter++],
160
                    'user' => $this->list[$i]['user'],
161
                ];
162
            }
163
        }
164
        $this->list = $this->list->sortBy('date');
165