18
18
use Symfony \Bundle \MakerBundle \Generator ;
19
19
use Symfony \Bundle \MakerBundle \InputConfiguration ;
20
20
use Symfony \Bundle \MakerBundle \Security \InteractiveSecurityHelper ;
21
- use Symfony \Bundle \MakerBundle \Str ;
22
21
use Symfony \Bundle \MakerBundle \Util \YamlSourceManipulator ;
23
22
use Symfony \Bundle \MakerBundle \Validator ;
24
23
use Symfony \Component \Console \Command \Command ;
@@ -65,13 +64,6 @@ public function configureDependencies(DependencyBuilder $dependencies)
65
64
66
65
public function interact (InputInterface $ input , ConsoleStyle $ io , Command $ command )
67
66
{
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
-
75
67
// initialize arguments & commands that are internal (i.e. meant only to be asked)
76
68
$ command
77
69
->addArgument ('from-email-address ' , InputArgument::REQUIRED )
@@ -83,23 +75,6 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
83
75
->addArgument ('password-setter ' )
84
76
;
85
77
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
-
103
78
$ interactiveSecurityHelper = new InteractiveSecurityHelper ();
104
79
105
80
if (!$ this ->fileManager ->fileExists ($ path = 'config/packages/security.yaml ' )) {
@@ -142,6 +117,23 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
142
117
);
143
118
144
119
$ 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
+ );
145
137
}
146
138
147
139
public function generate (InputInterface $ input , ConsoleStyle $ io , Generator $ generator )
0 commit comments