Code Duplication    Length = 7-7 lines in 3 locations

src/dbo/fields.php 3 locations

@@ 295-301 (lines=7) @@
292
    }
293
294
    // Check that specified values are integer.
295
    if (!is_intvalue($min_value) ||
296
        !is_intvalue($max_value) ||
297
        (!is_null($def_value) && !is_intvalue($def_value)))
298
    {
299
        debug_write_log(DEBUG_NOTICE, '[field_validate_number] Invalid integer value.');
300
        return ERROR_INVALID_INTEGER_VALUE;
301
    }
302
303
    // Check that specified values are in the range of valid values.
304
    if ($min_value < -MAX_FIELD_INTEGER || $min_value > MAX_FIELD_INTEGER ||
@@ 362-368 (lines=7) @@
359
    }
360
361
    // Check that specified values are float.
362
    if (!is_floatvalue($min_value) ||
363
        !is_floatvalue($max_value) ||
364
        (!is_null($def_value) && !is_floatvalue($def_value)))
365
    {
366
        debug_write_log(DEBUG_NOTICE, '[field_validate_float] Invalid float value.');
367
        return ERROR_INVALID_FLOAT_VALUE;
368
    }
369
370
    // Check that specified values are in the range of valid values.
371
    if (bccomp($min_value, MIN_FIELD_FLOAT) < 0 || bccomp($min_value, MAX_FIELD_FLOAT) > 0 ||
@@ 517-523 (lines=7) @@
514
    }
515
516
    // Check that specified values are integer.
517
    if (!is_intvalue($min_value) ||
518
        !is_intvalue($max_value) ||
519
        (!is_null($def_value) && !is_intvalue($def_value)))
520
    {
521
        debug_write_log(DEBUG_NOTICE, '[field_validate_date] Invalid integer value.');
522
        return ERROR_INVALID_DATE_VALUE;
523
    }
524
525
    // Check that specified values are in the range of valid values.
526
    if ($min_value < MIN_FIELD_DATE || $min_value > MAX_FIELD_DATE ||