Code Duplication    Length = 12-12 lines in 4 locations

src/Property/Event/RecurrenceRule.php 4 locations

@@ 378-389 (lines=12) @@
375
     *
376
     * @return $this
377
     */
378
    public function setByMonth($month)
379
    {
380
        if (!is_integer($month) || $month < 0 || $month > 12) {
381
            throw new InvalidArgumentException('Invalid value for BYMONTH');
382
        }
383
384
        $this->byMonth = $month;
385
386
        $this->canUseBySetPos = true;
387
388
        return $this;
389
    }
390
391
    /**
392
     * The BYWEEKNO rule part specifies a COMMA-separated list of ordinals specifying weeks of the year.
@@ 474-485 (lines=12) @@
471
     *
472
     * @throws \InvalidArgumentException
473
     */
474
    public function setByHour($value)
475
    {
476
        if (!is_integer($value) || $value < 0 || $value > 23) {
477
            throw new \InvalidArgumentException('Invalid value for BYHOUR');
478
        }
479
480
        $this->byHour = $value;
481
482
        $this->canUseBySetPos = true;
483
484
        return $this;
485
    }
486
487
    /**
488
     * The BYMINUTE rule part specifies a COMMA-separated list of minutes within an hour.
@@ 497-508 (lines=12) @@
494
     *
495
     * @throws \InvalidArgumentException
496
     */
497
    public function setByMinute($value)
498
    {
499
        if (!is_integer($value) || $value < 0 || $value > 59) {
500
            throw new \InvalidArgumentException('Invalid value for BYMINUTE');
501
        }
502
503
        $this->byMinute = $value;
504
505
        $this->canUseBySetPos = true;
506
507
        return $this;
508
    }
509
510
    /**
511
     * The BYSECOND rule part specifies a COMMA-separated list of seconds within a minute.
@@ 520-531 (lines=12) @@
517
     *
518
     * @throws \InvalidArgumentException
519
     */
520
    public function setBySecond($value)
521
    {
522
        if (!is_integer($value) || $value < 0 || $value > 60) {
523
            throw new \InvalidArgumentException('Invalid value for BYSECOND');
524
        }
525
526
        $this->bySecond = $value;
527
528
        $this->canUseBySetPos = true;
529
530
        return $this;
531
    }
532
}
533