Code Duplication    Length = 7-7 lines in 2 locations

src/AppBundle/Controller/SurveyController.php 2 locations

@@ 43-49 (lines=7) @@
40
    {
41
        $em = $this->getDoctrine()->getManager();
42
        $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey);
43
        if ($answers) {
44
            foreach ($answers as $answer) {
45
                $questions[] = $answer->getQuestion()->getId();
46
                $contents[] = $answer->getContent();
47
            }
48
            $questionAnswer = array_combine($questions, $contents);
49
        }
50
        if (!$answers) {
51
            $questionAnswer = null;
52
        }
@@ 93-99 (lines=7) @@
90
    {
91
        $em = $this->getDoctrine()->getManager();
92
        $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey);
93
        if ($answers) {
94
            foreach ($answers as $answer) {
95
                $questions[] = $answer->getQuestion()->getId();
96
                $contents[] = $answer->getContent();
97
            }
98
            $questionAnswer = array_combine($questions, $contents);
99
        }
100
        if (!$answers) {
101
            $questionAnswer = null;
102
        }