Code Duplication    Length = 3-4 lines in 2 locations

src/PhpSpreadsheet/Calculation/LookupRef.php 2 locations

@@ 502-504 (lines=3) @@
499
        $lookup_value = strtolower($lookup_value);
500
501
        //    lookup_value type has to be number, text, or logical values
502
        if ((!is_numeric($lookup_value)) && (!is_string($lookup_value)) && (!is_bool($lookup_value))) {
503
            return Functions::NA();
504
        }
505
506
        //    match_type is 0, 1 or -1
507
        if (($match_type !== 0) && ($match_type !== -1) && ($match_type !== 1)) {
@@ 520-523 (lines=4) @@
517
        //    lookup_array should contain only number, text, or logical values, or empty (null) cells
518
        foreach ($lookup_array as $i => $lookupArrayValue) {
519
            //    check the type of the value
520
            if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) &&
521
                (!is_bool($lookupArrayValue)) && (!is_null($lookupArrayValue))) {
522
                return Functions::NA();
523
            }
524
            //    convert strings to lowercase for case-insensitive testing
525
            if (is_string($lookupArrayValue)) {
526
                $lookup_array[$i] = strtolower($lookupArrayValue);