Code Duplication    Length = 17-21 lines in 2 locations

src/Phinx/Console/Command/Migrate.php 1 location

@@ 92-108 (lines=17) @@
89
90
        // run the migrations
91
        $start = microtime(true);
92
        foreach ($databases as $adapterOptions) {
93
            $this->getManager()->setMigrations(null);
94
95
            if (isset($adapterOptions['dbRef'])) {
96
                $this->getManager()->setDbRef($adapterOptions['dbRef']);
97
            }
98
99
            $this->outputEnvironmentInfo($adapterOptions, $output);
100
101
            if ($date !== null) {
102
                $this->getManager()->migrateToDateTime($environment, new \DateTime($date));
103
            } else {
104
                $this->getManager()->migrate($environment, $version);
105
            }
106
        }
107
108
        $end = microtime(true);
109
        $output->writeln('');
110
        $output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>');
111

src/Phinx/Console/Command/SeedRun.php 1 location

@@ 103-123 (lines=21) @@
100
                }
101
            }
102
        } else {
103
            foreach ($databases as $adapterOptions) {
104
                $this->getManager()->setSeeds(null);
105
106
                if (isset($adapterOptions['dbRef'])) {
107
                    $this->getManager()->setDbRef($adapterOptions['dbRef']);
108
                }
109
110
                $this->outputEnvironmentInfo($adapterOptions, $output);
111
112
                if (empty($seedSet)) {
113
                    // run all the seed(ers)
114
                    $this->getManager()->seed($environment);
115
                } else {
116
                    // run seed(ers) specified in a comma-separated list of classes
117
                    foreach ($seedSet as $seed) {
118
                        $this->getManager()->seed($environment, trim($seed));
119
                    }
120
                }
121
            }
122
        }
123
124
        $end = microtime(true);
125
126
        $output->writeln('');