Code Duplication    Length = 20-21 lines in 2 locations

src/AppBundle/Admin/PerformanceEventAdmin.php 2 locations

@@ 283-303 (lines=21) @@
280
     */
281
    public function getSeat(Venue $venue, $row, VenueSector $venueSector, $place = null)
282
    {
283
        if ($place === null) {
284
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findBy([
285
                'row' => $row,
286
                'venueSector' => $venueSector,
287
            ]);
288
            if (!$seat) {
289
                $this
290
                    ->getConfigurationPool()
291
                    ->getContainer()
292
                    ->get('session')
293
                    ->getFlashBag()
294
                    ->add(
295
                        'error',
296
                        "Помилка. В залi $venue немає $row ряда в секторі $venueSector!"
297
                    );
298
                throw new ModelManagerException('Error row!');
299
            }
300
            foreach ($seat as $placeAllInRow) {
301
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
302
            }
303
        }
304
        if ($place !== null) {
305
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findOneBy([
306
                'row' => $row,
@@ 304-323 (lines=20) @@
301
                self::inspectSeatMoreThanOnePrice($row, $placeAllInRow->getPlace(), $venueSector);
302
            }
303
        }
304
        if ($place !== null) {
305
            $seat = $this->getEm()->getRepository('AppBundle:Seat')->findOneBy([
306
                'row' => $row,
307
                'place' => $place,
308
                'venueSector' => $venueSector,
309
            ]);
310
            if (!$seat) {
311
                $this
312
                    ->getConfigurationPool()
313
                    ->getContainer()
314
                    ->get('session')
315
                    ->getFlashBag()
316
                    ->add(
317
                        'error',
318
                        "Помилка. В залi $venue немає $row - $place в секторі $venueSector!"
319
                    );
320
                throw new ModelManagerException('Error row-place!');
321
            }
322
            self::inspectSeatMoreThanOnePrice($row, $place, $venueSector);
323
        }
324
    }
325
326
    /**