Code Duplication    Length = 21-21 lines in 2 locations

eZ/Bundle/EzPublishIOBundle/Command/MigrateFilesCommand.php 2 locations

@@ 220-240 (lines=21) @@
217
        $toHandlers,
218
        OutputInterface $output
219
    ) {
220
        if ($fromHandlers) {
221
            if (count($fromHandlers) !== 2) {
222
                $output->writeln("Enter two comma separated values for the --from option: <from_metadata_handler>,<from_binarydata_handler>");
223
224
                return false;
225
            }
226
227
            if (!in_array($fromHandlers[0], array_keys($this->configuredMetadataHandlers))) {
228
                $output->writeln("From meta data handler '$fromHandlers[0]' is not configured.");
229
                $this->outputConfiguredHandlers($output);
230
231
                return false;
232
            }
233
234
            if (!in_array($fromHandlers[1], array_keys($this->configuredBinarydataHandlers))) {
235
                $output->writeln("From binary data handler '$fromHandlers[1]' is not configured.");
236
                $this->outputConfiguredHandlers($output);
237
238
                return false;
239
            }
240
        }
241
242
        if ($toHandlers) {
243
            if (count($toHandlers) !== 2) {
@@ 242-262 (lines=21) @@
239
            }
240
        }
241
242
        if ($toHandlers) {
243
            if (count($toHandlers) !== 2) {
244
                $output->writeln("Enter two comma separated values for the --to option: <to_metadata_handler>,<to_binarydata_handler>");
245
246
                return false;
247
            }
248
249
            if (!in_array($toHandlers[0], array_keys($this->configuredMetadataHandlers))) {
250
                $output->writeln("To meta data handler '$toHandlers[0]' is not configured.");
251
                $this->outputConfiguredHandlers($output);
252
253
                return false;
254
            }
255
256
            if (!in_array($toHandlers[1], array_keys($this->configuredBinarydataHandlers))) {
257
                $output->writeln("To binary data handler '$toHandlers[1]' is not configured.");
258
                $this->outputConfiguredHandlers($output);
259
260
                return false;
261
            }
262
        }
263
264
        if ($fromHandlers && $toHandlers && $fromHandlers === $toHandlers) {
265
            $output->writeln("From and to handlers are the same. Nothing to do.");