Code Duplication    Length = 9-9 lines in 2 locations

plugins/Field/src/Utility/DateToolbox.php 2 locations

@@ 149-157 (lines=9) @@
146
     * @param string $format Format to validate. e.g. yy:mm:ddQ (invalid)
147
     * @return bool
148
     */
149
    public static function validateDateFormat($format)
150
    {
151
        $format = str_replace(array_keys(static::$_map['date']), '', $format);
152
        $format = preg_replace("/'(.*)'/", '', $format); // remove quotes
153
        $format = preg_replace('/[^a-z]/i', '', $format);
154
        $format = trim($format);
155
156
        return empty($format);
157
    }
158
159
    /**
160
     * Validates a time format for jQuery's datepicker widget.
@@ 165-173 (lines=9) @@
162
     * @param string $format Format to validate. e.g. hh:mm:ssA (invalid)
163
     * @return bool
164
     */
165
    public static function validateTimeFormat($format)
166
    {
167
        $format = str_replace(array_keys(static::$_map['time']), '', $format);
168
        $format = preg_replace("/'(.*)'/", '', $format); // remove quotes
169
        $format = preg_replace('/[^a-z]/i', '', $format);
170
        $format = trim($format);
171
172
        return empty($format);
173
    }
174
175
    /**
176
     * Given a DateField instance, gets its PHP's date-format.