Code Duplication    Length = 10-11 lines in 7 locations

src/Indatus/Dispatcher/Drivers/DateTime/Scheduler.php 7 locations

@@ 146-156 (lines=11) @@
143
     *
144
     * @return $this
145
     */
146
    public function monthly()
147
    {
148
        $this->setScheduleMonth(self::ANY);
149
        $this->setScheduleWeek(self::NONE);
150
        $this->setScheduleDayOfMonth(1);
151
        $this->setScheduleDayOfWeek(self::ANY);
152
        $this->setScheduleHour(0);
153
        $this->setScheduleMinute(0);
154
155
        return $this;
156
    }
157
158
    /**
159
     * Set the months under which this command will run
@@ 187-197 (lines=11) @@
184
     *
185
     * @return $this
186
     */
187
    public function everyOddWeek()
188
    {
189
        $this->setScheduleMonth(self::ANY);
190
        $this->setScheduleWeek('odd');
191
        $this->setScheduleDayOfMonth(self::ANY);
192
        $this->setScheduleDayOfWeek(self::ANY);
193
        $this->setScheduleHour(0);
194
        $this->setScheduleMinute(0);
195
196
        return $this;
197
    }
198
199
    /**
200
     * Run once every even week at midnight on Sunday morning
@@ 204-214 (lines=11) @@
201
     *
202
     * @return $this
203
     */
204
    public function everyEvenWeek()
205
    {
206
        $this->setScheduleMonth(self::ANY);
207
        $this->setScheduleWeek('even');
208
        $this->setScheduleDayOfMonth(self::ANY);
209
        $this->setScheduleDayOfWeek(self::ANY);
210
        $this->setScheduleHour(0);
211
        $this->setScheduleMinute(0);
212
213
        return $this;
214
    }
215
216
    /**
217
     * Run once a week at midnight on Sunday morning
@@ 221-231 (lines=11) @@
218
     *
219
     * @return $this
220
     */
221
    public function weekly()
222
    {
223
        $this->setScheduleMonth(self::ANY);
224
        $this->setScheduleWeek(self::ANY);
225
        $this->setScheduleDayOfMonth(self::ANY);
226
        $this->setScheduleDayOfWeek(Day::SUNDAY);
227
        $this->setScheduleHour(0);
228
        $this->setScheduleMinute(0);
229
230
        return $this;
231
    }
232
233
    /**
234
     * Run on the given week of each month
@@ 257-267 (lines=11) @@
254
     * @throws BadScheduleException
255
     * @return $this
256
     */
257
    public function weekOfYear($week)
258
    {
259
        $this->setScheduleMonth(self::NONE);
260
        $this->setScheduleWeek($this->parseTimeParameter($week));
261
        $this->setScheduleDayOfMonth(self::ANY);
262
        $this->setScheduleDayOfWeek(Day::SUNDAY);
263
        $this->setScheduleHour(0);
264
        $this->setScheduleMinute(0);
265
266
        return $this;
267
    }
268
269
    /**
270
     * Run once a day at midnight
@@ 274-283 (lines=10) @@
271
     *
272
     * @return $this
273
     */
274
    public function daily()
275
    {
276
        $this->setScheduleMinute(0);
277
        $this->setScheduleHour(0);
278
        $this->setScheduleDayOfMonth(self::ANY);
279
        $this->setScheduleMonth(self::ANY);
280
        $this->setScheduleDayOfWeek(self::ANY);
281
282
        return $this;
283
    }
284
285
    /**
286
     * Set the days of the week under which this command will run
@@ 313-322 (lines=10) @@
310
     *
311
     * @return $this
312
     */
313
    public function hourly()
314
    {
315
        $this->setScheduleMinute(0);
316
        $this->setScheduleHour(self::ANY);
317
        $this->setScheduleDayOfMonth(self::ANY);
318
        $this->setScheduleMonth(self::ANY);
319
        $this->setScheduleDayOfWeek(self::ANY);
320
321
        return $this;
322
    }
323
324
    /**
325
     * Set the hours under which this command will run