Private
Public Access
chg: pkg: upgrade the doctrine related back-end pkgs to the latest available version #7
This commit is contained in:
@@ -54,7 +54,7 @@ class BattleCardGenerator
|
||||
|
||||
public function generate(PlayedGame $game): string
|
||||
{
|
||||
$path = $this->cachePath((int)$game->getId());
|
||||
$path = $this->cachePath((int)$game->id);
|
||||
|
||||
// Always regenerate to ensure bonus points are included
|
||||
if (is_file($path)) {
|
||||
@@ -108,13 +108,13 @@ class BattleCardGenerator
|
||||
imageline($im, self::WIDTH / 2, 110, self::WIDTH / 2, self::HEIGHT - 80, $divider);
|
||||
|
||||
/** Resolve names*/
|
||||
$redName = $game->getRed()?->getUsername()
|
||||
?? ($game->getRedAnon() !== null ? 'Anonymous' : 'Guest');
|
||||
$blueName = $game->getBlue()?->getUsername()
|
||||
?? ($game->getBlueAnon() !== null ? 'Anonymous' : 'Guest');
|
||||
$redPts = $game->getRedPoints();
|
||||
$bluePts = $game->getBluePoints();
|
||||
$resign = $game->getResign();
|
||||
$redName = $game->red?->getUsername()
|
||||
?? ($game->redAnon !== null ? 'Anonymous' : 'Guest');
|
||||
$blueName = $game->blue?->getUsername()
|
||||
?? ($game->blueAnon !== null ? 'Anonymous' : 'Guest');
|
||||
$redPts = $game->redPoints;
|
||||
$bluePts = $game->bluePoints;
|
||||
$resign = $game->resign;
|
||||
|
||||
/** Winner*/
|
||||
$winner = null;
|
||||
@@ -135,8 +135,8 @@ class BattleCardGenerator
|
||||
$this->centeredText($im, 'BLUE', 16, 980, 130, $blue);
|
||||
|
||||
/** Draw avatars below the team labels (moved down by 60px total: 200 → 260)*/
|
||||
$redAvatar = $game->getRed()?->getAvatarPath();
|
||||
$blueAvatar = $game->getBlue()?->getAvatarPath();
|
||||
$redAvatar = $game->red?->avatarPath;
|
||||
$blueAvatar = $game->blue?->avatarPath;
|
||||
|
||||
$this->drawAvatar($im, $redAvatar, 220, 260, $red, $redName);
|
||||
$this->drawAvatar($im, $blueAvatar, 980, 260, $blue, $blueName);
|
||||
@@ -156,8 +156,8 @@ class BattleCardGenerator
|
||||
$this->centeredText($im, $scoreText, 72, self::WIDTH / 2, 390, $white);
|
||||
|
||||
/** Bonus points below score*/
|
||||
$redBonusPoints = $game->getRedBonusPoints() ?? 0;
|
||||
$blueBonusPoints = $game->getBlueBonusPoints() ?? 0;
|
||||
$redBonusPoints = $game->redBonusPoints ?? 0;
|
||||
$blueBonusPoints = $game->blueBonusPoints ?? 0;
|
||||
$bonusText = number_format((float)$redBonusPoints, 1, '.', '') . ' * : * ' . number_format((float)$blueBonusPoints, 1, '.', '');
|
||||
$this->centeredText($im, $bonusText, 24, self::WIDTH / 2, 425, $gold);
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ readonly final class SendContactMailService
|
||||
new TemplatedEmail()
|
||||
->from('noreply@mineseeker.hu')
|
||||
->to($this->appContactMailAddress)
|
||||
->replyTo($contactMessage->getEmail())
|
||||
->subject('New Contact Message from ' . $contactMessage->getName())
|
||||
->replyTo($contactMessage->email)
|
||||
->subject('New Contact Message from ' . $contactMessage->name)
|
||||
->htmlTemplate('emails/contact_notification.html.twig')
|
||||
->context(['message' => $contactMessage])
|
||||
);
|
||||
|
||||
@@ -70,10 +70,10 @@ readonly final class ResolveUserNamesService
|
||||
|
||||
private function resolveOpponentName(PlayedGame $game, string $myUserName): string
|
||||
{
|
||||
$redName = $game->getRed()?->getUsername();
|
||||
$blueName = $game->getBlue()?->getUsername();
|
||||
$redAnonName = $game->getRedAnon()?->getUserName();
|
||||
$blueAnonName = $game->getBlueAnon()?->getUserName();
|
||||
$redName = $game->red?->getUsername();
|
||||
$blueName = $game->blue?->getUsername();
|
||||
$redAnonName = $game->redAnon?->userName;
|
||||
$blueAnonName = $game->blueAnon?->userName;
|
||||
|
||||
$isRed = $myUserName === $redName || $myUserName === $redAnonName;
|
||||
$isBlue = $myUserName === $blueName || $myUserName === $blueAnonName;
|
||||
|
||||
@@ -39,11 +39,11 @@ readonly class WebAuthnService
|
||||
public function saveCredential(User $user, array $credentialData, string $name): WebAuthnCredential
|
||||
{
|
||||
$credential = new WebAuthnCredential();
|
||||
$credential->setUser($user);
|
||||
$credential->setCredentialData(json_encode($credentialData));
|
||||
$credential->setCredentialName($name);
|
||||
$credential->setBackupEligible($credentialData['isBackupEligible'] ?? false);
|
||||
$credential->setBackupAuthenticated($credentialData['isBackupAuthenticated'] ?? false);
|
||||
$credential->user = $user;
|
||||
$credential->credentialData = json_encode($credentialData);
|
||||
$credential->credentialName = $name;
|
||||
$credential->isBackupEligible = $credentialData['isBackupEligible'] ?? false;
|
||||
$credential->isBackupAuthenticated = $credentialData['isBackupAuthenticated'] ?? false;
|
||||
|
||||
$this->entityManager->persist($credential);
|
||||
$this->entityManager->flush();
|
||||
@@ -60,7 +60,7 @@ readonly class WebAuthnService
|
||||
{
|
||||
$credential = $this->credentialRepository->find($id);
|
||||
|
||||
if ($credential === null || $credential->getUser() !== $user) {
|
||||
if ($credential === null || $credential->user !== $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,11 +74,11 @@ readonly class WebAuthnService
|
||||
{
|
||||
$credential = $this->credentialRepository->find($id);
|
||||
|
||||
if ($credential === null || $credential->getUser() !== $user) {
|
||||
if ($credential === null || $credential->user !== $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$credential->setCredentialName($name);
|
||||
$credential->credentialName = $name;
|
||||
$this->entityManager->flush();
|
||||
|
||||
return true;
|
||||
@@ -99,7 +99,7 @@ readonly class WebAuthnService
|
||||
$sources = [];
|
||||
|
||||
foreach ($credentials as $credential) {
|
||||
$data = $credential->getCredentialData();
|
||||
$data = $credential->credentialData;
|
||||
|
||||
if ($data === null) {
|
||||
continue;
|
||||
@@ -109,7 +109,7 @@ readonly class WebAuthnService
|
||||
$sources[] = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
throw new RuntimeException(
|
||||
"Failed to decode credential data for credential ID $credential->getId(): $e->getMessage()",
|
||||
"Failed to decode credential data for credential ID {$credential->id}: {$e->getMessage()}",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -122,13 +122,13 @@ readonly class WebAuthnService
|
||||
$credentials = $this->credentialRepository->findByUser($user);
|
||||
|
||||
foreach ($credentials as $credential) {
|
||||
$data = json_decode($credential->getCredentialData() ?? '{}', true);
|
||||
$data = json_decode($credential->credentialData ?? '{}', true);
|
||||
|
||||
if (($data['id'] ?? null) !== $credentialId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$credential->setLastUsedAt(new DateTime());
|
||||
$credential->lastUsedAt = new DateTime();
|
||||
$this->entityManager->flush();
|
||||
break;
|
||||
}
|
||||
@@ -139,13 +139,13 @@ readonly class WebAuthnService
|
||||
$allCredentials = $this->credentialRepository->findAll();
|
||||
|
||||
foreach ($allCredentials as $credential) {
|
||||
$data = json_decode($credential->getCredentialData() ?? '{}', true);
|
||||
$data = json_decode($credential->credentialData ?? '{}', true);
|
||||
|
||||
if (($data['id'] ?? null) !== $credentialId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return $credential->getUser();
|
||||
return $credential->user;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user