Code Duplication    Length = 20-21 lines in 2 locations

src/AppBundle/Admin/PerformanceEventAdmin.php 2 locations

@@ 338-358 (lines=21) @@
335
     */
336
    public function getSeat(Venue $venue, $row, VenueSector $venueSector, $place = null)
337
    {
338
        if ($place === null) {
339
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findBy([
340
                'row' => $row,
341
                'venueSector' => $venueSector,
342
            ]);
343
            if (!$seat) {
344
                $this
345
                    ->getConfigurationPool()
346
                    ->getContainer()
347
                    ->get('session')
348
                    ->getFlashBag()
349
                    ->add(
350
                        'error',
351
                        "Помилка. В залi $venue немає $row ряда в секторі $venueSector!"
352
                    );
353
                throw new ModelManagerException('Error row!');
354
            }
355
            foreach ($seat as $placeAllInRow) {
356
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
357
            }
358
        }
359
        if ($place !== null) {
360
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findOneBy([
361
                'row' => $row,
@@ 359-378 (lines=20) @@
356
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
357
            }
358
        }
359
        if ($place !== null) {
360
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findOneBy([
361
                'row' => $row,
362
                'place' => $place,
363
                'venueSector' => $venueSector,
364
            ]);
365
            if (!$seat) {
366
                $this
367
                    ->getConfigurationPool()
368
                    ->getContainer()
369
                    ->get('session')
370
                    ->getFlashBag()
371
                    ->add(
372
                        'error',
373
                        "Помилка. В залi $venue немає $row - $place в секторі $venueSector!"
374
                    );
375
                throw new ModelManagerException('Error row-place!');
376
            }
377
            self::inspectSeatMoreThanOnePrice($row, $place, $venueSector);
378
        }
379
    }
380
381
    /**