@@ -56,10 +56,10 @@ class AddUserCommand extends Command
5656 private SymfonyStyle $ io ;
5757
5858 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
6363 ) {
6464 parent ::__construct ();
6565 }
@@ -124,7 +124,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
124124 if (null !== $ username ) {
125125 $ this ->io ->text (' > <info>Username</info>: ' .$ username );
126126 } else {
127- $ username = $ this ->io ->ask ('Username ' , null , [ $ this ->validator , ' validateUsername ' ] );
127+ $ username = $ this ->io ->ask ('Username ' , null , $ this ->validator -> validateUsername (...) );
128128 $ input ->setArgument ('username ' , $ username );
129129 }
130130
@@ -135,7 +135,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
135135 if (null !== $ password ) {
136136 $ this ->io ->text (' > <info>Password</info>: ' .u ('* ' )->repeat (u ($ password )->length ()));
137137 } 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 (...) );
139139 $ input ->setArgument ('password ' , $ password );
140140 }
141141
@@ -144,7 +144,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
144144 if (null !== $ email ) {
145145 $ this ->io ->text (' > <info>Email</info>: ' .$ email );
146146 } else {
147- $ email = $ this ->io ->ask ('Email ' , null , [ $ this ->validator , ' validateEmail ' ] );
147+ $ email = $ this ->io ->ask ('Email ' , null , $ this ->validator -> validateEmail (...) );
148148 $ input ->setArgument ('email ' , $ email );
149149 }
150150
@@ -153,7 +153,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
153153 if (null !== $ fullName ) {
154154 $ this ->io ->text (' > <info>Full Name</info>: ' .$ fullName );
155155 } else {
156- $ fullName = $ this ->io ->ask ('Full Name ' , null , [ $ this ->validator , ' validateFullName ' ] );
156+ $ fullName = $ this ->io ->ask ('Full Name ' , null , $ this ->validator -> validateFullName (...) );
157157 $ input ->setArgument ('full-name ' , $ fullName );
158158 }
159159 }
0 commit comments