Code Duplication    Length = 23-24 lines in 2 locations

src/Ifsnop/Mysqldump/Mysqldump.php 2 locations

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