Code Duplication    Length = 9-13 lines in 2 locations

src/Component/TimezoneRule.php 1 location

@@ 64-72 (lines=9) @@
61
     *
62
     * @throws \InvalidArgumentException
63
     */
64
    public function __construct($ruleType)
65
    {
66
        $ruleType = strtoupper($ruleType);
67
        if ($ruleType === self::TYPE_DAYLIGHT || $ruleType === self::TYPE_STANDARD) {
68
            $this->type = $ruleType;
69
        } else {
70
            throw new \InvalidArgumentException('Invalid value for timezone rule type');
71
        }
72
    }
73
74
    /**
75
     * {@inheritdoc}

src/Component/Event.php 1 location

@@ 742-754 (lines=13) @@
739
     *
740
     * @throws \InvalidArgumentException
741
     */
742
    public function setTimeTransparency($transparency)
743
    {
744
        $transparency = strtoupper($transparency);
745
        if ($transparency === self::TIME_TRANSPARENCY_OPAQUE
746
            || $transparency === self::TIME_TRANSPARENCY_TRANSPARENT
747
        ) {
748
            $this->transparency = $transparency;
749
        } else {
750
            throw new \InvalidArgumentException('Invalid value for transparancy');
751
        }
752
753
        return $this;
754
    }
755
756
    /**
757
     * @param $status