Code Duplication    Length = 12-12 lines in 3 locations

src/Property/Event/RecurrenceRule.php 3 locations

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