Code Duplication    Length = 8-9 lines in 2 locations

code/SimpleDateField.php 2 locations

@@ 107-114 (lines=8) @@
104
            $tsOrError = intval(strtotime($cleanedInput));
105
        }
106
        if (is_numeric($tsOrError) && $tsOrError > 0) {
107
            if (isset($settings['min']) && $minDate = $settings['min']) {
108
                $minDate = strtotime($minDate);
109
                if ($minDate) {
110
                    if ($minDate > $tsOrError) {
111
                        $tsOrError = sprintf(_t('SimpleDateField.VALIDDATEMINDATE', "Your date can not be before %s."), date($settings['dateformat'], $minDate));
112
                    }
113
                }
114
            }
115
            if (isset($settings['max']) && $maxDate = $settings['max']) {
116
                // ISO or strtotime()
117
                $maxDate = strtotime($maxDate);
@@ 115-123 (lines=9) @@
112
                    }
113
                }
114
            }
115
            if (isset($settings['max']) && $maxDate = $settings['max']) {
116
                // ISO or strtotime()
117
                $maxDate = strtotime($maxDate);
118
                if ($maxDate) {
119
                    if ($maxDate < $tsOrError) {
120
                        $tsOrError = sprintf(_t('SimpleDateField.VALIDDATEMAXDATE', "Your date can not be after %s."), date($settings['dateformat'], $maxDate));
121
                    }
122
                }
123
            }
124
        }
125
        if (!$tsOrError) {
126
            if (!trim($rawInput)) {