Code Duplication    Length = 18-18 lines in 2 locations

src/Ifsnop/Mysqldump/Mysqldump.php 2 locations

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