Code Duplication    Length = 11-11 lines in 3 locations

src/Service/Item/Search/Selector/Builder.php 3 locations

@@ 109-119 (lines=11) @@
106
     *
107
     * @return Builder
108
     */
109
    public function addDatePremiere(Search $entity)
110
    {
111
        if ($entity->getDatePremiere() instanceof \DateTime) {
112
            $this->add(function (QueryBuilder $query) use ($entity) {
113
                $query
114
                    ->andWhere('i.date_premiere >= :date_premiere')
115
                    ->setParameter('date_premiere', $entity->getDatePremiere()->format('Y-m-d'));
116
            });
117
        }
118
119
        return $this;
120
    }
121
122
    /**
@@ 91-101 (lines=11) @@
88
     *
89
     * @return Builder
90
     */
91
    public function addDateAdd(Search $entity)
92
    {
93
        if ($entity->getDateAdd() instanceof \DateTime) {
94
            $this->add(function (QueryBuilder $query) use ($entity) {
95
                $query
96
                    ->andWhere('i.date_add >= :date_add')
97
                    ->setParameter('date_add', $entity->getDateAdd()->format('Y-m-d'));
98
            });
99
        }
100
101
        return $this;
102
    }
103
104
    /**
@@ 127-137 (lines=11) @@
124
     *
125
     * @return Builder
126
     */
127
    public function addDateEnd(Search $entity)
128
    {
129
        if ($entity->getDateEnd() instanceof \DateTime) {
130
            $this->add(function (QueryBuilder $query) use ($entity) {
131
                $query
132
                    ->andWhere('i.date_end <= :date_end')
133
                    ->setParameter('date_end', $entity->getDateEnd()->format('Y-m-d'));
134
            });
135
        }
136
137
        return $this;
138
    }
139
140
    /**