Skip to content

Commit 9e2b9fe

Browse files
committed
refactored some of the static output messages
1 parent e3ce0ee commit 9e2b9fe

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/Maker/MakeResetPassword.php

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,17 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
8484
;
8585

8686
$io->section('- Email Templates -');
87-
$emailText[] = 'Please answer the following questions that will be used to generate the email templates.';
88-
$emailText[] = 'If you are unsure of what these answers should be, that\'s ok.';
89-
$emailText[] = 'You can change these later after the templates have been generated.';
87+
$emailText[] = 'These are used to generate the email code. Don\'t worry, you can change them in the code later!';
9088
$io->text($emailText);
9189

9290
$input->setArgument('from-email-address', $io->ask(
93-
'What email address will be used to send reset confirmations? I.e. [email protected]',
91+
'What email address will be used to send reset confirmations? e.g. [email protected]',
9492
null,
9593
[Validator::class, 'validateEmailAddress']
9694
));
9795

9896
$input->setArgument('from-email-name', $io->ask(
99-
'What name will be associated with the email address used to send password reset confirmations? I.e. John Doe or Your Company, LLC.',
97+
'What "name" should be associated with that email address? e.g. "Acme Mail Bot"',
10098
null,
10199
[Validator::class, 'notBlank']
102100
)
@@ -121,8 +119,8 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
121119
)
122120
);
123121

124-
$io->section('- Controller Template -');
125-
$io->comment('<fg=yellow>A named route is required for redirection after a successful reset. Even routes that do not yet exist can be used here.</>');
122+
$io->section('- ResetPasswordController -');
123+
$io->text('<fg=yellow>A named route is used for redirecting after a successful reset. Even a route that does not exist yet can be used here.</>');
126124
$input->setArgument('controller-reset-success-redirect', $io->ask(
127125
'What route should users be redirected to after their password has been successfully reset?',
128126
'app_home',
@@ -269,12 +267,24 @@ public function generate(
269267

270268
$generator->writeChanges();
271269

270+
$this->writeSuccessMessage($io);
272271
$this->successMessage($input, $io, $controllerClassNameDetails->getFullName());
273272
}
274273

275-
private function successMessage(InputInterface $input, ConsoleStyle $io, string $userClassName): void
274+
// @TODO WIP
275+
private function successMessage(InputInterface $input, ConsoleStyle $io, string $userClassName)
276276
{
277-
$io->title('The src files required by Reset Password Bundle have been successfully created.');
277+
//@TODO sprintf these as needed
278+
$newClosing[] = 'Next:';
279+
$newClosing[] = ' 1) Run "php bin/console make:migration" to generate a migration for the new <fg=yellow>"ResetPasswordRequest"</> entity.';
280+
$newClosing[] = ' 2) Review and customize the templates in <fg=yellow>`templates/reset_password`</>.';
281+
$newClosing[] = ' 3) Make sure your <fg=yellow>MAILER_DSN</> env var has the correct settings.';
282+
$io->text($newClosing);
283+
$io->newLine();
284+
$io->text('Then go to "/reset-password" and enjoy!');
285+
286+
//@TODO remove me
287+
$io->newLine(3);
278288
$closing[] = sprintf('Users will be redirect to <info>%s</info> after a password reset is successfully completed.', $input->getArgument('controller-reset-success-redirect'));
279289
$closing[] = sprintf('The route can be changed later in <info>%s::reset()</info>', $userClassName);
280290
$closing[] = 'The "from" email address and name values for the email template can be changed in <info>ResetPasswordController::processRequestForm()</info>';

0 commit comments

Comments
 (0)