Code Duplication    Length = 4-4 lines in 2 locations

Entity/Repositories/MailgunEventRepository.php 2 locations

@@ 65-68 (lines=4) @@
62
                ->setParameter("domain", $criteria['domain']);
63
        }
64
65
        if (array_key_exists('recipient', $criteria) && $criteria['recipient'] != "") {
66
            $qb->andWhere("e.recipient like :recipient")
67
                ->setParameter("recipient", "%".$criteria['recipient']."%");
68
        }
69
70
        if (array_key_exists('eventType', $criteria) && $criteria['eventType'] != "all") {
71
            $qb->andWhere("e.event = :eventType")
@@ 75-78 (lines=4) @@
72
                ->setParameter("eventType", $criteria['eventType']);
73
        }
74
75
        if (array_key_exists('search', $criteria) && $criteria['search'] != "") {
76
            $qb->andWhere("(e.messageHeaders like :search OR e.description like :search OR e.notification like :search OR e.reason like :search OR e.errorCode like :search OR e.ip like :search OR e.error like :search OR e.country like :search OR e.city like :search OR e.campaignId like :search OR e.campaignName like :search OR e.clientName like :search OR e.clientOs like :search OR e.clientType like :search OR e.deviceType like :search OR e.mailingList like :search OR e.messageId like :search OR e.tag like :search OR e.userAgent like :search OR e.url like :search)")
77
                ->setParameter("search", "%".$criteria['search']."%");
78
        }
79
80
        if ($lookForUnopened) {
81
            $qb->andWhere("NOT EXISTS (SELECT o.id FROM AzineMailgunWebhooksBundle:MailgunEvent o WHERE o.messageId like e.messageId AND o.event in ('opened', 'clicked', 'unsubscribed', 'complained'))");