/** * @param EmailSendReceive $emailSendCheckI * * @throws EmailReceiveCheckException */ protected function timeReceiveCheck(EmailSendReceive $emailSendCheckI) { $timeLeft = time() - $emailSendCheckI->getSentAt()->getTimestamp(); if ($timeLeft > $this->getReceiveMaxTime()) { $emailSendCheckI->setStatus(EmailSendReceive::STATUS_EXPIRED); $emailSendCheckI->setReceivedAt(new DateTime()); throw EmailReceiveCheckException::receivingMaxTimeExpire($emailSendCheckI->getSubject(), $timeLeft, $this->getReceiveMaxTime()); } }