Private
Public Access
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:
@@ -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 '';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user