Private
Public Access
1
0

chg: pkg: make a massive refactor to the backend and remove all unnecessary deps - and make small refactors for the frontend too #4

This commit is contained in:
2026-04-09 20:21:01 +02:00
parent 23547f4237
commit b55c223d8a
55 changed files with 1567 additions and 4398 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
/**
* This file is part of the SplendidBear Websites' projects.
*
@@ -12,83 +12,56 @@ namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
/**
* Class GameController
*
* @package App\Controller
* @author system7 <https://www.splendidbear.org>
* @package App\Controller
* @author Lang <https://www.splendidbear.org>
* @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. 09.
*/
class GameController extends AbstractController
{
public function __construct(
#[Autowire(env: 'APP_ENV')]
private readonly string $env,
private readonly string $env,
private readonly RequestStack $request,
) {
}
/**
* It is the homepage
*
* @return Response
*/
public function index(): Response
{
return $this->render('Game/index.html.twig');
}
/**
* It is the game itself
*
* @param Request $request
*
* @return Response
*/
public function play(Request $request): Response
public function play(): Response
{
return $this->render('Game/play.html.twig', array(
return $this->render('Game/play.html.twig', [
'env' => $this->env,
'ssl' => $request->isSecure() ? 'true' : 'false',
));
'ssl' => $this->request->getCurrentRequest()->isSecure() ? 'true' : 'false',
]);
}
/**
* It is the Privacy & Policy
*
* @return Response
*/
public function privacy(): Response
{
return $this->render('Official/privacy.html.twig');
}
/**
* It is the Terms of Use
*
* @return Response
*/
public function terms(): Response
{
return $this->render('Official/terms.html.twig');
}
/**
* It is the contact informations
*
* @return Response
*/
public function contact(): Response
{
return $this->render('Official/contact.html.twig');
}
/**
* It is a landing page
*
* @return Response
*/
public function landing(): Response
{
return $this->render('Official/landing.html.twig');