Code Duplication    Length = 16-16 lines in 2 locations

src/Kunstmaan/AdminBundle/Command/CreateUserCommand.php 2 locations

@@ 162-177 (lines=16) @@
159
     */
160
    protected function interact(InputInterface $input, OutputInterface $output)
161
    {
162
        if (!$input->getArgument('username')) {
163
            $question = New Question('Please choose a username:');
164
            $question->setValidator(function ($username) {
165
                if (null === $username) {
166
                    throw new \InvalidArgumentException('Username can not be empty');
167
                }
168
169
                return $username;
170
            });
171
            $username = $this->getHelper('question')->ask(
172
                $input,
173
                $output,
174
                $question
175
            );
176
            $input->setArgument('username', $username);
177
        }
178
179
        if (!$input->getArgument('email')) {
180
            $question = New Question('Please choose an email:');
@@ 179-194 (lines=16) @@
176
            $input->setArgument('username', $username);
177
        }
178
179
        if (!$input->getArgument('email')) {
180
            $question = New Question('Please choose an email:');
181
            $question->setValidator(function ($email) {
182
                if (null === $email) {
183
                    throw new \InvalidArgumentException('Email can not be empty');
184
                }
185
186
                return $email;
187
            });
188
            $email = $this->getHelper('question')->ask(
189
                $input,
190
                $output,
191
                $question
192
            );
193
            $input->setArgument('email', $email);
194
        }
195
196
        if (!$input->getArgument('password')) {
197