Code Duplication    Length = 18-18 lines in 2 locations

Command/DownloadDatasetCommand.php 1 location

@@ 72-89 (lines=18) @@
69
            $input->getOption('force-replace')
70
        );
71
        $filepath = $this->downloader->findDownload($dataset, $format, $query);
72
        if ($download) {
73
            $output->writeln(sprintf(
74
                'Dataset %s downloaded to "%s" : %d bytes',
75
                $dataset,
76
                $filepath,
77
                filesize($filepath)
78
            ));
79
        } else {
80
            if (false !== $filepath) {
81
                if (false === $input->getOption('force-replace')) {
82
                    $output->writeln('Existing dataset. To overwrite it, try with --force-replace option');
83
                } else {
84
                    $output->writeln('Error during update of existing dataset.');
85
                }
86
            } else {
87
                $output->writeln('Error during dataset download.');
88
            }
89
        }
90
    }
91
}
92

Command/DownloadDatasetLegacyCommand.php 1 location

@@ 68-85 (lines=18) @@
65
            $input->getOption('force-replace')
66
        );
67
        $filepath = $this->downloader->findDownload($dataset, $format, $query);
68
        if ($download) {
69
            $output->writeln(sprintf(
70
                'Dataset %s downloaded to "%s" : %d bytes',
71
                $dataset,
72
                $filepath,
73
                filesize($filepath)
74
            ));
75
        } else {
76
            if (false !== $filepath) {
77
                if (false === $input->getOption('force-replace')) {
78
                    $output->writeln('Existing dataset. To overwrite it, try with --force-replace option');
79
                } else {
80
                    $output->writeln('Error during update of existing dataset.');
81
                }
82
            } else {
83
                $output->writeln('Error during dataset download.');
84
            }
85
        }
86
    }
87
}
88