Code Duplication    Length = 15-15 lines in 2 locations

Command/CreateTenantCommand.php 2 locations

@@ 87-101 (lines=15) @@
84
    protected function interact(InputInterface $input, OutputInterface $output)
85
    {
86
        $default = $input->getOption('default');
87
        if (!$input->getArgument('subdomain') && !$default) {
88
            $subdomain = $this->getHelper('dialog')->askAndValidate(
89
                $output,
90
                '<question>Please enter subdomain:</question>',
91
                function ($subdomain) {
92
                    if (empty($subdomain)) {
93
                        throw new \RuntimeException('Subdomain can not be empty');
94
                    }
95
96
                    return $subdomain;
97
                }
98
            );
99
100
            $input->setArgument('subdomain', $subdomain);
101
        }
102
103
        if (!$input->getArgument('name') && !$default) {
104
            $name = $this->getHelper('dialog')->askAndValidate(
@@ 103-117 (lines=15) @@
100
            $input->setArgument('subdomain', $subdomain);
101
        }
102
103
        if (!$input->getArgument('name') && !$default) {
104
            $name = $this->getHelper('dialog')->askAndValidate(
105
                $output,
106
                '<question>Please enter name:</question>',
107
                function ($name) {
108
                    if (empty($name)) {
109
                        throw new \RuntimeException('Name can not be empty');
110
                    }
111
112
                    return $name;
113
                }
114
            );
115
116
            $input->setArgument('name', $name);
117
        }
118
    }
119
120
    /**