Code Duplication    Length = 6-6 lines in 4 locations

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

@@ 84-89 (lines=6) @@
81
        $set = $input->getOption('set');
82
        $unset = $input->getOption('unset');
83
84
        if ($environment === null) {
85
            $environment = $this->getConfig()->getDefaultEnvironment();
86
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
87
        } else {
88
            $output->writeln('<info>using environment</info> ' . $environment);
89
        }
90
91
        if (!$this->getConfig()->hasEnvironment($environment)) {
92
            $output->writeln(sprintf('<error>The environment "%s" does not exist</error>', $environment));

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

@@ 82-87 (lines=6) @@
79
        $date = $input->getOption('date');
80
        $fake = (bool)$input->getOption('fake');
81
82
        if ($environment === null) {
83
            $environment = $this->getConfig()->getDefaultEnvironment();
84
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
85
        } else {
86
            $output->writeln('<info>using environment</info> ' . $environment);
87
        }
88
89
        if (!$this->getConfig()->hasEnvironment($environment)) {
90
            $output->writeln(sprintf('<error>The environment "%s" does not exist</error>', $environment));

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

@@ 77-82 (lines=6) @@
74
        $seedSet = $input->getOption('seed');
75
        $environment = $input->getOption('environment');
76
77
        if ($environment === null) {
78
            $environment = $this->getConfig()->getDefaultEnvironment();
79
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
80
        } else {
81
            $output->writeln('<info>using environment</info> ' . $environment);
82
        }
83
84
        if (!$this->getConfig()->hasEnvironment($environment)) {
85
            $output->writeln(sprintf('<error>The environment "%s" does not exist</error>', $environment));

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

@@ 76-81 (lines=6) @@
73
        $environment = $input->getOption('environment');
74
        $format = $input->getOption('format');
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
        if (!$this->getConfig()->hasEnvironment($environment)) {
84
            $output->writeln(sprintf('<error>The environment "%s" does not exist</error>', $environment));