Code Duplication    Length = 9-9 lines in 2 locations

app/Handlers/Duty/DutyGroups.php 1 location

@@ 47-55 (lines=9) @@
44
        return $collection;
45
    }
46
47
    public function recordNextEntry()
48
    {
49
        if ($this->list->count() < 2) {
50
            return;
51
        }
52
53
        $nextGroupID = $this->list->toArray()[1]['id'];
54
        $this->duty->groups()->updateExistingPivot($nextGroupID, ['last_worked' => Carbon::today()]);
55
    }
56
57
    public function getLastWorked()
58
    {

app/Handlers/Duty/DutyUsers.php 1 location

@@ 73-81 (lines=9) @@
70
    /**
71
     * Grab the next user to work the duty roster and record them in our database so they are the current worker.
72
     */
73
    public function recordNextEntry()
74
    {
75
        if ($this->list->count() < 2) {
76
            return;
77
        }
78
79
        $nextUser = $this->list->toArray()[1]['user'];
80
        $this->duty->users()->updateExistingPivot($nextUser->id, ['last_worked' => Carbon::today()]);
81
    }
82
83
    /**
84
     * Get the current user in our database who is working the duty roster.