src/Controller/Web/User/UserController.php line 17
<?phpdeclare(strict_types=1);namespace App\Controller\Web\User;use App\Controller\Web\AbstractAppController;use App\Form\User\UserForm;use App\Service\User\UserProfileService;use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;#[IsGranted('ROLE_USER')]#[Route('/{id}', 'user-view')]final class UserController extends AbstractAppController{public function __invoke(Request $request, UserProfileService $userProfileService): Response{$form = $this->createForm(UserForm::class, $this->getUser(), ['validation_groups' => ['update'],'create' => false]);$form->handleRequest($request);if ($form->isSubmitted() && $form->isValid()) {$userProfileService->updateMainProfile($form->getData());$this->sendSavedMessage();return $this->redirectToRoute('dashboard');}return $this->render('dashboard/users/profile.html.twig', ['form' => $form->createView()]);}}