* @category Class * @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License * @link www.splendidbear.org * @since 2026. 04. 11. */ #[AsController] class ProfileController extends AbstractController { public function __construct(private readonly PlayedGameRepository $repo) { } #[Route('/profile', name: 'MineSeekerBundle_profile')] public function index(): Response { /** @var User $user */ $user = $this->getUser(); $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED'); return $this->render('Security/profile.html.twig', [ 'stats' => [ 'total' => $this->repo->countFinishedForUser($user), 'wins' => $this->repo->countWinsForUser($user), 'losses' => $this->repo->countLossesForUser($user), 'bombs' => $this->repo->countBombsForUser($user), ], 'recent' => $this->repo->findRecentFinishedForUser($user), ]); } }