Skip to content

Commit 817908e

Browse files
committed
rearrange email / user question order
1 parent ef86d91 commit 817908e

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

src/Maker/MakeResetPassword.php

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bundle\MakerBundle\Generator;
1919
use Symfony\Bundle\MakerBundle\InputConfiguration;
2020
use Symfony\Bundle\MakerBundle\Security\InteractiveSecurityHelper;
21-
use Symfony\Bundle\MakerBundle\Str;
2221
use Symfony\Bundle\MakerBundle\Util\YamlSourceManipulator;
2322
use Symfony\Bundle\MakerBundle\Validator;
2423
use Symfony\Component\Console\Command\Command;
@@ -65,13 +64,6 @@ public function configureDependencies(DependencyBuilder $dependencies)
6564

6665
public function interact(InputInterface $input, ConsoleStyle $io, Command $command)
6766
{
68-
$io->title('Reset Password Bundle Requires:');
69-
$requirements[] = '1) A user entity has been created.';
70-
$requirements[] = '2) The user entity contains an email property with a getter method.';
71-
$requirements[] = '3) A user repository exists for the user entity.'."\n";
72-
$requirements[] = '<fg=yellow>bin/console make:user</> will generate the user entity and it\'s repository...'."\n";
73-
$io->text($requirements);
74-
7567
// initialize arguments & commands that are internal (i.e. meant only to be asked)
7668
$command
7769
->addArgument('from-email-address', InputArgument::REQUIRED)
@@ -83,23 +75,6 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
8375
->addArgument('password-setter')
8476
;
8577

86-
$io->section('- Email Templates -');
87-
$emailText[] = 'These are used to generate the email code. Don\'t worry, you can change them in the code later!';
88-
$io->text($emailText);
89-
90-
$input->setArgument('from-email-address', $io->ask(
91-
'What email address will be used to send reset confirmations? e.g. [email protected]',
92-
null,
93-
[Validator::class, 'validateEmailAddress']
94-
));
95-
96-
$input->setArgument('from-email-name', $io->ask(
97-
'What "name" should be associated with that email address? e.g. "Acme Mail Bot"',
98-
null,
99-
[Validator::class, 'notBlank']
100-
)
101-
);
102-
10378
$interactiveSecurityHelper = new InteractiveSecurityHelper();
10479

10580
if (!$this->fileManager->fileExists($path = 'config/packages/security.yaml')) {
@@ -142,6 +117,23 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
142117
);
143118

144119
$io->text(sprintf('Implementing reset password for <info>%s</info>', $userClass));
120+
121+
$io->section('- Email Templates -');
122+
$emailText[] = 'These are used to generate the email code. Don\'t worry, you can change them in the code later!';
123+
$io->text($emailText);
124+
125+
$input->setArgument('from-email-address', $io->ask(
126+
'What email address will be used to send reset confirmations? e.g. [email protected]',
127+
null,
128+
[Validator::class, 'validateEmailAddress']
129+
));
130+
131+
$input->setArgument('from-email-name', $io->ask(
132+
'What "name" should be associated with that email address? e.g. "Acme Mail Bot"',
133+
null,
134+
[Validator::class, 'notBlank']
135+
)
136+
);
145137
}
146138

147139
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator)

0 commit comments

Comments
 (0)