Code Duplication    Length = 23-24 lines in 2 locations

src/Ifsnop/Mysqldump/Mysqldump.php 2 locations

@@ 691-714 (lines=24) @@
688
     * @param string $viewName  Name of view to export
689
     * @return null
690
     */
691
    private function getViewStructureTable($viewName)
692
    {
693
        if (!$this->dumpSettings['skip-comments']) {
694
            $ret = "--" . PHP_EOL .
695
                "-- Stand-In structure for view `${viewName}`" . PHP_EOL .
696
                "--" . PHP_EOL . PHP_EOL;
697
            $this->compressManager->write($ret);
698
        }
699
        $stmt = $this->typeAdapter->show_create_view($viewName);
700
701
        // create views as tables, to resolve dependencies
702
        foreach ($this->dbHandler->query($stmt) as $r) {
703
            if ($this->dumpSettings['add-drop-table']) {
704
                $this->compressManager->write(
705
                    $this->typeAdapter->drop_view($viewName)
706
                );
707
            }
708
709
            $this->compressManager->write(
710
                $this->createStandInTable($viewName)
711
            );
712
            break;
713
        }
714
    }
715
716
    /**
717
     * Write a create table statement for the table Stand-In, show create
@@ 743-765 (lines=23) @@
740
     * @param string $viewName  Name of view to export
741
     * @return null
742
     */
743
    private function getViewStructureView($viewName)
744
    {
745
        if (!$this->dumpSettings['skip-comments']) {
746
            $ret = "--" . PHP_EOL .
747
                "-- View structure for view `${viewName}`" . PHP_EOL .
748
                "--" . PHP_EOL . PHP_EOL;
749
            $this->compressManager->write($ret);
750
        }
751
        $stmt = $this->typeAdapter->show_create_view($viewName);
752
753
        // create views, to resolve dependencies
754
        // replacing tables with views
755
        foreach ($this->dbHandler->query($stmt) as $r) {
756
            // because we must replace table with view, we should delete it
757
            $this->compressManager->write(
758
                $this->typeAdapter->drop_view($viewName)
759
            );
760
            $this->compressManager->write(
761
                $this->typeAdapter->create_view($r)
762
            );
763
            break;
764
        }
765
    }
766
767
    /**
768
     * Trigger structure extractor