chg: dev: refactor the code - there was unnecessary codes and wrongly formatted or designed code that are related to Repositories #7

This commit is contained in:
2026-04-20 11:10:00 +02:00
parent cd93a26c2c
commit f493f94368
7 changed files with 122 additions and 143 deletions
+5 -5
View File
@@ -11,7 +11,7 @@
namespace App\Service;
use App\Entity\PlayedGame;
use App\Repository\PlayedGameRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RequestStack;
@@ -30,9 +30,9 @@ use Symfony\Component\HttpFoundation\RequestStack;
readonly final class ResolveUserNamesService
{
public function __construct(
private RequestStack $requestStack,
private Security $security,
private PlayedGameRepository $playedGameRepository,
private EntityManagerInterface $em,
private RequestStack $requestStack,
private Security $security,
) {
}
@@ -44,7 +44,7 @@ readonly final class ResolveUserNamesService
return '';
}
if (null === $game = $this->playedGameRepository->findOneByGameAssoc($gameAssoc)) {
if (null === $game = $this->em->getRepository(PlayedGame::class)->findOneByGameAssoc($gameAssoc)) {
return '';
}