Code Duplication    Length = 20-21 lines in 2 locations

src/AppBundle/Admin/PerformanceEventAdmin.php 2 locations

@@ 255-275 (lines=21) @@
252
    private function getSeat(Venue $venue, $row, VenueSector $venueSector, $place = null)
253
    {
254
        $em = $this->getConfigurationPool()->getContainer()->get('Doctrine')->getManager();
255
        if ($place === null) {
256
            $seat = $em->getRepository('AppBundle:Seat')->findBy([
257
                'row' => $row,
258
                'venueSector' => $venueSector,
259
            ]);
260
            if (!$seat) {
261
                $this
262
                    ->getConfigurationPool()
263
                    ->getContainer()
264
                    ->get('session')
265
                    ->getFlashBag()
266
                    ->add(
267
                        'error',
268
                        "Помилка. В залi $venue немає $row ряда в секторі $venueSector!"
269
                    );
270
                throw new ModelManagerException('Error row!');
271
            }
272
            foreach ($seat as $placeAllInRow) {
273
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
274
            }
275
        }
276
        if ($place !== null) {
277
            $seat = $em->getRepository('AppBundle:Seat')->findOneBy([
278
                'row' => $row,
@@ 276-295 (lines=20) @@
273
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
274
            }
275
        }
276
        if ($place !== null) {
277
            $seat = $em->getRepository('AppBundle:Seat')->findOneBy([
278
                'row' => $row,
279
                'place' => $place,
280
                'venueSector' => $venueSector,
281
            ]);
282
            if (!$seat) {
283
                $this
284
                    ->getConfigurationPool()
285
                    ->getContainer()
286
                    ->get('session')
287
                    ->getFlashBag()
288
                    ->add(
289
                        'error',
290
                        "Помилка. В залi $venue немає $row - $place в секторі $venueSector!"
291
                    );
292
                throw new ModelManagerException('Error row-place!');
293
            }
294
            self::inspectSeatMoreThanOnePrice($row, $place, $venueSector);
295
        }
296
    }
297
298
    /**