Import used classes

This commit is contained in:
Yassine Guedidi
2022-08-28 16:59:43 +02:00
parent dace00d7fb
commit d1d56fbe25
32 changed files with 145 additions and 104 deletions

View File

@ -11,7 +11,9 @@ use Pagerfanta\Pagerfanta;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatorInterface;
@ -139,7 +141,7 @@ class ManageController extends Controller
* Default parameter for page is hardcoded (in duplication of the defaults from the Route)
* because this controller is also called inside the layout template without any page as argument
*
* @return \Symfony\Component\HttpFoundation\Response
* @return Response
*/
public function searchFormAction(Request $request, $page = 1)
{
@ -178,7 +180,7 @@ class ManageController extends Controller
*
* @param User $user The User entity
*
* @return \Symfony\Component\Form\Form The form
* @return Form The form
*/
private function createDeleteForm(User $user)
{

View File

@ -10,7 +10,8 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class NewUserType extends AbstractType
{
@ -27,11 +28,11 @@ class NewUserType extends AbstractType
'first_options' => ['label' => 'user.form.password_label'],
'second_options' => ['label' => 'user.form.repeat_new_password_label'],
'constraints' => [
new Constraints\Length([
new Length([
'min' => 8,
'minMessage' => 'validator.password_too_short',
]),
new Constraints\NotBlank(),
new NotBlank(),
],
'label' => 'user.form.plain_password_label',
])