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 (!$this->getConfig()->hasEnvironment($environment)) {
87
            $output->writeln('<error>Invalid environment name! Please specify an environment name from your config file.</error>');

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

@@ 79-84 (lines=6) @@
76
        $environment = $input->getOption('environment');
77
        $date = $input->getOption('date');
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 (!$this->getConfig()->hasEnvironment($environment)) {
87
            $output->writeln('<error>Invalid environment name! Please specify an environment name from your config file.</error>');

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
        if (!$this->getConfig()->hasEnvironment($environment)) {
84
            $output->writeln('<error>Invalid environment name! Please specify an environment name from your config file.</error>');

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
    
82
        if (!$this->getConfig()->hasEnvironment($environment)) {
83
            $output->writeln('<error>Invalid environment name! Please specify an environment name from your config file.</error>');