Private
Public Access
1
0

chg: dev: refactor classes and reformat some layout #3

This commit is contained in:
2019-10-27 18:51:03 +01:00
parent c909c036a3
commit 8355cc90ed
17 changed files with 265 additions and 48 deletions

View File

@@ -1,41 +1,88 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class GameController extends Controller
/**
* Class GameController
*
* @package App\Controller
* @author system7 <https://www.splendidbear.org>
*/
class GameController extends AbstractController
{
public function index()
/**
* It is the homepage
*
* @return Response
*/
public function index(): Response
{
return $this->render('Game/index.html.twig');
}
public function play(Request $request)
/**
* It is the game itself
*
* @param Request $request
*
* @return Response
*/
public function play(Request $request): Response
{
return $this->render('Game/play.html.twig', array(
'env' => $this->container->getParameter('kernel.environment'),
'env' => getenv('APP_ENV'),
'ssl' => $request->isSecure() ? 'true' : 'false'
));
}
public function privacy()
/**
* It is the Privacy & Policy
*
* @return Response
*/
public function privacy(): Response
{
return $this->render('Official/privacy.html.twig');
}
public function terms()
/**
* It is the Terms of Use
*
* @return Response
*/
public function terms(): Response
{
return $this->render('Official/terms.html.twig');
}
public function contact()
/**
* It is the contact informations
*
* @return Response
*/
public function contact(): Response
{
return $this->render('Official/contact.html.twig');
}
public function landing()
/**
* It is a landing page
*
* @return Response
*/
public function landing(): Response
{
return $this->render('Official/landing.html.twig');
}

View File

@@ -1,10 +1,23 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Gamer
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GamerRepository")
*/
class Gamer

View File

@@ -1,10 +1,23 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Grid
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GridRepository")
*/
class Grid

View File

@@ -1,10 +1,23 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class GridRow
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\GridRowRepository")
*/
class GridRow

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
@@ -6,6 +14,11 @@ use App\Application\Sonata\UserBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
/**
* Class PlayedGame
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\PlayedGameRepository")
*/
class PlayedGame

View File

@@ -1,10 +1,23 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class Step
*
* @package App\Entity
* @author system7 <https://www.splendidbear.org>
*
* @ORM\Entity(repositoryClass="App\Repository\StepRepository")
*/
class Step

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\EventListener;
@@ -7,6 +15,12 @@ use Gos\Bundle\WebSocketBundle\Event\ClientErrorEvent;
use Gos\Bundle\WebSocketBundle\Event\ServerEvent;
use Gos\Bundle\WebSocketBundle\Event\ClientRejectedEvent;
/**
* Class MineseekerClientEventListener
*
* @package App\EventListener
* @author system7 <https://www.splendidbear.org>
*/
class MineseekerClientEventListener
{
/**
@@ -14,7 +28,7 @@ class MineseekerClientEventListener
*
* @param ClientEvent $event
*/
public function onClientConnect(ClientEvent $event)
public function onClientConnect(ClientEvent $event): void
{
$conn = $event->getConnection();
@@ -26,7 +40,7 @@ class MineseekerClientEventListener
*
* @param ClientEvent $event
*/
public function onClientDisconnect(ClientEvent $event)
public function onClientDisconnect(ClientEvent $event): void
{
$conn = $event->getConnection();
@@ -38,7 +52,7 @@ class MineseekerClientEventListener
*
* @param ClientErrorEvent $event
*/
public function onClientError(ClientErrorEvent $event)
public function onClientError(ClientErrorEvent $event): void
{
$conn = $event->getConnection();
$e = $event->getException();
@@ -51,7 +65,7 @@ class MineseekerClientEventListener
*
* @param ServerEvent $event
*/
public function onServerStart(ServerEvent $event)
public function onServerStart(ServerEvent $event): void
{
$event = $event->getEventLoop();
@@ -63,7 +77,7 @@ class MineseekerClientEventListener
*
* @param ClientRejectedEvent $event
*/
public function onClientRejected(ClientRejectedEvent $event)
public function onClientRejected(ClientRejectedEvent $event): void
{
$origin = $event->getOrigin;

View File

@@ -1,15 +1,34 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Periodic;
use Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing;
use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;
/**
* Class MinePeriodic
*
* @package App\Periodic
* @author system7 <https://www.splendidbear.org>
*/
class MinePeriodic implements PeriodicInterface
{
/** @var PdoPeriodicPing */
private $ping;
/**
* MinePeriodic constructor.
*
* @param PdoPeriodicPing $ping
*/
public function __construct(PdoPeriodicPing $ping)
{
$this->ping = $ping;

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
@@ -7,13 +15,18 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* @method Gamer|null find($id, $lockMode = null, $lockVersion = null)
* @method Gamer|null findOneBy(array $criteria, array $orderBy = null)
* @method Gamer[] findAll()
* @method Gamer[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
* Class GamerRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*/
class GamerRepository extends ServiceEntityRepository
{
/**
* GamerRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Gamer::class);

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* Class GridRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method Grid|null find($id, $lockMode = null, $lockVersion = null)
* @method Grid|null findOneBy(array $criteria, array $orderBy = null)
* @method Grid[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/
class GridRepository extends ServiceEntityRepository
{
/**
* GridRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Grid::class);

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* Class GridRowRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method GridRow|null find($id, $lockMode = null, $lockVersion = null)
* @method GridRow|null findOneBy(array $criteria, array $orderBy = null)
* @method GridRow[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/
class GridRowRepository extends ServiceEntityRepository
{
/**
* GridRowRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, GridRow::class);

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* Class PlayedGameRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method PlayedGame|null find($id, $lockMode = null, $lockVersion = null)
* @method PlayedGame|null findOneBy(array $criteria, array $orderBy = null)
* @method PlayedGame[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/
class PlayedGameRepository extends ServiceEntityRepository
{
/**
* PlayedGameRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, PlayedGame::class);

View File

@@ -1,4 +1,12 @@
<?php
/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2019 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Repository;
@@ -7,6 +15,11 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* Class StepRepository
*
* @package App\Repository
* @author system7 <https://www.splendidbear.org>
*
* @method Step|null find($id, $lockMode = null, $lockVersion = null)
* @method Step|null findOneBy(array $criteria, array $orderBy = null)
* @method Step[] findAll()
@@ -14,6 +27,11 @@ use Doctrine\Common\Persistence\ManagerRegistry;
*/
class StepRepository extends ServiceEntityRepository
{
/**
* StepRepository constructor.
*
* @param ManagerRegistry $registry
*/
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Step::class);