Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 195-210 (lines=16) @@
192
     */
193
    protected function interact(InputInterface $input, OutputInterface $output)
194
    {
195
        if (!$input->getArgument('username')) {
196
            $question = new Question('Please choose a username:');
197
            $question->setValidator(function ($username) {
198
                if (null === $username) {
199
                    throw new \InvalidArgumentException('Username can not be empty');
200
                }
201
202
                return $username;
203
            });
204
            $username = $this->getHelper('question')->ask(
205
                $input,
206
                $output,
207
                $question
208
            );
209
            $input->setArgument('username', $username);
210
        }
211
212
        if (!$input->getArgument('email')) {
213
            $question = new Question('Please choose an email:');
@@ 212-227 (lines=16) @@
209
            $input->setArgument('username', $username);
210
        }
211
212
        if (!$input->getArgument('email')) {
213
            $question = new Question('Please choose an email:');
214
            $question->setValidator(function ($email) {
215
                if (null === $email) {
216
                    throw new \InvalidArgumentException('Email can not be empty');
217
                }
218
219
                return $email;
220
            });
221
            $email = $this->getHelper('question')->ask(
222
                $input,
223
                $output,
224
                $question
225
            );
226
            $input->setArgument('email', $email);
227
        }
228
229
        if (!$input->getArgument('password')) {
230
            $question = new Question('Please choose a password:');