for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ConferenceTools\Tickets\Report;
use Doctrine\ORM\EntityManagerInterface;
use ConferenceTools\Tickets\Domain\ReadModel\TicketRecord\TicketRecord;
final class MissingDelegateInformation implements ReportInterface
{
/**
* @var EntityManagerInterface
*/
private $em;
* DelegateInformation constructor.
* @param EntityManagerInterface $em
public function __construct(EntityManagerInterface $em)
$this->em = $em;
}
public function produceReport(): array
$report = [];
$tickets = $this->em->getRepository(TicketRecord::class)->findAll();
foreach ($tickets as $ticket)
/** @var TicketRecord $ticket */
if (
empty($ticket->getDelegate()->getEmail()) &&
empty($ticket->getDelegate()->getFirstname()) &&
empty($ticket->getDelegate()->getLastname())
) {
$item = [
'purchase_id' => $ticket->getPurchase()->getPurchaseId(),
'ticket_id' => $ticket->getTicketId(),
'email' => $ticket->getPurchase()->getPurchaserEmail()
];
$report[] = $item;
return $report;