Code Duplication    Length = 10-10 lines in 4 locations

src/Property/Event/RecurrenceRule.php 4 locations

@@ 320-329 (lines=10) @@
317
     *
318
     * @return $this
319
     */
320
    public function setByWeekNo($value)
321
    {
322
        if (!is_integer($value) || $value > 53 || $value < -53 || $value === 0) {
323
            throw new InvalidArgumentException('Invalid value for BYWEEKNO');
324
        }
325
326
        $this->byWeekNo = $value;
327
328
        return $this;
329
    }
330
331
    /**
332
     * The BYYEARDAY rule part specifies a COMMA-separated list of days of the year.
@@ 403-412 (lines=10) @@
400
     *
401
     * @throws \InvalidArgumentException
402
     */
403
    public function setByHour($value)
404
    {
405
        if (!is_integer($value) || $value < 0 || $value > 23) {
406
            throw new \InvalidArgumentException('Invalid value for BYHOUR');
407
        }
408
409
        $this->byHour = $value;
410
411
        return $this;
412
    }
413
414
    /**
415
     * The BYMINUTE rule part specifies a COMMA-separated list of minutes within an hour.
@@ 424-433 (lines=10) @@
421
     *
422
     * @throws \InvalidArgumentException
423
     */
424
    public function setByMinute($value)
425
    {
426
        if (!is_integer($value) || $value < 0 || $value > 59) {
427
            throw new \InvalidArgumentException('Invalid value for BYMINUTE');
428
        }
429
430
        $this->byMinute = $value;
431
432
        return $this;
433
    }
434
435
    /**
436
     * The BYSECOND rule part specifies a COMMA-separated list of seconds within a minute.
@@ 445-454 (lines=10) @@
442
     *
443
     * @throws \InvalidArgumentException
444
     */
445
    public function setBySecond($value)
446
    {
447
        if (!is_integer($value) || $value < 0 || $value > 60) {
448
            throw new \InvalidArgumentException('Invalid value for BYSECOND');
449
        }
450
451
        $this->bySecond = $value;
452
453
        return $this;
454
    }
455
}
456