chg: dev: increase the minimum PHP version to the latest major - and massive refactor on back-end, like Controllers and Repositories #4
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Entity\Grid;
|
||||
use App\Entity\GridRow;
|
||||
use App\Entity\PlayedGame;
|
||||
use App\Interfaces\RpcManagerInterface;
|
||||
use App\Repository\PlayedGameRepository;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
@@ -40,6 +41,7 @@ class RpcManager implements RpcManagerInterface
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly PlayedGameRepository $playedGameRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -47,9 +49,7 @@ class RpcManager implements RpcManagerInterface
|
||||
{
|
||||
$gameAssoc = is_array($params) ? $params[0] : $params;
|
||||
|
||||
$playedGame = $this->entityManager
|
||||
->getRepository(PlayedGame::class)
|
||||
->findOneByGameAssoc($gameAssoc);
|
||||
$playedGame = $this->playedGameRepository->findOneByGameAssoc($gameAssoc);
|
||||
|
||||
if (null === $playedGame) {
|
||||
try {
|
||||
@@ -77,9 +77,7 @@ class RpcManager implements RpcManagerInterface
|
||||
|
||||
public function saveGrid(string $gameAssoc): bool
|
||||
{
|
||||
$existingGame = $this->entityManager
|
||||
->getRepository(PlayedGame::class)
|
||||
->findOneByGameAssoc($gameAssoc);
|
||||
$existingGame = $this->playedGameRepository->findOneByGameAssoc($gameAssoc);
|
||||
|
||||
if (null !== $existingGame) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user