Code Duplication    Length = 24-24 lines in 2 locations

Command/MigrationCommand.php 1 location

@@ 72-95 (lines=24) @@
69
                throw new \InvalidArgumentException(sprintf('The migration "%s" does not exist in the migrations table.', $migrationNameOrPath));
70
            }
71
72
            switch ($migration->status) {
73
                case Migration::STATUS_DONE:
74
                    $status = '<info>executed</info>';
75
                    break;
76
                case Migration::STATUS_STARTED:
77
                    $status = '<comment>execution started</comment>';
78
                    break;
79
                case Migration::STATUS_TODO:
80
                    // bold to-migrate!
81
                    $status = '<error>not executed</error>';
82
                    break;
83
                case Migration::STATUS_SKIPPED:
84
                    $status = '<comment>skipped</comment>';
85
                    break;
86
                case Migration::STATUS_PARTIALLY_DONE:
87
                    $status = '<comment>partially executed</comment>';
88
                    break;
89
                case Migration::STATUS_SUSPENDED:
90
                    $status = '<comment>suspended</comment>';
91
                    break;
92
                case Migration::STATUS_FAILED:
93
                    $status = '<error>failed</error>';
94
                    break;
95
            }
96
97
            $output->writeln('<info>Migration: ' . $migration->name . '</info>');
98
            $output->writeln('Status: ' . $status);

Command/StatusCommand.php 1 location

@@ 140-163 (lines=24) @@
137
                    continue;
138
                }
139
140
                switch ($migration->status) {
141
                    case Migration::STATUS_DONE:
142
                        $status = '<info>executed</info>';
143
                        break;
144
                    case Migration::STATUS_STARTED:
145
                        $status = '<comment>execution started</comment>';
146
                        break;
147
                    case Migration::STATUS_TODO:
148
                        // bold to-migrate!
149
                        $status = '<error>not executed</error>';
150
                        break;
151
                    case Migration::STATUS_SKIPPED:
152
                        $status = '<comment>skipped</comment>';
153
                        break;
154
                    case Migration::STATUS_PARTIALLY_DONE:
155
                        $status = '<comment>partially executed</comment>';
156
                        break;
157
                    case Migration::STATUS_SUSPENDED:
158
                        $status = '<comment>suspended</comment>';
159
                        break;
160
                    case Migration::STATUS_FAILED:
161
                        $status = '<error>failed</error>';
162
                        break;
163
                }
164
                $notes = array();
165
                if ($migration->executionError != '') {
166
                    $notes[] = "<error>{$migration->executionError}</error>";