Code Duplication    Length = 10-10 lines in 2 locations

src/Traits/OpeningHoursScopes.php 2 locations

@@ 104-113 (lines=10) @@
101
     * @return Builder|static
102
     * @throws InvalidDayName
103
     */
104
    public function scopeOpenOn(Builder $query, string $day)
105
    {
106
        if (! Day::isValid($day)) {
107
            throw new InvalidDayName();
108
        }
109
110
        return $query->whereHas($this->openingHoursRelationName, function (Builder $subquery) use ($day) {
111
            $subquery->where('day', $day);
112
        });
113
    }
114
115
    /**
116
     * Get all models closed at the specified day
@@ 123-132 (lines=10) @@
120
     * @return Builder|static
121
     * @throws InvalidDayName
122
     */
123
    public function scopeClosedOn(Builder $query, string $day)
124
    {
125
        if (! Day::isValid($day)) {
126
            throw new InvalidDayName();
127
        }
128
129
        return $query->whereDoesntHave($this->openingHoursRelationName, function (Builder $subquery) use ($day) {
130
            $subquery->where('day', $day);
131
        });
132
    }
133
134
    /**
135
     * Get all models open at the specified DateTime