Code Duplication    Length = 12-12 lines in 3 locations

src/Property/Event/RecurrenceRule.php 3 locations

@@ 401-412 (lines=12) @@
398
     *
399
     * @return $this
400
     */
401
    public function setByWeekNo($value)
402
    {
403
        if (!is_integer($value) || $value > 53 || $value < -53 || $value === 0) {
404
            throw new InvalidArgumentException('Invalid value for BYWEEKNO');
405
        }
406
407
        $this->byWeekNo = $value;
408
409
        $this->canUseBySetPos = true;
410
411
        return $this;
412
    }
413
414
    /**
415
     * The BYYEARDAY rule part specifies a COMMA-separated list of days of the year.
@@ 424-435 (lines=12) @@
421
     *
422
     * @return $this
423
     */
424
    public function setByYearDay($day)
425
    {
426
        if (!is_integer($day) || $day > 366 || $day < -366 || $day === 0) {
427
            throw new InvalidArgumentException('Invalid value for BYYEARDAY');
428
        }
429
430
        $this->byYearDay = $day;
431
432
        $this->canUseBySetPos = true;
433
434
        return $this;
435
    }
436
437
    /**
438
     * The BYMONTHDAY rule part specifies a COMMA-separated list of days of the month.
@@ 447-458 (lines=12) @@
444
     *
445
     * @throws \InvalidArgumentException
446
     */
447
    public function setByMonthDay($day)
448
    {
449
        if (!is_integer($day) || $day > 31 || $day < -31 || $day === 0) {
450
            throw new InvalidArgumentException('Invalid value for BYMONTHDAY');
451
        }
452
453
        $this->byMonthDay = $day;
454
455
        $this->canUseBySetPos = true;
456
457
        return $this;
458
    }
459
460
    /**
461
     * The BYDAY rule part specifies a COMMA-separated list of days of the week;.