Code Duplication    Length = 9-9 lines in 2 locations

app/Handlers/Duty/DutyUsers.php 1 location

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

app/Handlers/Duty/DutyGroups.php 1 location

@@ 57-65 (lines=9) @@
54
        return $this->list;
55
    }
56
    
57
    public function recordNextEntry()
58
    {
59
        if ($this->list->count() < 2) {
60
            return;
61
        }
62
63
        $nextGroupID = $this->list->toArray()[1]['id'];
64
        $this->duty->groups()->updateExistingPivot($nextGroupID, ['last_worked' => Carbon::today()]);
65
    }
66
67
    public function getLastWorked()
68
    {