Code Duplication    Length = 5-7 lines in 3 locations

class/EventHandler.php 3 locations

@@ 2386-2390 (lines=5) @@
2383
            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2384
2385
            $t = [];
2386
            for ($h = 0, $count = count($tFields); $h < $count; ++$h) {
2387
                $t[] = sprintf($flt, $tFields[$h]);
2388
            }
2389
2390
            $filtre = implode(' OR ', $t);
2391
            $filtre = str_replace('#', '%', $filtre);
2392
            $tw[]   = '(' . $filtre . ')';
2393
        }
@@ 2399-2405 (lines=7) @@
2396
        //------------------------------------------------------------
2397
        if (count($orderBy) > 0) {
2398
            $t = [];
2399
            for ($h = 0, $count = count($orderBy); $h < $count; ++$h) {
2400
                if ('' != $orderBy[$h]) {
2401
                    $t[] = $orderBy[$h];
2402
                }
2403
            }
2404
            if (count($t) > 0) {
2405
                $sql .= ' ORDER BY ' . implode(',', $t);
2406
            }
2407
        }
2408
@@ 2517-2521 (lines=5) @@
2514
            $flt = '(' . implode(" {$andor} ", $t1) . ')';
2515
2516
            $t = [];
2517
            for ($h = 0, $count = count($tFields); $h < $count; ++$h) {
2518
                $t[] = sprintf($flt, $tFields[$h]);
2519
            }
2520
2521
            $filtre = implode(' OR ', $t);
2522
            $filtre = str_replace('#', '%', $filtre);
2523
            $sql    .= " AND ($filtre)";
2524
        }