Code Duplication    Length = 5-5 lines in 2 locations

src/Offer/AgeRange.php 2 locations

@@ 104-108 (lines=5) @@
101
        $fromString = $stringValues[0];
102
        $toString = $stringValues[1];
103
104
        if (is_numeric($fromString) || empty($fromString)) {
105
            $from = is_numeric($fromString) ? new Age($fromString) : null;
106
        } else {
107
            throw new InvalidAgeRangeException(
108
                'The "from" age should be a natural number or empty.'
109
            );
110
        }
111
@@ 112-116 (lines=5) @@
109
            );
110
        }
111
112
        if (is_numeric($toString) || empty($toString)) {
113
            $to = is_numeric($toString) ? new Age($toString) : null;
114
        } else {
115
            throw new InvalidAgeRangeException(
116
                'The "to" age should be a natural number or empty.'
117
            );
118
        }
119