Code Duplication    Length = 9-9 lines in 2 locations

src/AxillaryClasses/CalenderFactory.php 2 locations

@@ 27-35 (lines=9) @@
24
     *
25
     * @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender
26
     */
27
    public static function fromMonthDay($monthDay)
28
    {
29
        $monthDayTimezone = '/--((?:1[0-2])|(?:0[0-9]))-(0[1-9]|1[0-9]|2[0-9]|3[0-1]|[1-9])([-+][0-1]\d:[0-6]\d|Z*)/';
30
        preg_match_all($monthDayTimezone, $monthDay, $matches, PREG_SET_ORDER, 0);
31
        if (count($matches) != 1 || count($matches[0]) != 4) {
32
            throw new \InvalidArgumentException('Unable to extract month day from input string');
33
        }
34
        return new self(null, $matches[0][1], $matches[0][2], $matches[0][3]);
35
    }
36
37
    /**
38
     * @param string $month
@@ 57-65 (lines=9) @@
54
     *
55
     * @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender
56
     */
57
    public static function fromYearMonth($yearMonth)
58
    {
59
        $yearMonthTimezone = '/(\d{4})-((?:1[0-2])|(?:0[0-9]))([-+][0-1]\d:[0-6]\d|Z*)/';
60
        preg_match_all($yearMonthTimezone, $yearMonth, $matches, PREG_SET_ORDER, 0);
61
        if (count($matches) != 1 || count($matches[0]) != 4) {
62
            throw new \InvalidArgumentException('Unable to extract year month from input string');
63
        }
64
        return new self($matches[0][1], $matches[0][2], null, $matches[0][3]);
65
    }
66
67
    /**
68
     * @param string $year