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
        return $this;

app/Handlers/Duty/DutyUsers.php 1 location

@@ 122-129 (lines=8) @@
119
        $dateCounter = 0;
120
        for ($i = 0; $i < $count; $i++) {
121
            // Does list[i] already have date assigned? Is yes, skip assignment
122
            if (!empty($this->list[$i]['date'])) {
123
                continue;
124
            } else {
125
                $this->list[$i] = [
126
                    'date' => $newDatesList[$dateCounter++],
127
                    'user' => $this->list[$i]['user']
128
                ];             
129
            }
130
        }        
131
        $this->list = $this->list->sortBy('date');
132
        return $this;