Code Duplication    Length = 18-18 lines in 2 locations

src/Ifsnop/Mysqldump/Mysqldump.php 2 locations

@@ 445-462 (lines=18) @@
442
    private function getDatabaseStructure()
443
    {
444
        // Listing all tables from database
445
        if (empty($this->dumpSettings['include-tables'])) {
446
            // include all tables for now, blacklisting happens later
447
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
448
                array_push($this->tables, current($row));
449
            }
450
        } else {
451
            // include only the tables mentioned in include-tables
452
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
453
                if (in_array(current($row), $this->dumpSettings['include-tables'], true)) {
454
                    array_push($this->tables, current($row));
455
                    $elem = array_search(
456
                        current($row),
457
                        $this->dumpSettings['include-tables']
458
                    );
459
                    unset($this->dumpSettings['include-tables'][$elem]);
460
                }
461
            }
462
        }
463
464
        // Listing all views from database
465
        if (empty($this->dumpSettings['include-views'])) {
@@ 465-482 (lines=18) @@
462
        }
463
464
        // Listing all views from database
465
        if (empty($this->dumpSettings['include-views'])) {
466
            // include all views for now, blacklisting happens later
467
            foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) {
468
                array_push($this->views, current($row));
469
            }
470
        } else {
471
            // include only the tables mentioned in include-tables
472
            foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) {
473
                if (in_array(current($row), $this->dumpSettings['include-views'], true)) {
474
                    array_push($this->views, current($row));
475
                    $elem = array_search(
476
                        current($row),
477
                        $this->dumpSettings['include-views']
478
                    );
479
                    unset($this->dumpSettings['include-views'][$elem]);
480
                }
481
            }
482
        }
483
484
        // Listing all triggers from database
485
        if (false === $this->dumpSettings['skip-triggers']) {