@@ -56,10 +56,10 @@ class AddUserCommand extends Command
56
56
private SymfonyStyle $ io ;
57
57
58
58
public function __construct (
59
- private EntityManagerInterface $ entityManager ,
60
- private UserPasswordHasherInterface $ passwordHasher ,
61
- private Validator $ validator ,
62
- private UserRepository $ users
59
+ private readonly EntityManagerInterface $ entityManager ,
60
+ private readonly UserPasswordHasherInterface $ passwordHasher ,
61
+ private readonly Validator $ validator ,
62
+ private readonly UserRepository $ users
63
63
) {
64
64
parent ::__construct ();
65
65
}
@@ -124,7 +124,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
124
124
if (null !== $ username ) {
125
125
$ this ->io ->text (' > <info>Username</info>: ' .$ username );
126
126
} else {
127
- $ username = $ this ->io ->ask ('Username ' , null , [ $ this ->validator , ' validateUsername ' ] );
127
+ $ username = $ this ->io ->ask ('Username ' , null , $ this ->validator -> validateUsername (...) );
128
128
$ input ->setArgument ('username ' , $ username );
129
129
}
130
130
@@ -135,7 +135,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
135
135
if (null !== $ password ) {
136
136
$ this ->io ->text (' > <info>Password</info>: ' .u ('* ' )->repeat (u ($ password )->length ()));
137
137
} else {
138
- $ password = $ this ->io ->askHidden ('Password (your type will be hidden) ' , [ $ this ->validator , ' validatePassword ' ] );
138
+ $ password = $ this ->io ->askHidden ('Password (your type will be hidden) ' , $ this ->validator -> validatePassword (...) );
139
139
$ input ->setArgument ('password ' , $ password );
140
140
}
141
141
@@ -144,7 +144,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
144
144
if (null !== $ email ) {
145
145
$ this ->io ->text (' > <info>Email</info>: ' .$ email );
146
146
} else {
147
- $ email = $ this ->io ->ask ('Email ' , null , [ $ this ->validator , ' validateEmail ' ] );
147
+ $ email = $ this ->io ->ask ('Email ' , null , $ this ->validator -> validateEmail (...) );
148
148
$ input ->setArgument ('email ' , $ email );
149
149
}
150
150
@@ -153,7 +153,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
153
153
if (null !== $ fullName ) {
154
154
$ this ->io ->text (' > <info>Full Name</info>: ' .$ fullName );
155
155
} else {
156
- $ fullName = $ this ->io ->ask ('Full Name ' , null , [ $ this ->validator , ' validateFullName ' ] );
156
+ $ fullName = $ this ->io ->ask ('Full Name ' , null , $ this ->validator -> validateFullName (...) );
157
157
$ input ->setArgument ('full-name ' , $ fullName );
158
158
}
159
159
}
0 commit comments