Code Duplication    Length = 20-20 lines in 2 locations

src/PersistenceLayer/CfpPersistenceLayer.php 2 locations

@@ 173-192 (lines=20) @@
170
            throw new \UnexpectedValueException('No CFPs found', 404);
171
        }
172
173
        foreach ($content as $item) {
174
            $cfp = new \Callingallpapers\Api\Entity\Cfp();
175
            $cfp->setName($item['name']);
176
            $cfp->setDateCfpEnd(new \DateTimeImmutable($item['dateCfpEnd']));
177
            $cfp->setDateCfpStart(new \DateTimeImmutable($item['dateCfpStart']));
178
            $cfp->setUri($item['uri']);
179
            $cfp->setTimezone(new \DateTimeZone($item['timezone']));
180
            $cfp->setDateEventStart(new \DateTimeImmutable($item['dateEventStart']));
181
            $cfp->setDateEventEnd(new \DateTimeImmutable($item['dateEventEnd']));
182
            $cfp->setDescription($item['description']);
183
            $cfp->setEventUri($item['eventUri']);
184
            $cfp->setIconUri($item['iconUri']);
185
            $cfp->setLatitude($item['latitude']);
186
            $cfp->setLongitude($item['longitude']);
187
            $cfp->setLocation($item['location']);
188
            $cfp->setTags(explode(',', $item['tags']));
189
            $cfp->setLastUpdated(new \DateTimeImmutable($item['lastUpdate']));
190
191
            $list->add($cfp);
192
        }
193
194
        return $list;
195
    }
@@ 219-238 (lines=20) @@
216
            throw new \UnexpectedValueException('No CFPs found', 404);
217
        }
218
219
        foreach ($content as $item) {
220
            $cfp = new \Callingallpapers\Api\Entity\Cfp();
221
            $cfp->setName($item['name']);
222
            $cfp->setDateCfpEnd(new \DateTimeImmutable($item['dateCfpEnd']));
223
            $cfp->setDateCfpStart(new \DateTimeImmutable($item['dateCfpStart']));
224
            $cfp->setUri($item['uri']);
225
            $cfp->setTimezone(new \DateTimeZone($item['timezone']));
226
            $cfp->setDateEventStart(new \DateTimeImmutable($item['dateEventStart']));
227
            $cfp->setDateEventEnd(new \DateTimeImmutable($item['dateEventEnd']));
228
            $cfp->setDescription($item['description']);
229
            $cfp->setEventUri($item['eventUri']);
230
            $cfp->setIconUri($item['iconUri']);
231
            $cfp->setLatitude($item['latitude']);
232
            $cfp->setLongitude($item['longitude']);
233
            $cfp->setLocation($item['location']);
234
            $cfp->setTags(explode(',', $item['tags']));
235
            $cfp->setLastUpdated(new \DateTimeImmutable($item['lastUpdate']));
236
237
            $list->add($cfp);
238
        }
239
240
        return $list;
241
    }