src/Controller/TestController.php line 21
<?phpnamespace App\Controller;use App\Entity\User;use App\Service\RegistrationService;use Doctrine\ORM\EntityManagerInterface;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;class TestController extends AbstractController{private $jsonConst = ['json_encode_options' => JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_QUOT, 'groups' => 'api_index'];public function __construct(private EntityManagerInterface $em,) {}#[Route('/', name: 'frontpage')]public function index(): Response{return $this->redirectToRoute('admin_dashboard');}#[Route('/test', name: 'test')]public function test(): Response{return $this->render('test/index.html.twig', []);}#[Route('/api/who', name: 'who')]public function who(): Response{return $this->json($this->getUser(), 200, [], $this->jsonConst);}#[Route('/reg', name: 'reg_admin')]public function reg_admin(RegistrationService $registrationService): Response{$user = new User();$user->setEmail('dev@omedia.su');$user = $registrationService->regSimple($user, '1234');dd($user);}}