Services/FormService.php
public function isBlocked(string $ip, int $formId): bool
    {
        /**
         * Check for recent submissions by this ip on this form.
         *
         * @var FormSubmission[] $formSubmissions
         */
        $formSubmissions = $this->entityManager->getRepository(FormSubmission::class)->findBy([
            'ip' => $ip,
            'form' => $formId,
        ], [
            'created' => Criteria::DESC,
        ], 1);
        /** @var FormSubmission $formSubmission */
        $formSubmission = !empty($formSubmissions) ? array_values($formSubmissions)[0] : null;

        return null !== $formSubmission && time() < $formSubmission->getExpires()->getTimestamp();
    }
public function isBlocked(string $ip, int $formId): bool
    {
        /**
         * Check for recent submissions by this ip on this form.
         *
         * @var FormSubmission[] $formSubmissions
         */
        $formSubmissions = $this->entityManager->getRepository(FormSubmission::class)->findBy([
            'ip' => $ip,
            'form' => $formId,
        ], [
            'created' => Criteria::DESC,
        ], 1);
        /** @var FormSubmission $formSubmission */
        $formSubmission = !empty($formSubmissions) ? array_values($formSubmissions)[0] : null;

        return null !== $formSubmission && time() < $formSubmission->getExpires()->getTimestamp();
    }
@param string $ip
@param int    $formId

@return bool