5050use Symfony \Component \OptionsResolver \OptionsResolver ;
5151use Symfony \Component \PasswordHasher \Hasher \UserPasswordHasherInterface ;
5252use Symfony \Component \Routing \Annotation \Route ;
53- use Symfony \Component \Security \Core \Encoder \UserPasswordEncoderInterface ;
5453use Symfony \Component \Translation \Translator ;
5554use Symfony \Component \Validator \Constraints \Length ;
5655use Symfony \Component \Validator \Constraints \NotBlank ;
@@ -214,16 +213,6 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
214213 'Form \\'
215214 );
216215
217- /*
218- * @legacy Conditional can be removed when MakerBundle no longer
219- * supports Symfony < 5.2
220- */
221- $ passwordHasher = UserPasswordEncoderInterface::class;
222-
223- if (interface_exists (UserPasswordHasherInterface::class)) {
224- $ passwordHasher = UserPasswordHasherInterface::class;
225- }
226-
227216 $ useStatements = new UseStatementGenerator ([
228217 AbstractController::class,
229218 $ userClassNameDetails ->getFullName (),
@@ -239,7 +228,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
239228 ResetPasswordControllerTrait::class,
240229 ResetPasswordExceptionInterface::class,
241230 ResetPasswordHelperInterface::class,
242- $ passwordHasher ,
231+ UserPasswordHasherInterface::class ,
243232 EntityManagerInterface::class,
244233 ]);
245234
@@ -269,9 +258,6 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
269258 'from_email_name ' => $ this ->fromEmailName ,
270259 'email_getter ' => $ this ->emailGetterMethodName ,
271260 'email_field ' => $ this ->emailPropertyName ,
272- 'password_hasher_class_details ' => ($ passwordClassDetails = $ generator ->createClassNameDetails ($ passwordHasher , '\\' )),
273- 'password_hasher_variable_name ' => str_replace ('Interface ' , '' , sprintf ('$%s ' , lcfirst ($ passwordClassDetails ->getShortName ()))), // @legacy see passwordHasher conditional above
274- 'use_password_hasher ' => UserPasswordHasherInterface::class === $ passwordHasher , // @legacy see passwordHasher conditional above
275261 'problem_validate_message_or_constant ' => $ problemValidateMessageOrConstant ,
276262 'problem_handle_message_or_constant ' => $ problemHandleMessageOrConstant ,
277263 'translator_available ' => $ isTranslatorAvailable ,
0 commit comments