diff --git a/src/Command/MeilisearchConsistencyCommand.php b/src/Command/MeilisearchConsistencyCommand.php index d4571e6..3d29ddd 100644 --- a/src/Command/MeilisearchConsistencyCommand.php +++ b/src/Command/MeilisearchConsistencyCommand.php @@ -180,7 +180,7 @@ class MeilisearchConsistencyCommand extends Command $dbEvents = $this->em->getRepository(Event::class)->findAll(); } - if (!$indexExists && $fix) { + if (!$indexExists) { $this->meilisearch->request('POST', self::INDEXES_ENDPOINT, ['uid' => $index, 'primaryKey' => 'id']); $io->text(sprintf(' [%s] Created index, indexing %d event(s)', $index, \count($dbEvents))); foreach ($dbEvents as $event) { @@ -223,7 +223,7 @@ class MeilisearchConsistencyCommand extends Command $dbOrders = $this->em->getRepository(BilletBuyer::class)->findBy(['event' => $event]); - if (!$indexExists && $fix) { + if (!$indexExists) { $this->meilisearch->request('POST', self::INDEXES_ENDPOINT, ['uid' => $index, 'primaryKey' => 'id']); $io->text(sprintf(' [%s] Created index, indexing %d order(s)', $index, \count($dbOrders))); foreach ($dbOrders as $order) { @@ -265,7 +265,7 @@ class MeilisearchConsistencyCommand extends Command $dbUsers = $this->filterUsers($isOrganizer); - if (!$indexExists && $fix) { + if (!$indexExists) { return $this->createUserIndex($index, $dbUsers, $isOrganizer, $io); } diff --git a/src/Controller/AccountController.php b/src/Controller/AccountController.php index 5ce5c0b..7896953 100644 --- a/src/Controller/AccountController.php +++ b/src/Controller/AccountController.php @@ -40,6 +40,7 @@ class AccountController extends AbstractController private const DQL_EXCLUDE_INVITATIONS = 'o.isInvitation = false OR o.isInvitation IS NULL'; private const DQL_BB_EXCLUDE_INVITATIONS = 'bb.isInvitation = false OR bb.isInvitation IS NULL'; private const CONTENT_TYPE_PDF = 'application/pdf'; + private const PDF_SUFFIX = '.pdf"'; #[Route('/mon-compte', name: 'app_account')] public function index(Request $request, StripeService $stripeService, EntityManagerInterface $em, PaginatorInterface $paginator, EventIndexService $eventIndex): Response @@ -952,7 +953,7 @@ class AccountController extends AbstractController return new Response($pdf, 200, [ 'Content-Type' => self::CONTENT_TYPE_PDF, - 'Content-Disposition' => 'inline; filename="'.$ticket->getReference().'.pdf"', + 'Content-Disposition' => 'inline; filename="'.$ticket->getReference().self::PDF_SUFFIX, ]); } @@ -1083,7 +1084,7 @@ class AccountController extends AbstractController return new Response($dompdf->output(), 200, [ 'Content-Type' => self::CONTENT_TYPE_PDF, - 'Content-Disposition' => 'inline; filename="attestation_'.$event->getSlug().'_'.date('Y-m-d').'.pdf"', + 'Content-Disposition' => 'inline; filename="attestation_'.$event->getSlug().'_'.date('Y-m-d').self::PDF_SUFFIX, ]); } @@ -1387,7 +1388,7 @@ class AccountController extends AbstractController return new Response($pdfService->generate($payout), 200, [ 'Content-Type' => self::CONTENT_TYPE_PDF, - 'Content-Disposition' => 'inline; filename="attestation_'.$payout->getStripePayoutId().'.pdf"', + 'Content-Disposition' => 'inline; filename="attestation_'.$payout->getStripePayoutId().self::PDF_SUFFIX, ]); } diff --git a/src/Entity/Attestation.php b/src/Entity/Attestation.php index d8c8f64..ff37d62 100644 --- a/src/Entity/Attestation.php +++ b/src/Entity/Attestation.php @@ -37,6 +37,7 @@ class Attestation #[ORM\Column] private \DateTimeImmutable $createdAt; + /** @param array $payload */ public function __construct(string $reference, string $signatureHash, Event $event, User $generatedBy, int $totalSold, array $payload) { $this->reference = $reference;