Code Duplication    Length = 6-6 lines in 4 locations

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

@@ 79-84 (lines=6) @@
76
        $version = $input->getOption('target');
77
        $removeAll = $input->getOption('remove-all');
78
79
        if ($environment === null) {
80
            $environment = $this->getConfig()->getDefaultEnvironment();
81
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
82
        } else {
83
            $output->writeln('<info>using environment</info> ' . $environment);
84
        }
85
86
        if ($version && $removeAll) {
87
            throw new \InvalidArgumentException('Cannot toggle a breakpoint and remove all breakpoints at the same time.');

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

@@ 76-81 (lines=6) @@
73
        $seedSet = $input->getOption('seed');
74
        $environment = $input->getOption('environment');
75
76
        if ($environment === null) {
77
            $environment = $this->getConfig()->getDefaultEnvironment();
78
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
79
        } else {
80
            $output->writeln('<info>using environment</info> ' . $environment);
81
        }
82
83
        $envOptions = $this->getConfig()->getEnvironment($environment);
84
        if (isset($envOptions['adapter'])) {

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

@@ 75-80 (lines=6) @@
72
        $environment = $input->getOption('environment');
73
        $format = $input->getOption('format');
74
75
        if ($environment === null) {
76
            $environment = $this->getConfig()->getDefaultEnvironment();
77
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
78
        } else {
79
            $output->writeln('<info>using environment</info> ' . $environment);
80
        }
81
        if ($format !== null) {
82
            $output->writeln('<info>using format</info> ' . $format);
83
        }

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

@@ 81-86 (lines=6) @@
78
        $date = $input->getOption('date');
79
        $fake = (bool)$input->getOption('fake');
80
81
        if ($environment === null) {
82
            $environment = $this->getConfig()->getDefaultEnvironment();
83
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
84
        } else {
85
            $output->writeln('<info>using environment</info> ' . $environment);
86
        }
87
88
        $envOptions = $this->getConfig()->getEnvironment($environment);
89
        if (isset($envOptions['adapter'])) {