Code Duplication    Length = 6-7 lines in 4 locations

src/controllers/ConstraintsController.php 3 locations

@@ 299-304 (lines=6) @@
296
                    $selColumns = new \PHPPgAdmin\XHtml\XHtmlSelect('TableColumnList', true, 10);
297
                    $selColumns->set_style('width: 15em;');
298
299
                    if ($attrs->recordCount() > 0) {
300
                        while (!$attrs->EOF) {
301
                            $selColumns->add(new \PHPPgAdmin\XHtml\XHtmlOption($attrs->fields['attname']));
302
                            $attrs->moveNext();
303
                        }
304
                    }
305
306
                    $selIndex = new \PHPPgAdmin\XHtml\XHtmlSelect('IndexColumnList[]', true, 10);
307
                    $selIndex->set_style('width: 15em;');
@@ 417-422 (lines=6) @@
414
                $selColumns = new \PHPPgAdmin\XHtml\XHtmlSelect('TableColumnList', true, 10);
415
                $selColumns->set_style('width: 15em;');
416
417
                if ($attrs->recordCount() > 0) {
418
                    while (!$attrs->EOF) {
419
                        $selColumns->add(new \PHPPgAdmin\XHtml\XHtmlOption($attrs->fields['attname']));
420
                        $attrs->moveNext();
421
                    }
422
                }
423
424
                $selIndex = new \PHPPgAdmin\XHtml\XHtmlSelect('IndexColumnList[]', true, 10);
425
                $selIndex->set_style('width: 15em;');
@@ 521-527 (lines=7) @@
518
            $selColumns = new \PHPPgAdmin\XHtml\XHtmlSelect('TableColumnList', true, 10);
519
            $selColumns->set_style('width: 15em;');
520
521
            if ($attrs->recordCount() > 0) {
522
                while (!$attrs->EOF) {
523
                    $new_option = new \PHPPgAdmin\XHtml\XHtmlOption($attrs->fields['attname']);
524
                    $selColumns->add($new_option);
525
                    $attrs->moveNext();
526
                }
527
            }
528
529
            $selIndex = new \PHPPgAdmin\XHtml\XHtmlSelect('IndexColumnList[]', true, 10);
530
            $selIndex->set_style('width: 15em;');

src/controllers/IndexesController.php 1 location

@@ 352-358 (lines=7) @@
349
        $selColumns = new \PHPPgAdmin\XHtml\XHtmlSelect('TableColumnList', true, 10);
350
        $selColumns->set_style('width: 10em;');
351
352
        if ($attrs->recordCount() > 0) {
353
            while (!$attrs->EOF) {
354
                $attname = new \PHPPgAdmin\XHtml\XHtmlOption($attrs->fields['attname']);
355
                $selColumns->add($attname);
356
                $attrs->moveNext();
357
            }
358
        }
359
360
        $selIndex = new \PHPPgAdmin\XHtml\XHtmlSelect('IndexColumnList[]', true, 10);
361
        $selIndex->set_style('width: 10em;');