Code Duplication    Length = 7-7 lines in 2 locations

src/Service/Game.php 1 location

@@ 589-595 (lines=7) @@
586
        if ($game->getAnonymousAllowed() && $game->getPlayerForm()) {
587
            $formPV = json_decode($game->getPlayerForm()->getForm(), true);
588
            $header = array('id'=> 1);
589
            foreach ($formPV as $element) {
590
                foreach ($element as $k => $v) {
591
                    if ($k !== 'form_properties') {
592
                        $header[$v[0]['name']] = 1;
593
                    }
594
                }
595
            }
596
        } elseif ($game->getAnonymousAllowed()) {
597
            $header = array(
598
                'id' => 1,

src/Service/PostVote.php 1 location

@@ 662-668 (lines=7) @@
659
        $header = parent::getEntriesHeader($game);
660
        if ($game->getForm()) {
661
            $form = json_decode($game->getForm()->getForm(), true);
662
            foreach ($form as $element) {
663
                foreach ($element as $k => $v) {
664
                    if ($k !== 'form_properties') {
665
                        $header[$v[0]['name']] = 1;
666
                    }
667
                }
668
            }
669
        }
670
        if ($game->getVoteActive()) {
671
            $header['votes'] = 1;