Code Duplication    Length = 23-23 lines in 2 locations

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsBlockHandler.php 2 locations

@@ 375-397 (lines=23) @@
372
        if (isset($visible)) {
373
            $qb->andWhere($eb->eq('b.visible', $qb->createNamedParameter($visible, \PDO::PARAM_INT)));
374
        }
375
        if (isset($module_id)) {
376
            $qb ->fromPrefix('system_blockmodule', 'm')
377
                ->andWhere($eb->eq('m.block_id', 'b.bid'));
378
            if (!empty($module_id)) {
379
                $in=array();
380
                $in[]=0;
381
                $in[]=(int)($module_id);
382
                if ($toponlyblock) {
383
                    $in[]=(int)(-1);
384
                }
385
            } else {
386
                if ($toponlyblock) {
387
                    $in=array(0, -1);
388
                } else {
389
                    $in=0;
390
                }
391
            }
392
            if (is_array($in)) {
393
                $qb->andWhere($eb->in('m.module_id', $in));
394
            } else {
395
                $qb->andWhere($eb->eq('m.module_id', $in));
396
            }
397
        }
398
        if (!empty($blockids)) {
399
            $qb->andWhere($eb->in('b.bid', $blockids));
400
        }
@@ 461-483 (lines=23) @@
458
                $qb->andWhere($eb->eq('b.visible', $qb->createNamedParameter($visible, \PDO::PARAM_INT)));
459
            }
460
461
            if (isset($module_id)) {
462
                $qb ->fromPrefix('system_blockmodule', 'm')
463
                    ->andWhere($eb->eq('m.block_id', 'b.bid'));
464
                if (!empty($module_id)) {
465
                    $in=array();
466
                    $in[]=0;
467
                    $in[]=(int)($module_id);
468
                    if ($toponlyblock) {
469
                        $in[]=(int)(-1);
470
                    }
471
                } else {
472
                    if ($toponlyblock) {
473
                        $in=array(0, -1);
474
                    } else {
475
                        $in=0;
476
                    }
477
                }
478
                if (is_array($in)) {
479
                    $qb->andWhere($eb->in('m.module_id', $in));
480
                } else {
481
                    $qb->andWhere($eb->eq('m.module_id', $in));
482
                }
483
            }
484
            $qb->andWhere($eb->in('b.bid', $non_grouped));
485
            $qb->orderBy($orderby);
486
            $result = $qb->execute();